The Source Editor provides debugging information through the use of highlights on code lines, annotations in the left margin, and tool tips on variables. In addition, you can create breakpoints and watches based on the location of the insertion point in the Source Editor.
The Source Editor highlights the current line in green. Any line that has a breakpoint is highlighted in red. All colors are configurable.
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 switch the display of a simple breakpoint on a specified line from within 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.
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 | |
---|---|
Setting Breakpoints
Using the Call Stack Using Annotations Annotation Properties Current Context in the Debugger |