Applying Hit Counts for Breakpoints

A hit count can be applied to breakpoints. When a hit count is applied to a breakpoint, the breakpoint suspends execution of a thread the nth time it is hit, but never again, until it is re-enabled or the hit count is changed or disabled. 

Note: When the breakpoint is hit for the nth time, the thread that hit the breakpoint suspends. The breakpoint is disabled until either it is re-enabled or its hit count is changed.

 To set a hit count on a breakpoint

  1. In the Properties view, click into the line where the breakpoint is set.
  2. Press Ctrl+J (Mac OS: Cmd+J) to open code editor. The code editor will be opened with the line of code corresponding to the one selected in the Properties highlighted. Right-click (Mac OS: Ctrl+click) the breakpoint to which a hit count is to be added in the marker bar (vertical ruler) and select Breakpoint Properties from the popup menu. 
  3. The Properties for... dialog box will be displayed.
  4. Select the Hit Count check box.
  5. In the edit box to the right, type the number of times you want to hit the breakpoint before suspending execution.
  6. Click OK to close the dialog and commit the changes.