Source Panel

The Source Panel is a panel in the top-level Main Window, located under the debugger's Tool Bar.

The Source Panel displays Java source files. Each source file is displayed in its own tabbed pane with the corresponding class name displayed on the tab. The full class name (including package names) is also displayed as a tool tip on the tab. The Source Panel only displays a maximum number of the most recently displayed source files. This maximum number is set in the Global Settings Dialog and defaults to ten (10). This is to keep the Source Panel from being overwhelmed with source files. A popup menu is displayed by right clicking on the tab name:

A source file can be displayed in the debugger in the following ways: In order to a source file to be displayed, the corresponding source path must have been correctly setup in the Source Tree Panel.

Immediately above the source code, the label on the left-hand side displays the corresponding source file name. A tool tip displays the full path. The label on the right-hand side displays the method name containing the current PC (Program Counter) in the debugger, if the PC is in this source file.

Immediately below the source code, the label on the left displays (in blue) name of the thread (and the corresponding thread object ID) in the current context. A tool tip displays the full thread name (including thread group names). The label on the right displays (in red) the reason that the target JVM is currently stopped, or displays (in green) that the target JVM is currently running. A tool tip displays more information about the stop reason.

source code

The source code display uses syntax highlighting as follows:

Each source file has the following annotations in the left margin:

Note that a method breakpoint will not be annotated in the left margin if the debugger cannot figure out the corresponding line number by parsing the source file. For example, one possible reason would be that a method name is overloaded, and the corresponding method argument types were not specified when setting the breakpoint.

To directly set/clear a breakpoint, click on the leftmost column on the appropriate line. To directly enable/disable a breakpoint, hold down the control (Ctrl) key and click on the leftmost column on the appropriate line (that already has a breakpoint set).

source code tool tips

Tool Tips in the source code can display the following values (along with displaying the corresponding type names): For object references, the Tool Tip displays the object's fields in the inheritance hierarchy. For array references, the Tool Tip displays the beginning array elements. For string references, the Tool Tip displays the beginning string characters. The number of lines displayed in a Tool Tip is configurable in the Global Settings Dialog.

context menu

A popup Context Menu is displayed by right clicking on the source code:
Menu Item Accelerator Description
Inspect... F9 Inspects the value of the variable name or expression (see source code tool tips above for supported expressions) at the blinking cursor position in the source code, according to the current scope. A non-null object reference is displayed in the Object Panel in the top-level Objects Window. A non-null array reference is displayed in the Array Panel in the top-level Objects Window. Strings are displayed in the String Panel in the top-level String/To String Window. Note that the value of a variable or expression, in the current scope, can also be displayed as a tool tip.
To String...   Invokes the toString() method on the variable name or expression (see source code tool tips above for supported expressions) at the blinking cursor position in the source code, according to the current scope, for a non-null object reference and displays the resulting string in the To String Panel in the top-level String/To String Window.
Toggle Breakpoint F2 Toggles (Set/Clear) the breakpoint at the line at the blinking cursor position in the source code.
Enable/Disable Breakpoint Shift-F2 Enables a disabled breakpoint, or disables an enabled breakpoint, at the line at the blinking cursor position in the source code.
Set Method Breakpoint Ctrl-F2 To create a breakpoint when a particular method is called, navigate to the method body in the source code. Click to place the blinking cursor anywhere on the same line as the method name in the method signature, and then select Set Method Breakpoint from the right-click pop-up menu.
Add to Watch Panel 1 Ctrl-1 Adds the variable name or expression (see source code tool tips above for supported expressions) at the blinking cursor position in the source code, according to the current scope, to Watch Panel 1.
Add to Watch Panel 2 Ctrl-2 Adds the variable name or expression (see source code tool tips above for supported expressions) at the blinking cursor position in the source code, according to the current scope, to Watch Panel 2.
Hot Swap...   Displays a File Selection Dialog for the user to select a .class file to Hot Swap (if supported by the target JVM) for the corresponding class according to the context of the blinking cursor position in the source code; can be an inner class.
Open External Editor... Ctrl-O Launches an External Text Editor in which to edit the top currently displayed source file. The External Text Editor is configured in the Global Settings Dialog.
Help... F1 Displays this Help.

©2001-2010. debugtools.com LLC. All rights reserved.