Note: Watchpoints are allowed only on global variables.
To add a watchpoint:
Right-click on the global variable in the Variables view and select
Add Watchpoint (C/C++).
Enter an expression in the field. When a variable is highlighted in the view,
it will be automatically added to the field in this dialog.
The expression may be anything that can be evaluated inside an
if statement (e.g. y==1).
To stop the program when it reads the watch expression, select
Read; to stop the program when it writes the
expression, select Write.
Click OK. The watchpoint is highlighted in the
Breakpoints view list.