16. Debugging Your Application : How Debugging an Application Works : How You Can Use the Watch Facility
 
Share this page                  
How You Can Use the Watch Facility
The watch facility examines selected local and global variables to determine whether a change in their value has occurred or their specified value has been reached.
Control of execution during the watch state is the same as when the application is running in a normal state except that the Step To End choice is not available. Control can be exercised by selecting Step, Step Into, or Continue while in the watch state of execution.
The watch facility places the Debugger in a watch state whenever there are entries in the Watch window. You can use the Debugger window to examine the value of watch items line by line until one or more of the watch values are reached or a watch change in value is triggered.
The Tools, Watchpoint menu command lets you select a variable as a watchpoint. The value entered for the variable is the watch value. After a watch value is reached, the Debugger is given control at the beginning of the next statement following the one that set the watch value.
While the Debugger has control, you can do the following:
Examine new variables
Enter new watch values
Delete variables from either the Examine window (the data values display area) or the Watch window
Terminate the watch by deleting all of the variables in the Watch window
Execution continues when you again select one of the execution control options.