Set a watchpoint

Watchpoints can be set to stop program execution each time the value of an expression changes. In order to set the watchpoint, the program must be running in the Debugger.

  1. Set a breakpoint in the function that has the variable expression in scope.
  2. Start debugging the program.
  3. When the program stops at the breakpoint, select the Data view tab to display the variables.
  4. Right-click the variable and select Add to watch to add the variable to the Watchpoints view.
    Figure: Setting a WatchPoint

    This figure is a screenshot of Setting a WatchPoint.
  5. Continue running the program. The program will stop when the value of a watched variable changes. You can see the values in the Watchpoints view.