Setting watchpoint

Use the Add Watchpoint dialog ( Creating watchpoint) to set a watchpoint. When the value at the memory address on which you set a watchpoint changes, your program's execution halts and the debugger takes control.

To set a watchpoint:

  1. Open the Debug perspective.
  2. Open any of the following views:
    • Breakpoints
    • Memory
    • Register
    • Variables
  3. Right-click in the selected view.

    The process of setting a watchpoint varies depending upon the type of view:

    • Registers - select register(s) on which you want to set the watchpoint and choose Watch from the shortcut menu that appears.
    • Variables - select global variable(s) and choose Watch from the shortcut menu.
    • Breakpoints - choose Add Watchpoint (C/C++) from the shortcut menu.

      The Add Watchpoint dialog appears.

    • Memory - select the addressable unit or range of units on which you want to set the watchpoint, right-click, and choose Add Watchpoint (C/C++) from the shortcut menu that appears.

      The Add Watchpoint dialog appears.

The Breakpoints view shows information about the newly set watchpoint and the number of addressable units that the watchpoint monitors.

The Problems view shows error messages if the debugger fails to set a watchpoint.