Need some help, in one project I have started working on, I found that the same name variables (static defined) in separate files, and when I tried to add these variables into the "Live Watch" or "Watch Window", IAR display "Unknown or ambiguous symbol", which is for obvious reasons as it gets confusing which one to display as the same name is used in multiple files.
I searched over the internet and found one page.
https://www.iar.com/support/tech-notes/debugger/resolving-variables-with-same-name-in-c-spy/
And it works fine when the files are in the project directory, if the same name variable is inside some folders, then I am not able to access the variables. Can anyone please suggest what is the correct format to access these variables?
Thanks in advance.
In the above project, there was a mistake done by me, the filename name is "tes2.c" the "t" is missing, and due to this it was not working.
if I type tes2\testvar
I am getting the output, so it was my mistake.
But there is some more point, which I got after contacting the IAR support team, and I will share this information below. If the "pre-include" file is specified in your IAR IDE, then this doesn't work, this is a known issue and is present till now, and they will fix this in the next upcoming releases.
Actually, in my main project, there is a "pre-include" file and that's why even after entering the correct information, I am not getting the proper data on the "Live Watch" or "Watch Window". The example shown here was a demo project to show the issue I am facing.
Now there is another possibility to view/watch the static variables.
Click on "View" --> "Statics"
this will list down all the status variables in your project and this works well even when the "pre-include" file is included in the IAR IDE.