You copied the Doc URL to your clipboard.

Working with watchpoints

Watchpoints can be used to stop your target when a specific memory address is accessed by your program.

  • If monitoring a global variable, in the Variables view, right-click on a data symbol and select Toggle Watchpoint to display the``Add Watchpoint`` dialog.
  • If monitoring a memory address, in the Disassembly view, right-click on a memory address and select Toggle Watchpoint to display the Add Watchpoint dialog.

    Figure 7-3 Setting a watchpoint on a data symbol

    Setting a watchpoint on a data symbol

Setting a watchpoint

  1. Select the required Access Type. You can choose:

    • Read Read access watchpoint Read access watchpoint - To stop the target when a read access occurs.
    • Write Write access watchpoint Write access watchpoint - To stop the target when a write access occurs.
    • Access Read or Write access watchpoint Read or Write access watchpoint - To stop the target when either a read or write access occurs.
  2. If you want to enable the watchpoint when it is created, select Enable.

    Note

    The default is enabled, but if a conditional watchpoint exists, the watchpoint is created disabled. Only one watchpoint can be enabled if a conditional watchpoint exists.
  3. Specify the width to watch at the given address, in bits. Accepted values are: 8, 16, 32, and 64 if supported by the target.

    This parameter is optional. The width defaults to:

    • 32 bits for an address.
    • The width corresponding to the type of the symbol or expression, if entered.
  4. Expand Stop Condition and in the Expression field, enter a C-style expression. For example, if your application code has a variable x, then you can specify: x == 10. If no expression is specified, then the breakpoint or watchpoint condition is deleted.
  5. Click OK to apply your selection.

If you created a watchpoint to monitor a global variable, you can view it in the Variables view. If you created a watchpoint to monitor a memory address, you can view it in the Memory view.

Also, you can view all watchpoints and breakpoints in your application in the Breakpoints view.

Deleting a watchpoint

To delete a watchpoint, right-click a watchpoint and either select Remove Watchpoint or select Toggle Watchpoint.

Disabling a watchpoint

To disable a watchpoint, right-click a watchpoint and select Disable Watchpoint to temporarily disable it. To re-enable it, select Enable Watchpoint.