4.8.2.7 How to: Specify a Data Breakpoint Hit Count

Hit Count

The number of times the value stored in the specified memory location is accessed (read/write).

To Specify a Hit Count

To specify or edit the Hit Count property, you must open the Hit Count Dialog Box.

Select a breakpoint row in the Data Breakpoints window. Then choose Hit Count on the context menu.

Figure 4-8. Hit Count Dialog Box

To set or modify a hit count property, use the following controls:

  • When the breakpoint is hit: This setting determines how the breakpoint should behave when it 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
  • Current hit count: This value shows the number of times the data breakpoint has been hit. A read/write data for a variable will be converted into multiple instructions, resulting in several memory accesses. So the data breakpoint hits several times for the same variable, and the hit count is updated accordingly.
  • Reset: This button resets the value shown for the Current hit count to 0.

If you choose any option other than the default in When the breakpoint is hit list control, an edit box appears next to it. Edit the value in this edit box to set the hit count value. For example, choose a break when the hit count is equal to and enter 5, which causes execution to stop the 5th time the breakpoint is hit, not on any other hit.