- Starting a Debugging Session
- Attaching the Debugger to a Running Application
- Starting the Debugger Outside of the Project's Main Class
- Stepping Through Code
- Setting Breakpoints
- Managing Breakpoints
- Customizing Breakpoint Behavior
- Monitoring Variables and Expressions
- Backing Up from a Method to Its Call
- Monitoring and Controlling Execution of Threads
- Fixing Code During a Debugging Session
- Viewing Multiple Debugger Windows Simultaneously
Managing Breakpoints
You can use the Breakpoints window, shown in Figure 5-5, to manage breakpoints in one place. You can put breakpoints in groups, temporarily disable breakpoints, and provide customizations to the breakpoints from this window. To open the Breakpoints window, choose Window | Debugging | Breakpoints or press Alt-Shift-5.
Figure 5-5 Breakpoints window
Grouping Related Breakpoints
In some cases, you might have several related breakpoints that you would like to be able to enable, disable, or delete together. Or maybe you merely want to consolidate some breakpoints under one node to make the Breakpoints window less cluttered.
To group some breakpoints:
- Open the Breakpoints window by choosing Window | Debugging | Breakpoints (Alt-Shift-5).
- Shift-click or Ctrl-click to select the breakpoints that you want to group. Then right-click the selection and choose Set Group Name.
- The breakpoints are grouped under an expandable node.
Enabling and Disabling Breakpoints
You might find it useful to keep breakpoints set throughout your application, but you might not want to have all of the breakpoints active at all times. If this is the case, you can disable a breakpoint or breakpoint group and preserve it for later use.
To disable a breakpoint or breakpoint group:
- Open the Breakpoints window by choosing Window | Debugging | Breakpoints (Alt-Shift-5).
- In the Breakpoints window, right-click the breakpoint or breakpoint group and choose Disable.
Deleting a Breakpoint
To delete a line breakpoint, click the left margin of the line that has the breakpoint or click in the line and press Ctrl-F8.
To delete another type of breakpoint:
- Open the Breakpoints window by choosing Window | Debugging | Breakpoints (Alt-Shift-5).
- In the Breakpoints window, right-click the breakpoint and choose Delete.