Watch expressions, or watches for short, are expressions that the debugger evaluates and prints the result of every time the program is stopped; for example, after everythrough the program.
From the main menu, select View ▸ Watches to open the Watches window.
Like local variables, all watch expressions are displayed in a tree with children used to represent structure or array members.
The name of the variable or the expression.
The variable or expression value.
The type of the variable or of the expression result.
Watch expressions can be updated automatically as soon as the program is stopped or on user request.
To set a watch expression to update automatically:
In the Watches window, select the watch you want to update automatically. Right-click and check that Automatic Update if checked. If not, select it.
To update a watch expression manually:
In the Watches window, right click and select Update Watch to update the selected watch.
To update all watch expressions manually at once:
In the Watches window, right click and select Update all to update all watches at the same time.
To add an expression to the watch list:
From the main menu, select Debug ▸ Add Watch... or in the Watches window, right-click and select Add Watch....
Enter the expression to watch. Check Automatic Update if you want the expression to be evaluated each time the program is stopped.
An expression can be evaluated and then added as a watch like this:
From the main menu, select Debug ▸ Inspect/Evaluate or right click in the Editor window and select Inspect/Evaluate.
Click on Add button to add this expression to the watches list.
You can remove an expression from the watches list.
In the Watches window, select the watch you want to remove, then right-click and select Remove Watch.
All watches can be removed at the same time.
In the Watches window, right-click and select Remove all.
If a watch expression corresponds to a variable, you can change its value.
In the Watches window, select the variable you want to edit and double click in the Value column.
Enter the new value.
Got a comment? Spotted an error? Found the instructions unclear? Send feedback about this page.