Setting a Breakpoint on a Method Name
A breakpoint set on a method name stops program execution every time the method is executed.
To set a breakpoint on a method:
- Select the method name in either the Source Editor or Explorer.
- From the main window, choose Debug
Add Breakpoint (Ctrl-Shift-F8).
- In the Add Breakpoint dialog box, select Method from the Breakpoint Type combo box.
- Specify the breakpoint settings:
- Package Name, Class name, and Method Name. If these fields are not already filled in, enter the desired information.
- Apply Also to Anonymous Inner Classes.
Select this checkbox if you want to apply the breakpoint to all anonymous inner classes that
the named class contains.
If an anonymous
class contains another inner class (either anonymous or named), the
breakpoint also applies to the inner class.
If this checkbox is not selected, the breakpoint applies only to
the named class.
- All Methods for Given Classes.
Select this checkbox if you want to apply the breakpoint to all methods of
the specified class. When this checkbox is selected, the Method Name field becomes disabled.
- 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