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.

CCS/TMS570LS3137: Break point issue

Part Number: TMS570LS3137

Tool/software: Code Composer Studio

We are using TMS570ls3137 microcontroller and  code composer studio (CCS version: 6.0.1.00040 and ARM compiler version TI v5.1.1[TI v5.16] )  in our project.  We are facing issues in setting breakpint.

In few scenarios we could not set the break-point at function end. when we try to set the break point at function end (by double click) in the debug mode, it is populating a message that "No code associated with.....  line number  in any loaded symbols"  from the break-point manager. But in the disassembly window, the code execution flow is happening as expected. 

Example pseudocode:

void function (unsigned x)

{
      switch (x)
     {
        case 1:
          printf("1");
        break;

        case 2:
          printf("2");
        break;

       case default :
          printf("default");
       break;

    } 

}

from above pseudocode, if the x value is 1 then, it executes case 1 and again program control is going back to "switch (x)" statement, subsequently for the single step operation, control gets back to called function. Hence we could not set break point at function end (function end brace).

is it CCS tool bug? is there any workaround to resolve this issue ?

Please guide me to resolve this issue.

  • Subash,

    In the disassembly view there is an option to interleave the source lines. If you turn this on you can see which C lines have assembly code associated with them.

    The message from the debugger means that there are no assembly instructions associated with that line of C code. If the line of C code is just a } at the end of the function then there may be no opcode to replace with a breakpoint instruction.

    So basically no this is not a bug. You are going to find that debugging code running on an embedded system is different from debugging a script running on a host. You will also likely encounter situations where the optimizer starts doing its job and reorders instructions, inlines code or even removes unnecessary code altogether.

    Regards,
    John
  • Hi John,
    Thank you very much for your response. As you said compiler won’t generate executable code for ‘C’ end brace i.e. ‘}’ then still there are some discrepancies. Most of the functions we are able to set the breakpoint at function end i.e. ‘}’, but only few instances we could not set the breakpoint.
    This behavior is directly impacting our automation testing. We are doing automation testing using Labview, it execute some scripts to automate the Debug process. It sets the breakpoint at function end by fetching the function identifier, start address and end address of the function from ".out.txt" file.
    Example:
    From “PROJ.out.txt” file,
    "InitializeData","C:/temp/temp.c",0x0006117c,0x00061fa8,3628
    As per the above example breakpoint will be at 0x00061FA8 by the script.

  • Subash,

    What if you add an asm() statement that just sets a label.  i.e. something like this:

    You that should ensure that there is the ability to set the BP at the end of the function.  Alternatively you could even set the BP on the label.

    John