0

enter image description here

Can not get variable value in debug view and eclipse can not stop execution at breakpoint

import java.io.*;
import jxl.*;

public class Excelread {
    public static void main(String[] args) throws Throwable {
        String Filename = "C:\\library\\TestData.xls";
        String Sheetname = "Source";
        String[][] arrayExcelData = null;
        FileInputStream fis = new FileInputStream(Filename);
        Workbook WB = Workbook.getWorkbook(fis);
        Sheet SH = WB.getSheet(Sheetname);
        int TotalCol = SH.getColumns();
        int TotalRow = SH.getRows();
        System.out.println(TotalCol + " " + TotalRow);
        arrayExcelData = new String[TotalRow][TotalCol];
        for (int i = 0; i < TotalRow; i++) {
            for (int j = 0; j < TotalCol; j++) {
                arrayExcelData[i][j] = SH.getCell(j, i).getContents();
                System.out.print(arrayExcelData[i][j] + "\t");
            }
            System.out.println();
        }

    }
}
ojchase
  • 1,041
  • 1
  • 10
  • 22
  • The program has stopped running, so there are no variables anymore. If the breakpoint never breaks, then the code stops running *before* getting to that point. Perhaps it threw an exception and you should look at the program output. – Andreas Nov 27 '17 at 07:01
  • Whats the difference to your old question? [Eclipse debug execute Java program without stopping at breakpoint](https://stackoverflow.com/q/47483566/8097737) –  Nov 27 '17 at 07:01
  • Are you running with Debug as or Run as? Starting with Run won't attach the debugger. – Greg H Nov 27 '17 at 07:01
  • @Andreas Here i cannot understand why my code won't break at breakpoint ? – mahesh babu Nov 27 '17 at 07:06
  • @GregH I did it with debug as – mahesh babu Nov 27 '17 at 07:07
  • @maheshbabu Read and follow this tutorial: [Java Debugging with Eclipse](http://www.vogella.com/tutorials/EclipseDebugging/article.html). If you still have the problem, edit your post to provide a step by step explanation what you want, what you have done and what doesn't work as intended. By the way your breakpoint looks odd, i can't find the icon (crossed out `T`) on [JDT Icons](http://help.eclipse.org/oxygen/index.jsp?topic=%2Forg.eclipse.jdt.doc.user%2Freference%2Fref-icons.htm). –  Nov 27 '17 at 08:33
  • 4
    The breakpoint icon looks like it's conditioned on a [Trigger Point breakpoint](https://help.eclipse.org/oxygen/index.jsp?topic=%2Forg.eclipse.jdt.doc.user%2Freference%2Fbreakpoints%2Fref-triggerpoint_option.htm) (it has a `T` with a slash) located outside the viewable code. Try removing *all* breakpoints, then re-add the one you want. The breakpoint icon should be a circle with no markers. – Andreas Nov 27 '17 at 17:36
  • 1
    @devpuh A breakpoint with a `T` is a [Trigger Point](https://help.eclipse.org/oxygen/index.jsp?topic=%2Forg.eclipse.jdt.doc.user%2Freference%2Fbreakpoints%2Fref-triggerpoint_option.htm), and when one of those exist, all other breakpoints are marked with a **cut `T`** (like the one in the question), to show that they won't fire until the Trigger Point has been reached. OP has probably been playing with breakpoints and has marked another breakpoint elsewhere as a Trigger Point, thereby *disabled* all triggers, since code never reaches the trigger point. – Andreas Nov 27 '17 at 17:40
  • @Andreas I still use a old version of eclipse and haven't seen any Trigger Point and no documentation has mention it. I should definitely read the eclipse news, for example [Debugging the Eclipse IDE for Java Developers](https://www.eclipse.org/community/eclipse_newsletter/2017/june/article1.php). Also your comment is the answer to the question. –  Nov 28 '17 at 06:26
  • Be sure to check if 'Skip all Breakpoints' toggle is not switched on by mistake in Breakpoints view in Eclipse. – Afser2000 Jun 27 '20 at 18:13

1 Answers1

5

Andreas has already answered the question, your Problem is cause by a Trigger Point.
(These are introduced in Eclipse Oxygen)

In your workspace is at least one breakpoint defined as a Trigger Point (Icon: Trigger Point Icon), therefore all other breakpoints (Icon: Suppressed Breakpoint Icon) are suppressed as long as no Trigger Point is hit.

Unfortunately you have probably defined somewhere in your workspace a Trigger Point which is never triggered (or not before the other breakpoints) so eclipse would never stop.

To fix this you can disable all Trigger Points or remove all breakpoints and only set those which you really need.


Here is a example for a misused Trigger Point: Workspace with unreached Trigger Point

As you can see the Breakpoint on line 10 is defined as a Trigger Point but is in a private method which is never called, therefore the Breakpoint at line 6 will never stop the program.

Now we just disable the faulty Breakpoint at line 10 and eclipse will stop as intended on line 6.

Workspace with unreached disabled Trigger Point


Also read Debugging the Eclipse IDE for Java Developers for the new debugging functions in Eclipse Oxygen.