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.

Watching Variables in Debug Mode (CCS v5) - how to Configure Columns?

Other Parts Discussed in Thread: MSP430G2553

In the Debug mode, the variables are not shown.  The Help manual says:

Working with variables

During a debug session, you can display variable types, and change or disable variable values.

To display variable type names:

  • In Variables view, click the Show Type Names toggle button.

When attempting the click "Show Type Names" the icon is grayed and the hovering the mouse displays

         'Show Type Names' unavailable when columns are displayed.  Configure columns to display type names.

I have not been able to find info on how to configure columns.  How is this done?  Hopefully this will allow the variables to be turned on?  Thanks!

Mike

  • Hi Mike,

    You need to disable the column display to enable that button. Toggle the 'Show Columns' option:

    Thanks

    ki

  • Thanks Ki

    I got the button to work, but there are no variables displayed.  The following variables are declared in top of the code:

    #include "msp430g2553.h"

    unsigned int RxByteCtr;
    unsigned int RxWord;

    void main(void)
    {

    ...

    I'm missing something--any ideas?

    Mike

  • The variables view will just show local variables by default. You can use the expressions view to add the global variables in there.

    You should be able to right click in the variables view and select the 'add global variables' option in the context menu. But I think there was some issue with that. Not sure if it has been resolved.

    Thanks

    ki

  • I see the variables in the expressions view after following your suggestion.  I'll just remember that global variables are "expressions," and only look for local variables in the variables view...

    I'm not seeing what I want in the variable values, but that's a code problem for another thread...  Thanks!

    Mike

  • In CCSv4, it was call 'Locals' view which makes more sense since it defaults to showing the local variables. But it was changed in v5 to 'Variables' because we wanted to go with what Eclipse used for consistency. Since global variables are still variables, it is a bit confusing.... :P

  • I have a lot of local variables in main(void) that aren't showing up in either the Variables tab nor the "Add Global Variables..." option in the Expressions tab.

    e.g. none of my loop variables are there.

    As a specific example, the following My_SysCtlClock variable isn't there either:

    unsigned long My_SysCtlClock=0;
    My_SysCtlClock=ROM_SysCtlClockGet();

    I even try to add it by right clicking on it in the soruce code in CCS Debug View and adding it to the watch expression list but I get a value of "Error: identifier not found:"

    Any ideas why ?

  • I solved this problem of not being able to see local variables by changing the Compiler Optimization level from 2 to Disabled according to this post .

    For CCSv5 here is a screen shot of where to find this setting in the Project Explorer .   

    HOWEVER, there is still a similar problem I have with trying to watch another local variable.  I have Optimizations turned off but I get the same error "identifier not found" for the variable named sItems as shown below.  Any idea why ?

  • Hi

    to watch variable you just need to ""Add Watch Expression" and put the variables value to be watched in the Expression tab

    Eg)k  suppose i have defined int k.

    Regards

    Sid