Incurring Watchpoints

Description

A watchpoint is incurred when a watched variable has changed, the skip counter is either zero or not specified, and the Ignore option is not specified. When a watchpoint is encountered, the following occurs:

  • If an IF condition is specified, it is evaluated.
  • The watchpoint counter is incremented.
  • If the Ignore option is set for the given watchpoint, execution continues.
  • If the skip count for this watchpoint is non-zero, the count is decremented and execution is continued; the skip count for an ignored watchpoint is not affected.
  • The debugger announces the occurrence of the watchpoint. Output from the WATCH command includes the block name, the activation number, the line number where the change occurred, and the new and old hexadecimal values of the variable.
  • If an action-list is specified, it is executed.
  • The debugger prompt appears on the screen.

Example

In the following example, a watchpoint is set on variable n with an action-list to continue program execution. The value of n is input from the user.

CodeWatch> WATCH n /ACTION [C] 
CodeWatch> CONTINUE

Input maximum prime boundary: 10
Program Stopped due to a Watchpoint
Watched variable N modified about line PRIMES\118 
New Value: 10 {fixed binary (31)}
Break at PRIME\119