Breaking On Modify

Related Topics:

Data Change Tracking Breaking On Value Change
Breaking On Condition Breakpoints Window

You can set an On Modify breakpoint to stop program execution when the contents of a variable or memory address changes.

To set an On Modify breakpoint:

1. In the Debugging Window, choose Windows Breakpoints. Or, choose Execute Set Breakpoints.

2. If the Details pane of the Breakpoints window is not displayed, click the Add/Change Breakpoint button (the Add/Change Breakpoint button toggles to Hide Details).

3. Choose Event On Modify and type the address you want to watch in the Event text box. For example:
&var
&var + 40

If you want to watch changes to a variable, be sure to include an ampersand (&) before the variable name. This is required for C and C++ users.

4. If you are using a hexadecimal address or are using the address of a variable with an unknown type, enter the size of the memory area you want to watch, preceded by a comma. For example:
0x1234, 4

5. Choose Action Stop.

6. Click Add.

The breakpoint triggers whenever the memory area is written to, even if it is the same value.