The Add Breakpoint dialog box enables you to set a breakpoint
in your code in order to pause execution of your program. Open this dialog box from
the main window by
choosing Debug Add Breakpoint.
You can set a breakpoint on a line, method, exception, class, thread, and variable. To set a breakpoint, choose the breakpoint type from the combo box at the top of the dialog box and specify its settings. The following table describes the breakpoint types and the information you need to supply to set them.
To break on | Do this |
---|---|
A line | Type a class name and a line number. |
A method | Type a class name and a method name. |
An exception | Type the full name of the subclass of the exception or error (for example, java.lang.InternalError). From the Stop on combo box, choose whether to trigger the breakpoint when the exception is caught or not. |
A class | Type the class name and, from the Breakpoint set on combo box, choose whether to trigger the breakpoint when the class is loaded into the virtual machine, unloaded from the virtual machine, or both. |
A thread | From the Breakpoint set on combo box, choose whether to trigger the breakpoint when a thread starts, stops, or both. |
A variable | Type the class and field names and, from the Stop on combo box, choose whether to trigger the breakpoint when the variable is accessed (for example, the method was called with the variable as an argument) or modified. |
For breakpoints set on a variable, method, line, and exception, you can set a condition so that the breakpoint triggers when an expression evaluates to true. For example, to stop at a breakpoint when x == 75, type x == 75 in the Condition text field.
You can apply two actions to a breakpoint: