Set a Watchpoint (OS/2, Windows)
You can set a watchpoint (a storage change breakpoint) from any view that displays the
contents of a portion of storage, for example a local variables view, monitored
expressions view, or storage view. After the watchpoint is set, execution will stop each
time the storage designated by the watchpoint is written to (or read, if you choose to set
the watchpoint up for reads). To set a watchpoint, follow the steps below.
- If the variable's value is already displayed, skip to step 5.
- Select the variable in a source or declarations view
- Click mouse button 2, and select the
object.
- From the resulting cascading menu, select Show Variable Value. A pane opens showing the
variable value. Move the pointer to this pane.
- Click mouse button 2 on the
expander for the variable,
or on the contents of the variable if these are shown.
- Choose Set watchpoint.
You can set characteristics of the watchpoint, such as whether it applies to writes
only, or to reads of the location as well, from a details view of the breakpoint:
- If a details view of the breakpoint is not already visible, click mouse button 2 on the
watchpoint in the Breakpoints view of the Breakpoints page.
- In the Details view of the Breakpoints page, expand the watchpoint by clicking on the +
icon to its left.
- Change the settings for the watchpoint by selecting appropriate radio buttons. You can
change the number of bytes the watchpoint applies to, and whether the watchpoint stops
execution only when the storage is written, or whenever the storage is either written or
read.

Types of Breakpoints

Enable, Disable, or Delete Breakpoints from a Breakpoints View
Set Breakpoints Before Debugging
Set Breakpoints Within Debug Pages