Page 1 of 1

Locals missing in IAR

PostPosted: Fri Dec 19, 2008 7:52 am
by juason
Hello everyone,

I've been having issues getting local variables to display properly in IAR. Occasionally locals will be WATCHable and update upon breakpointing, but most of the time they fail to update and retain their uninitialized value.

I have verified these variables are in fact changing in value by dumping their memory location and/or sending them out a UART. I've also found declaring them STATIC can sometimes make them watchable.

I've seen this behavior in other IDEs such as Keil and Codewarrior, but usually when Optimizations are turned on. I have turned off all the optimizations in IAR that I can find. In Codewarrior you also had to check REGISTER COLORING to avoid the cacheing of locals in registers.. but I see no equivalent in IAR.

Thanks in advance for any help you can provide me with. For a while I was convinced I had stack corruption, but this seems to be a more fundamental problem.

Re: Locals missing in IAR

PostPosted: Fri Dec 19, 2008 8:39 am
by aek
I don't have much insight into this, other than asking whether you have proper scope to see the locals?


Re: Locals missing in IAR

PostPosted: Tue Jan 06, 2009 4:30 am
by Dave Hohl
I have had similar problems with IAR not showing watch variables properly on occasion. To see automatics I think you need to be at a breakpoint within the function they are local to, but even then sometimes things do not display properly. And I often have trouble watching static variables that are class members, even though I include the class name prefix in the watch window. An older version of IAR used to display the wrong values for some floating point variables, but they finally fixed that.