SET WATCHPOINT

Set a data breakpoint.

Syntax

SET WATCHPOINT [/LENGTH=bytes] [/ACCESS= {READWRITE | WRITE | IO}] AT expression [WHEN condition] [SKIP count] [CONTINUE] [SYMBOL dbid] [THEN actions END] [DISABLE]

Parameters

expression

The parameter expression can be:

A name of a global variable

An address

/LENGTH=bytes

Specifies the size of the monitored memory region. This overrides the default which is the size of the result of expression.

/ACCESS= {READ | WRITE | ALL}

Specifies the type of memory access.

READWRITE (default)

data read/write

WRITE

data write

IO

IO read/write

WHEN condition

Evaluates the expression at program break. If the condition result is FALSE (zero), program execution continues. In this case, an optional skip count remains unchanged. The parameter condition may be any valid expression described in C C++ Expressions Overview.

SKIP count

Stops program execution if this breakpoint is reached for the (count+1)-th time (and the WHEN clause is true).

CONTINUE

Continues execution after processing the action list. The debugger variable @ERROR is checked. If it has a non-zero value, the loop is stopped and the next command is executed.

SYMBOL bid

Stores the ID number of the data breakpoint into the debugger variable bid. This variable may be used in expressions or to enable, disable, show, or delete this data breakpoint.

actions

An optional command list, enclosed by the keywords THEN and END. It is executed if the program stops at this data breakpoint. If more than one action is specified, they must be separated by a delimiter (;).

DISABLE

Adds the data breakpoint to the breakpoint list, but does not set it on the target until you enter the ENABLE WATCHPOINT command. This option is important for saving and restoring the current state of the breakpoint list.

Description

The SET WATCHPOINT option sets a data breakpoint at a specified location. If the location of expression is accessed in a way specified by /ACCESS and /LENGTH, and the SKIP counter decrements to zero, the program stops.

The default value for count is 1, for /LENGTH it is the size of the result of expression, and for /ACCESS it is ALL.

Example

SET WATCHPOINT AT array[10]
SET WATCHPOINT /ACCESS=WRITE AT deadzone
SET WATCHPOINT /ACCESS=READWRITE AT box1 CONTINUE
THEN
 PRINT "fetch mailbox %5d" box1
 END

See Also


For more complete information about compiler optimizations, see our Optimization Notice.