User manual

UM0036 Basic debugging features
Doc ID 7705 Rev 11 191/385
5.12 Watch window
In addition to the Watch window description, this section provides information about:
Expanding the display
Modifying values
Watch contextual menu
To open the Watch window, select View>Watch.
The Watch window displays the current value of selected program variables when the
executable is stopped. Enter the variables that you want to monitor in the left-hand column
of the window. The information is updated each time the executable stops, or by means of
the Refresh All option in the Watch contextual menu.
The values displayed are those in the context of the current Program Counter (PC) position.
You can change this context by setting the Call Stack Frame indicator in the Call Stack
window (see Section 5.10: Call stack window). The Watch window is refreshed to display
variable values at the position of the Frame indicator.
You can add program symbols from the source files to the Watch window in several ways:
The variable name may be typed directly into the left column (double-click on the first
empty row in the table to open it for keyboard entry).
Alternatively, a variable may be selected in the Editor window and dragged and
dropped into the Watch window.
The QuickWatch window also provides the button option Add to Watch, to include the
QuickWatch variable in the current Watch window.
Figure 137. Watch window
Four pages (accessible by tabs) are provided in the Watch window to permit grouping of
variables in particular contexts (for example, function_x in Watch 1, function_y in Watch 2).
Expanding the display
A structure, bitfield, array or pointer listed in the Watch window can be expanded. The
sign '+' before the variable indicates that it is expandable. Click on the + sign to open the
next level of display:
Structure, bitfield: The + symbol displays each member of a structure or bitfield.
Array: In an array, the + symbol opens only the first member.
Pointer: The + symbol opens a second line displaying the variable pointed to.