Setting a Breakpoint on a Line
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
Add Breakpoint dialog box.
To set a line breakpoint using the Source Editor:
 |
Clicking in the toolbar or pressing Shift-F8 also sets and removes breakpoints on the current line.
|
To set a line breakpoint using the Add Breakpoint dialog box:
- Click in the line in the Source Editor.
- From the main window, choose Debug
Add Breakpoint (Ctrl-Shift-F8).
- In the Add Breakpoint dialog box, select Line from the Breakpoint Type combo box.
- Specify the breakpoint settings:
- Package Name, Class name, and Line Number. If these fields are not already filled in, enter the desired information.
- Condition. To set a condition so the breakpoint occurs when an expression evaluates to True, type a Boolean expression in this text field.
For information on the syntax rules for setting a condition, see Conditional Breakpoints.
- Specify the actions to take when the breakpoint is hit:
-
Suspend Debugging. If selected, all threads in the debugging session are temporarily stopped when the program reaches the breakpoint.
- Print Text. If selected, the specified message is printed in the Output window
when the breakpoint is hit. You can use a combination of text,
substitution codes, curly braces and a dollar sign in the message.
An example is {$mywatch}.
- Click OK.
The breakpoint is added to the Breakpoints view of the Debugger
window.
Legal Notices