Megosztás a következőn keresztül:


How to: Specify a Hit Count

This topic applies to:

Edition

Visual Basic

C#

F#

C++

Web Developer

Express

Topic does not apply Topic does not apply Topic does not apply Topic applies Topic does not apply

Pro, Premium, and Ultimate

Topic applies

Topic applies

Topic applies

Topic applies

Topic applies

Hit count keeps track of how many times a breakpoint is hit.

By default, execution breaks every time that 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 than 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

  1. In the Breakpoints window, right-click a breakpoint, and then click Hit Count on the shortcut menu.

    -or-

    In a source, Disassembly, or Call Stack window, right-click a line that contains a breakpoint, and then click Hit Count from the Breakpoints submenu on the shortcut menu.

  2. In the Hit Count dialog box, select the behavior you want from the When the breakpoint is hit list.

    If you choose any setting other than Break always, a text box appears next to the list. Edit the integer that appears in the text box to set the hit count you want.

  3. Click OK.

See Also

Tasks

How to: Specify a Breakpoint Condition

Other Resources

Breakpoints and Tracepoints