Keil Logo

Watch Window

The Watch window allows to evaluate symbols, registers, and expressions. The window displays the item name, value, and type.

Watch Window ButtonOpen this window through the toolbar button or using the menu View – Watch Windows.

Watch Window Display

Where

search box Allows finding expressions within the current name list. The search string can consist of alphanumeric characters and mask characters as described in the appendix F. Regular Search Expressions.
Name Lists the expression name. Symbol names comply to the rules described in Program Variables (Symbols).


Items are marked with an icon:

  • Structure icon - identifies items of a complex type, such as structures or arrays.
  • Simple icon - identifies items of a simple type, such as integers or characters.
Value Shows the memory address or the evaluated value of an expression. This field can contain explanatory text. Expressions of the type unsigned char show the value and the corresponding character. A single-quote () indicates that the value was restored from a previous debugging session.


Values are updated:

  • Whenever program execution stops.
  • During program execution when View - Periodic Window Update is enabled.
  • When clicking the Toolbox button Update Windows.
Type Shows the type of the expression. For functions the field shows the return and parameter types.

Using the Watch Window

Drag&drop expressions to other windows, for example to a Memory, Command, or Logic Analyzer window.

Add an Expression

  • Double-click the text <Enter expression> and start editing. Refer to the section Expressions for details.
  • Drag&drop expressions from other windows into the Watch window.
  • Open the context menu of a file. Use Add item to - Watch #. The variable beneath the mouse position is added to the Watch window.
  • Use the command WatchSet in the window Command.

Remove an Expression

  • Click on the item name and press the Delete key.
  • Use the command WatchKill in the window Command.

Change the Value of an Expression

  • Click on the value-field and start editing. Not all expressions accept changes.

The context menu allows:

  • Removing an expression.
  • Changing the value representation.
  • Setting breakpoints.
  • Adding expressions to other windows.
  • Showing or hiding the toolbar that contains the search box.
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.