The breakpoints pane displays the currently set breakpoints. You can add breakpoints while viewing your source code. Breakpoints displayed in the breakpoints pane show the line number, iteration, the condition on which the breakpoint is set, the Execute when hit expression, the Resume if true expression, as well as the total number of hits for each breakpoint.
Right-clicking a breakpoint in the breakpoints pane displays a menu with the following options:
|
|
Execute code and print values to the Output window when application code reaches a Breakpoint.
|
> In the Execute when hit field, type an expression. For example, type System.out.println(foo).
|
Resume program execution if a breakpoint expression is true.
|
> In the Resume if true field, type an expression. When the application execution reaches the breakpoint, the program execution resumes if the expression value is true.
|
Stop the application after a certain number of iterations through a breakpoint.
|
> In the Iteration field, type a positive integer. When you start debugging, execution stops when the number of iterations through a breakpoint equals the number you entered.
|
Stop the application when a condition is true.
|
> In the Condition field, type a boolean expression, such as x==100. The Hits field calculates the number of times the application stops at a breakpoint when the Condition is true or the Condition field is empty.
|
Remove a breakpoint.
|
- Open the source file.
- In the Edit window, click the line of code that contains the breakpoint to remove.
- On the Debug menu, click Breakpoint > Delete Breakpoint at Cursor.
|
Remove all breakpoints.
|
- On the View menu, click Breakpoints.
- In the breakpoints pane, click Delete All.
|