Setting a Breakpoint on a Class
When you set a breakpoint on a class (for example,
javax.swing.JButton), you can choose to stop the debugger
when the class is loaded into the
virtual machine, unloaded from the virtual machine, or both.
To set a breakpoint on a class:
- From the main menu, choose Debug
Add Breakpoint (Ctrl-Shift-F8).
- In the Add Breakpoint dialog box, select Class from the Breakpoint
Type combo box.
- Specify the breakpoint settings:
- Package Name and Class name. If these fields are not already filled in, enter the desired information. You can use an asterisk (*) for the package name or class name. For example, if you specify java.lang as the package name and * for the class name, program execution stops whenever
any class from the package is loaded.
- Exclusion Filter.
Select this checkbox if you want to suspend program execution when a class whose name does not match the specified class name is loaded. If this box is not checked, program execution is suspended when a class with the specified name is loaded.
- Breakpoint Set On. Specify whether
to trigger the breakpoint when the class is loaded into the virtual machine, when the class is unloaded from the virtual machine, or both.
- 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