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.

Viewing static variables

Other Parts Discussed in Thread: CODECOMPOSER

Hi,

I have two questions.

1) Does the target get reflashed every time the debugger is connected or only if the downloaded image has been changed?

2) How do I get the debugger to display the value of  static variables?

for instance in the block below from main_AP.c in eZ430-RF2500 example code, if I set a breakpoint on

(SMPL_SUCCESS == SMPL_Receive(sLID[i], msg, &len))

the debugger stops OK but I cannot read either the value of the local variable i or or the static sNumCurrentPeer, although other variables are displayed OK.

if

 

 

(sPeerFrameSem)

{

uint8_t msg[MAX_APP_PAYLOAD], len, i;

 

 

 

 

/* process all frames waiting */

 

 

(i=0; i<sNumCurrentPeers; ++i)

{

 

 

 

if

(SMPL_SUCCESS == SMPL_Receive(sLID[i], msg, &len))

Thanks in advance for any help,

John.

 

 

  • Hi John,

    have a look at this post and please let me know if it helps you ....

     

    Viewing static variables

     

    Best Regards,

    Lisa

  • HI Lisa,

    Thanks for the rapid reply.

    I looked at your reference but it seemed only to refer to class variables in C++.

    Should I be able to view local C code  variables as well static globals in CodeComposer? If so how?

     Other Eclipse IDEs that I have used allow the user either to add via a dialogbox  a variable or to hover over the item in the code (once the debugger was halted).

    The first half of my questions was - is a new executable downloaded every time the debugger is restarted without any changes to the executable?

    If so, would this significantly reduce the flash endurance?

     

    John.

  • Hi John,

     

    I appologise for missing a couple pieces of your enquiry.

    First of all, yes you should be able to "hover" over a variable in CCS in order to see the value.  

    There is an option in CCS to "debug without download".   There are a few options.  See the screen shots attached.  There is "load symbols only", "retain unchanged memory" as well you can tell it not to automatically reload if the file changes.    This is under Window->Preferances->CCS.   Unlike IAR I do not believe there is a pure "Debug without download" button.

    What example is that from?  Is it the sensor monitor program?  I want to try to reproduce things here.  

    Best Regards,

    Lisa

     

     

     

     

     

     

     

    Lisa

     

     

  • Hi Lisa,

    Thanks again for replying so quickly.

    The code is the eZ430-RF2500 Wireless Sensor Monitor, running the AP in the debugger.

    Is there some setting that enables 'hovering'?

    John.

  • Hi Lisa

    Sorry to keep on posting.

    In the debugger, hovering over a variable or global does produce a balloon but it only gives the variable name followed by a period (.). The same local variable in this case, i, shows up in the Local window again with a period, no value. The global does not appear at all.

    John.

     

  • Hi John,

    Ok let me see if I can help you figure this one out.

    A couple settings you can check are

    Project->Properties->C/C++ Build Tab

    From here go to the Basic Options tab and make sure you have "Full symbolic debug" and try Optimization level 0.   This was described in one of the two posts I sent you a link for.

    Aside from that I will do what I can in the background here for now.

    Cheers,
    Lisa 

  • Hi Lisa,

    The optimisation was indeed at O3, but setting it to O0 does not seem to have changed the ability to get the values of variables.

     "Full symbolic debug" was already turned on.

    John.

     

  • Hi John,

    Have a look at this post to see if it helps.  Let me know and thanks for the update and taking a quick look at the settings.

     

    http://e2e.ti.com/support/development_tools/code_composer_studio/f/81/t/39658.aspx

     

    Best Regards,

    Lisa

  • Hi John,

    I believe I have a solution for you.   I basically experienced the same thing.   So I found that even with the settings we have been using, when I further investigated, optimization was still on to a level and some of the variables (ones not shown) were being put in registers by the optimization.  Hence why we were not seeing them.

    So things should work for you if you turn optimization fully off.   You can do this by selecting the blank option in two spots as shown in my screenshot below.  Project->Build Options->Basic Options.

    Please give this a try and keep  me informed.

    Best Regards,

    Lisa

     

     

     

  • A couple additional notes

    - in the watch window change the display type to decimal as you see in my screenshot

    - this does not seem to be done for the value shown by hovering ... which is why the decimal value of i is shown in the watch window, the ascii value by hovering (i seems to be considered a char)

     

  • Hi John,

    just thought I would check whether those tips did the trick. 

    Best Regards,

    Lisa

  • Hi Lisa,

    Thanks for the message.

    I have only just today started up again with the MSP430, so I will certainly check as soon as I have finised a compile, and let you know.

    John.

     

  • Hi John,

    just thought I would check in again for any updates.

    Cheers,
    Lisa