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.
The attached project 1070.class_allocation.zip was created to test C++ classes being allocated static storage allocation in main. The project was created in CCS 5.5.0.00077 with MSP430 compiler v4.2.3, targetting a MSP430F5529. The program runs correctly, but in the debugger the contents of the classes ADC0 to ADC3 are displayed incorrectly in the debugger as shown in the following screenshot:
The debug variable view incorrectly reports that the address of ADC0 ADC1, ADC2 and ADC3 are all 0xB748 (which is the address of the main function in flash) rather than the actual address in RAM (0x2f12, 0x2f16, 0x2f1a, 0x2f1e).
In the expression window when a cast was used to manually display the contents of address 0x2f16 (where ADC1 is in RAM) as cast to the type ADCon the debugger displayed the correct result.
The attached .zip file also contains debug_server.log which is the debug server logging. The debug server logging contains the following:
Therefore, the problem appears to be that the CCS 5.5 debugger is unable to resolve the address of ADC0 to ADC3 based upon the debug information created by MSP430 compiler v4.2.3. Not sure if the problem is CCS 5.5 or the compiler.0x000007FC 9552078 3 MSP430 GEL I: Evaluation of "ADC0" completed - Value: unknown Location: Compound Location (Address 0xb748 (0)) Type (class ADCon)
0x000007FC 9552093 3 MSP430 GEL I: Evaluation of "ADC1" completed - Value: unknown Location: Compound Location (Address 0xb748 (0)) Type (class ADCon)
0x000007FC 9552093 3 MSP430 GEL I: Evaluation of "ADC2" completed - Value: unknown Location: Compound Location (Address 0xb748 (0)) Type (class ADCon)
0x000007FC 9552093 3 MSP430 GEL I: Evaluation of "ADC3" completed - Value: unknown Location: Compound Location (Address 0xb748 (0)) Type (class ADCon)
Tried changing the compiler version:Chester Gillon said:The project was created in CCS 5.5.0.00077 with MSP430 compiler v4.2.3, targetting a MSP430F5529.
1) With MSP430 compiler v4.1.8 the debugger resolved the correct address of ADC0 to ADC3 in RAM, and displayed the correct contents of those classses.
2) With MSP430 compiler v4.2.1 the debugger behaved the same as when MSP430 compiler v4.2.3 was used in that the debugger incorrectly resolved the address of ADC0 to ADC3 in flash and thus displayed the incorrect contents of the classes.
Therefore, the problem appears to be caused by a change in how the MSP430 v4.2.x compiler generates the symbolic debug information.
The project was created using the default output format of "eabi (ELF)".Chester Gillon said:Therefore, the problem appears to be caused by a change in how the MSP430 v4.2.x compiler generates the symbolic debug information.
If the output format is changed to "legacy COFF" then when the MSP430 v4.2.3 compiler is used the debugger resolved the correct address of ADC0 to ADC3 in RAM, and displayed the correct contents of those classses. i.e. the problem appears to be the symbolic debug information generated for the ELF eabi.
Your analysis is correct.
The debug info for ELF does indicate that the variables are located at 0xb748.
So, it is a code gen (compiler) issue.
I have notified the code gen team to take a look.
Thanks,
Raymond
I have submitted a bug report SDSCM00049324 against the code gen team.
-Raymond
Thanks for that.Raymond Pang said:I have submitted a bug report SDSCM00049324 against the code gen team.
Out of curisitory I ported the test program to the Cortex-A8 in AM3358 Starter Kit in the attached project 5658.class_allocation_arm.zip
Using ARM compiler v5.1.3 set to an output format of "eabi (ELF)" when debugging the test program in CCS 5.5.0.00077 the address of the variables ADC0 to ADC3 were incorrectly resolved to the address of the enclosing main function (same problem as seen with the MSP430 program) as shown in the screen shot:
Changing the ARM compiler v5.1.3 to an output format of "legacy COFF" caused the CCS debugger to resolve the correct address of the ADC0 to ADC3 variables.
As SDSCM00049324 was raised against the MSP430 Code Generation Tools, should a new report be raised against the ARM Code Generation Tools?
For anyone who finds this thread, SDSCM00050075 was raised on the ARM Code Generation Tools.Chester Gillon said:As SDSCM00049324 was raised against the MSP430 Code Generation Tools, should a new report be raised against the ARM Code Generation Tools?