A variable in Real-Time Watch Window doesn't display correct value and is not updated

01-Aug-2024

Possible solutions

Enable Real-time update in the Watch window

Symbols in the Watch window may not be updated while the application is running due to a disabled Real-time update.


Check your download files

Most often the reason for the incorrect symbol value displayed in the Watch window is, that the symbol's debug information (address, size, format,...) is loaded from the wrong Symbol File when more than one symbol file is specified for one application.

You can change the Default file for debugging from the drop-down menu, where symbol files are listed (go to Debug | Configure Session | Application | Symbol Files).


Make sure your code is not optimized

1. Step through the disassembly of your code.

2. Make sure that the code is executed. 

3. If that is not the case, you can use the volatile function.


Add variables via the Symbol browser

It's recommended to add variables to the Watch window via Add new watch  | Symbol browser. This way the syntax is correct and you do not have to edit it manually. 


Manually edit syntax in the Watch window

You can also manually fix the syntax. Variables should be specified with fully qualified names to reduce ambiguity during symbol evaluation.


winIDEA resolves the syntax in the following manner.

Syntax to access a variable that is static on a file scope:

"<module name>"#<var name>


For example, to access gs_byCount variable in the TestfileA.c module, use the following syntax in the Watch window:

"TestfileA.c#"gs_byCount


Syntax to access a variable that is static on a function scope:

<function name>##<var name>


For example, to access s_byCount variable in the main function, use the following syntax:

main##s_byCount


If the application (winIDEA workspace) only has one download file, the download file will not be added to the symbol expression. If there are multiple download files, then the download file will be listed for all symbols even if there are no collisions.


Syntax to access a variable that is defined in a non-default download file (secondOutput.elf)

Use the following syntax (two commas) with or example iCounter:

iCounter,,secondOutput.elf


More resources in winIDEA Help

Was this answer helpful?