This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Hi there,
I'm working with CCS V 5.5.0.00077 and RM46.
I found some problems with viewing 'static variables'. See screenshot:
The variables are defined like that:
static uint8 su8_state = 0U;
static uint32 su32_token;
As one can see in the screenshot:
The review of the source code shows, that su32_token is stored at address 0x08004778.
Why doesn't get CCS the correct address of the initialized static variable?
What am I doing wrong, or is this a bug in CCS?
Regards, Andy
Is initialized static variable declared at global scope, or inside a function?Andy Kay said:Why doesn't get CCS the correct address of the initialized static variable?
I reported what may be the same problem in CCS 5.5 debugger shows incorrect address for C++ class given static storage allocation in main - in that case with a C++ program the problem was with the debug information generated by the compiler rather than in CCS. Which version of the compiler are you using?Andy Kay said:What am I doing wrong, or is this a bug in CCS?
With an example program found the TI ARM compiler was reporting incorrect debug information for some static variables declared inside functions, which has been reported in ARM compiler v5.1.5 generates incorrect address in debug information for static functions declared inside a functionAndy Kay said:What am I doing wrong, or is this a bug in CCS?
SDSCM00050075 has been raised on TI ARM compiler v5.1.5 "Dwarf debug information for function level static variables is incorrect, which causes debugger display errors"Andy Kay said:What am I doing wrong, or is this a bug in CCS?
Can you try the workaround of under the CCS Project Properties ->Build -> ARM Compiler -> Advanced Options -> Runtime Model Options set "Use ELF common symbols (--common)" to off. Then rebuild the project and see if the CCS debugger shows the correct value of the static variables.
Hi Chester,
first of all: your workaround was successful!!!
(CCS Project Properties ->Build -> ARM Compiler -> Advanced Options -> Runtime Model Options set "Use ELF common symbols (--common)" to off.)
-> All addresses (and values) of un-initialized static variables inside a function are shown correctly
---
Just to be "complete", I want to answer all your questions:
- the static variables were all defined inside a function
- I'm using CCS V5.5.0.00077, Compiler: TI v5.1.1
---
Just one question left:
- Are there any disadvantages, if I'm using "--common = OFF"?
Regards, Andy
The workaround was actually suggested by the Compiler Expert George Mock.Andy Kay said:first of all: your workaround was successful!!!
Based upon the CCS tooltip for the --common option, the only advantage of using "--common=ON" is that it allows the linker to removed unused common blocks to save memory. i.e. if all the static variables are referenced in the program I don't think changing between --common=OFF and --common=ON will alter the RAM usage or code size/speed.Andy Kay said:- Are there any disadvantages, if I'm using "--common = OFF"?
- Code size?
- Code speed?
- RAM usage?
- anything else?