Setting a Line Breakpoint
You can set a simple breakpoint on a specified line from within the Source Editor. If you want to specify an action to perform when the breakpoint is hit or trigger the breakpoint only when a specified condition is met, use the
New Breakpoint dialog box.
To set a line breakpoint using the Source Editor:
To set a line breakpoint using the New Breakpoint dialog box:
(The following instructions are specific to the Java 2 debugger.)
- From the main menu, choose Debug
New Breakpoint (Ctrl-Shift-F8).
- If your version of the New Breakpoint dialog box includes the Debugger combo box, set the value to Java.
- Set the Breakpoint Type to Line.
- Specify the breakpoint settings.
- Package Name, Class Name, and Line Number. If these fields are already filled in, the information is based on the location of the insertion point in the Source Editor.
- Condition. A Boolean expression that triggers the breakpoint when the expression evaluates to True.
For information on the syntax rules for setting a condition, see Setting a Condition on a Breakpoint.
- Specify the actions to take when the breakpoint is triggered:
-
Suspend Debugging. If selected, all threads in the debugged program are temporarily stopped.
- Print Text. If selected, the specified message is printed in the Debugger Console view in the Output window. For information on the tags you can include in the message, see Printing a Breakpoint Message.
- Click OK.
The breakpoint is added to the Breakpoints view of the Debugger
window.
Legal Notices