Categories

{{ selectedCategory.name }}

{{ topic.Title }} {{ topic.Ddate | formatDate }}

{{ topic.Content }}

No topics found!

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

05-Jul-2021

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

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



Possible solution:

Enable real-time update by pressing the Real-time update toolbar button in the Watch window.


Explanation:

Programming languages such as C and C++ allow collisions between symbol names. This means that multiple symbols can use the same name, but are in different scopes. For example, an application can have  two functions (each defined in a separate C file) with the same name. C allows collisions of file and function static objects, whereas C++ allows additional collisions on multiple levels (namespaces, classes, function overloads). To avoid ambiguity when multiple symbols use the same name, but are in different scopes, qualified names should be used. When winIDEA displays symbols, it could happen that several different symbols with the same name are shown. 


To avoid confusion winIDEA resolves this 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


NOTE:

  • By default, the first listed file in the dialog is selected as Default file for debugging. You can change this through the Default file for debugging drop-down menu, where download files are listed.
  • Only files with enabled Load Symbols option can be selected as Default file for debugging.
  • Variables should be specified with fully qualified names to reduce ambiguity during symbol evaluation.
  • More details on Watch window use.
Was this answer helpful?

Sorry this article didn't answer your question, we'd love to hear how we can improve it.
Note: This form won't submit a case. We'll just use it to make this article better.

Similar topics

{{ topic.Title }} {{ topic.Ddate | formatDate }}

{{ topic.Content }}

No similar topics found!

Other topics in the same category

{{ topic.Title }} {{ topic.Ddate | formatDate }}

{{ topic.Content }}

No topics found!