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.
- Set
a breakpoint in the function that has the variable expression
in scope.
 
- Start debugging the
program.
 
- When the program stops at the breakpoint, select the Data view tab to display the variables.
 
- Right-click the variable and select Add to watch to add the variable to the Watchpoints
view.
 
Figure 1. Setting a WatchPoint
 
 
- Continue running the program. The program will stop when the value of a watched variable
changes. You can see the values in the Watchpoint view.