Setting and Removing Watch Conditions
You use a watch condition to request a job breakpoint
when the contents of a specified variable (or an expression that relates to
a substring or an array element) is changed from its current value. Setting
watch conditions is similar to setting conditional job breakpoints, with these
important differences:
- Watch conditions stop the program as soon as the value of a watched expression or variable changes from its current value.
- Conditional job breakpoints stop the program only if a variable changes to the value specified in the condition.
The debugger watches an expression or a variable through the contents of
a storage address, computed at the time the watch condition
is set. When the content at the storage address is changed from the value
it had when the watch condition was set or when the last watch condition occurred,
the program stops.
Note: After a watch condition has been registered,
the new contents at the watched storage location are saved as the new current
value of the corresponding expression or variable. The next watch condition
will be registered if the new contents at the watched storage location change
subsequently.