Advanced Issues (Watch Window)
Scope
AVR Studio will first search for the symbol as if it contains scope information. If no such symbol is found, AVR Studio appends the symbol name to the current scope, and searches for this new symbol. If no such symbol is found, the symbol is unbound, "???" appears in the type field, and the value field remains empty. If the symbol name is found, the symbol is bound, the symbol with scope information is displayed in the watch field, and the type and value fields are filled out. Every time execution stops, AVR Studio tries to bind unbound symbols using the current scope.

It is not possible to have floating symbols. Once a symbol is bound, it remains bound. The watches are remembered between sessions. Whether or not the symbol has been bound is a part of this information. If the program enters a scope where a bound symbol is not visible, the value field changes to Out of scope.

Arrays and Structs
The Watch window can be used for watching C arrays and structs as well as simple variables. The syntax is the same as in C (use braces ('[' and ']') for arrays and dot ('.') for structs). Dereferencing pointers is supported. When watching arrays, variables can be used for dynamically indexing the arrays. It is for example possible to watch "my_array[i]" if i is an integer in the same scope as the array my_array.
 

See Also
Return to Watch Window