How to: Specify a Hit Count
This topic applies to:
Pro and Team
Does not apply
Command or commands hidden by default.
Hit count keeps track of how many times a breakpoint is hit.
By default, execution breaks every time a breakpoint is hit. You can choose to:
Break always (the default).
Break when the hit count equals a specified value.
Break when the hit count equals a multiple of a specified value.
Break when the hit count is greater or equal to a specified value.
If you want to keep track of the number of times a breakpoint is hit but never break execution, you can set the hit count to a very high value so that the breakpoint is never hit.
The specified hit count is retained only for the debugging session. When the debugging session ends, the hit count is reset to zero.
To specify a hit count
In the Breakpoints window, right-click on a breakpoint and choose Hit Count from the shortcut menu
In a source, Disassembly, or Call Stack window, right-click on a line containing a breakpoint and choose Hit Count from the Breakpoints submenu in the shortcut menu.
In the Hit Count dialog box, choose the behavior you want from When the breakpoint is hit list box.
If you choose any setting other than break always, an edit box appears next to the list box. Edit the integer that appears in the edit box to set the hit count you want.