When a debugging session is running, the Source Editor highlights the current line in green. If program execution is stopped in a method call, the line from which the call was made is highlighted in purple. Any line that has a breakpoint is highlighted in red.
The Source Editor also provides the following debugging features:
Annotations are marks in the left margin of the Source Editor. These marks relay information, such as a breakpoint or call site, on the adjacent line. The following table describes the debugging annotations in the Source Editor.
Annotation | Description |
---|---|
![]() | Breakpoint |
![]() | Disabled breakpoint |
![]() | Multiple breakpoints |
![]() | Conditional breakpoint |
![]() | Disabled conditional breakpoint |
![]() | Program counter |
![]() | Program counter and one breakpoint |
![]() | Program counter and multiple breakpoints |
![]() | The call site or place in the source code from which the current call on the call stack was made |
You can evaluate a variable directly in the Source Editor by moving the pointer over the variable. If the variable is active in the current context, the value of the variable is displayed in a tool tip. In cases where a program includes different variables with the same name, the Source Editor displays the value based on the current context, and not on the instance of the variable in the source code.
You can add and remove a line breakpoint to any line in the Source Editor
by clicking in the left margin. If there is no breakpoint on the line, the line
is highlighted and the symbol is added to the left margin. If the line contains
a breakpoint, the breakpoint is removed.
The Source Editor can also help in creating more complex breakpoints. When you open the New Breakpoint dialog box, some fields, such as the package name and class name, may be filled in based on the location of the insertion point in the Source Editor.
You can also create a watch based on the location of the insertion point in the Source Editor. When you open the New Watch dialog box, the Watch Expression field contains the name of the variable or expression on the line.
See Also | |
---|---|
Breakpoints in the IDE Using Annotations Annotation Properties Current Context in the Debugger |