Setting a Variable Breakpoint
The following instructions are specific to the Java 2 debugger.
To set a breakpoint on a variable:
- 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 Variable.
- Specify the breakpoint settings. If these fields are already filled in, the information is based on the location of the insertion point in the Source Editor.
- Package Name. The name of the package you want the debugger to stop on. You can use an asterisk (*) for the package name.
- Class Name. The name of the class file.
You can also use an asterisk for the class name. For example, if you specify java.lang as the package name and * for the class name, the breakpoint applies to
any class from the package java.lang.
- Field Name. The name of the field.
- Stop on. When to trigger the breakpoint. Variable Access stops your program when it queries a variable in the specified class and field. Variable Modification stops your program when the value of the variable changes.
- 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 of 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