Watch Window
The Watch window can display the types and values of symbols (variables) in a program containing symbolic debug information. There can only be one Watch window active at a time. The watched symbols (with scope information) are remembered between sessions. The watch window contains four views, all which can display watches. The different views are selected and displayed by clicking the tabs at the bottom of the watch window.

The watch window displays simple as well as complex data types. Complex data types as arrays and structures are displayed with a pluss sign next to the symbol. This indicates that it can be "expanded", showing its members. Click on the pluss sign to expand a complex data type.

The Watch window has four columns. The first column is the name of the symbol which is being watched. The next is the value of the symbol, the third is the type of the symbol and the fourth is the address. By default, the Watch window is empty, i.e. all the symbols the user would like to watch have to be added to the Watch window. Once a symbol has been added, it is remembered also in subsequent executions of the programs.

A tool tip window will show the scope that the watch is bound to, if the mouse pointer is positioned over the watch item.

If the watch window is not open, it can be created by selecting Watch from the View menu, or by clicking the Watch Window symbol on the Views toolbar. It is closed by clicking the Close Window button in the top right corner of the window. Subsequent selection of the Watch menu item or toolbar button will toggle the window on and off. The watches are remembered both when closing and toggling the watch window, but expanded data types will collapse if the window is closed explisitly.

Add a symbol to the Watch Window
There are several ways to add a symbol to the watch window:

If the Watch window is not present when the Add Watch command is given, the Watch window is created, and already defined watches are reinserted (if any).

Delete a symbol in the Watch Window
The user can delete a watch by first marking the symbol to be deleted in the Watch window and then select Delete Watch from the Watch menu or from the Debug toolbar. If the Watch window is the active window, a marked symbol can also be deleted by pressing the Del key.

Delete all Watches
The Delete all watches command is available from the Watch menu. When this command is issued, all defined watches are removed from the Watch window.

Editing the value of a symbol using the watch window
The value of symbols displayed in the watch window can be edited by double-clicking on their value field. Binary, decimal and hexadecimal number format is supported. Binary values are prefixed with 0b and hexadecimal values are prefixed with 0x.

To edit a complex data type, expand it and edit it's members.

See Also
Advanced Issues (Watch Window)
Return to AVR Studio User's Guide