Watches

Frozen Content

The following content has been imported from Legacy Help systems and is in the process of being checked for accuracy.

Function

The Watches panel enables you to create and display a list of watch expressions, allowing you to keep track of variable/expression values as you single-step debug the source code of an embedded software project.

Content and Use

The panel lists, for each watch that is added, the Expression (what to watch for) and the Value (the evaluation of the expression at the current line in the source code).

A small icon to the left of the watch expression is used to indicate the status of the watch:

-

Source code execution has entered a function or procedure where the watch expression is valid (i.e. variable(s) in the watch expression are defined and used in the function or procedure)

-

Source code execution has entered a function or procedure where the watch expression is invalid (i.e. variable(s) in the watch expression are not defined and used anywhere in the function or procedure). This state will also arise if the expression defined for the watch is not valid

-

Watch is disabled

As you step through the lines of code in the source document, the watch expressions will be evaluated and the corresponding values updated.

Right-click Menu

The right-click pop-up menu for the panel provides the following commands:

  • Add - use this command to access the Add Watch dialog, from where you can define a new watch to add to the list of watches in the panel.

Define the required expression that you wish to monitor. For example, the expression could be a particular variable that is used in the code (e.g. OUT, a, Remainder), or an expression based on one or more defined variables (e.g. OUT=OUT+Remainder). Clicking OK will add the new watch to the panel, at the bottom of the list

  • Delete - delete the selected watch(es)
  • Edit - edit the expression for the currently focused watch
  • Enable - enable the selected watch(es)
  • Disable - disable the selected watch(es)
  • Enable All - change the current state of all watches listed in the panel to enabled
  • Disable All - change the current state of all watches listed in the panel to disabled
  • Delete All - delete all currently defined watches listed in the panel

Notes

  • The value of an expression is updated after the line of code has been executed.
  • Standard CTRL + Click and SHIFT + Click functionality is supported for selection of multiple watches in the panel.
  • The focused watch entry is distinguished by a dotted outline. Multiple entries may be selected, but only one entry will be given the focus.
  • The keyboard shortcuts Up Arrow and Down Arrow can be used to select the previous and next watch entry, respectively.
  • The Watch Expression field in the Add Watch dialog supports standard text editing features such as cut, copy and paste. The latter enables you to copy a variable name directly from the source code and paste it into the dialog.
  • The Add Watch dialog can also be accessed using the Add Watch command, available from the Debug menu or toolbar.

See Also

You are reporting an issue with the following selected text and/or image within the active document: