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.
Hello-
I'm trying to debug a program on a LM3S8962 evaluation kit using CCS 4.1.2.00027 (the "Platinum" version) on Windows XP Professional. When I enter debug mode and step through my program, several of my local variables do not appear in the "Local (1)" view. When I enter the variable names into the "Watch (1)" view, the debugger displays the error "identifier not found". The non-displayed variables are the same type, and declared at the same time as, others that do show up in the Local and Watch views.
I have tried (in order):
None of these approaches enabled the inspection of the variables in the debugger's Local or Watch views. The same variables are invisible each time; they include an 'unsigned long', a simple 'char' and an 's8_t' that is typedef'd by lwIP as 'err_t'. The variable names do not intersect with any reserved keywords, and the program compiles and links without warnings or errors. Here is a code snippet showing the declaration and assignment of the variables:
int main(void) {
unsigned long ulUser0, ulUser1; // Shown OK
unsigned char pucMACArray[8]; // Shown OK
unsigned long dummyvariable; // Not shown
char somevariable = 'B'; // Not shown
dummyvariable = 12345; // Still not shown
// Set the system clock
SysCtlClockSet(SYSCTL_SYSDIV_1 | SYSCTL_USE_OSC | SYSCTL_OSC_MAIN | SYSCTL_XTAL_8MHZ);
While several other threads seem to discuss this issue, and in some cases bug reports are filed, I do not see any definitive resolution for the problem, or any follow-up on the disposition of the bug reports. Can someone indicate whether this issue has been resolved, a workaround identified, or an alternative approach determined?
Many Thanks,
David R.
Update 2010-07-23: After several days of experimentation, I found that the CCS4 debugger only displays those variables that are read at some point in the program. If a variable is declared, defined and subsequently only assigned, it generates a compiler warning and does not display in the debugger. If you use it in conditional statements, the compiler issues no warnings, but the variable is still not visible in the debugger. If, however, you assign the same variable's value to another variable, it will appear in the debugger. This definitely appears to be an issue with the compiler, possibly not putting certain debug symbols into the object file?
Hi David,
Have you tried to define your variables as "volatile"? Otherwise the compiler would optimize the assignment away, because it is never used again. Defining it volatile tells the compiler that the variable has to be set because it could be accessed by another process (like an interrups service routine or a debugging engeneer :-) ).
Try:
int main(void) {
unsigned long ulUser0, ulUser1; // Shown OK
unsigned char pucMACArray[8]; // Shown OK
unsigned long dummyvariable; // Not shown
volatile char somevariable = 'B'; // Not shown
volatile dummyvariable = 12345; // Still not shown
// Set the system clock
SysCtlClockSet(SYSCTL_SYSDIV_1 | SYSCTL_USE_OSC | SYSCTL_OSC_MAIN | SYSCTL_XTAL_8MHZ);
Cheers
Marco
Marco - Good thinking, this should do the trick the next time I encounter this problem...
Thanks,
Dave