Java Reference
In-Depth Information
F.1
Breakpoints
A breakpoint is a flag attached to a line of code (Figure F.2). When a breakpoint is reached dur-
ing program execution, the debugger's displays and controls become active, allowing you to
inspect the state of the program and control further execution.
Figure F.2
A breakpoint attached
to a line of code
Breakpoints are set via the editor window. Either press the left mouse button in the breakpoint area
to the left of the source text or place the cursor on the line of code where the breakpoint should be
and select Set/Clear Breakpoint from the editor's Tools menu. Breakpoints can be removed by the
reverse process. Breakpoints can be set only within classes that have been compiled.
F.2
The control buttons
Figure F.3 shows the control buttons that are active at a breakpoint.
Figure F.3
Active control buttons
at a breakpoint
F.2.1 Halt
The Halt button is active when the program is running, thus allowing execution to be inter-
rupted should that be necessary. If execution is halted, the debugger will show the state of the
program as if a breakpoint had been reached.
F.2.2 Step
The Step button resumes execution at the current statement. Execution will pause again when the
statement is completed. If the statement involves a method call, the complete method call is com-
pleted before the execution pauses again (unless the call leads to another explicit breakpoint).
Search WWH ::




Custom Search