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.

CCSv5 Debug Doesn't Recognize Variables or Allow Breakpoints

Other Parts Discussed in Thread: MSP430FR5739

After running CCSv5 successfully for several weeks on a single project, I've lost the ability to debug much (not all) of the code.  For example, I added the following function:

void process_chksum(void)
{
    char *str;
    char lochk;
    char hichk;

    str = strchr(&wkbuffer[0], '*');

    hichk = 1;
    lochk = 34+hichk;

}

For each defined variable, I get a warning that the variable is defined but not used.  If I try to add a breakpoint anywhere within the function, the breakpoint is automatically added at the closing brace.  I've tried setting a breakpoint at the beginning of the function and using the "step into" command to monitor steps within the function, but the debugger stops only on the closing brace. Any ideas on what might be happening?


I'm working exclusively within CCSv5 (in fact my code is in one file currently) on a Windows 7 machine.  I've got optimizations turned off and my target is an MSP430FR5739.


Thanks in advance.

  • Hi,

    Try declaring the variables globally.

    Regards,

    Gautam

  • Hi,


    That does seem to work, but I'd rather not define all my variables globally.  Since the debugger was working before with local variables, I'm guessing some connection has been corrupted.  I've tried doing "clean" builds without success.  I may try starting a new project and copy my source code over to see if that works.

    Thanks,

    Eric

  • Eric Kaltenbacher said:
    If I try to add a breakpoint anywhere within the function, the breakpoint is automatically added at the closing brace.  I've tried setting a breakpoint at the beginning of the function and using the "step into" command to monitor steps within the function, but the debugger stops only on the closing brace. Any ideas on what might be happening?

    This occurs when a certain level of optimization is enabled and you lose source line level debug visibility.  Another is if you are not building with full debug symbol generation.

    You say that you have optimization disabled. Note that you must explicitly set it to "off". Is this the case? Can I see the rest of your compiler options?

    Thanks

    ki

  • Yes, I think that did it - thank you.  It was a little confusing because the slider for the optimization was at the far left (zero), but the drop down box was empty.  I selected "off" in this list and the debugger seems to have visibility now.