Keil Logo

µVISION DEBUGGER: INCORRECT VALUES DISPLAYED FOR LOCALS


Information in this article applies to:

  • µVision Debugger any Version

QUESTION

I have the following simple function in my C program that I call with different values:

unsigned char xa, xb;

void sendword (unsigned int w)  {
  xa = w >> 8;
  xb = w & 0x00ff;
}

It appears that the µVision Debugger does not display correct values for the local variable w. When I call the function with the value 0x1234, the value 0x1200 is shown. What is the reason for this?

ANSWER

The Keil C Compiler performs very high code optimizations and removes even partly variables. This happens on very simple functions like that shown above. However, the code executes correctly.

You may reduce code optimization to get the proper debug results. However, in most cases, this is not possible.

SEE ALSO

Last Reviewed: Wednesday, June 30, 2004


Did this article provide the answer you needed?
 
Yes
No
Not Sure
 
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.