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.

Debug labels for testing

Other Parts Discussed in Thread: CCSTUDIO

I am using ARM Optimizing C/C++ Compiler v5.1.6 on TMS570. I need to insert the debug labels in source code to set breakpoint for testing purpose. This debug label should provide just address. For this, I am using assembly code inside c file and expecting TSTLBL_File_Switch_Start in .map file. But it is not listed in map file. Please suggest how to generate address for the debug label or open to take new apporach. Thanks.

I defined the following macro:

#define DEBUGLABEL(n) asm(" .global TSTLBL_"n" ");asm("TSTLBL_"n":");  

I used the above macro whereever i need to insert debug lable. For example,

/* Wait to complete the CRC verification process */
do
{
  crcResult =
  CRC_Process(CRC1);
} while (crcResult == CRC_ERR_BUSY);

DEBUGLABEL("File_Switch_Start");

/* Set Failure flag based on return value */
switch (crcResult)
{
   /* CRC Failure */
   case CRC_ERR_COMPARE:
   ....
   ...
}

  • Try this macro instead ...

    #define DEBUGLABEL(name) asm(" .global TSTLBL_" #name "\n" \
                                 "TSTLBL_" #name ":") 
    

    The techniques used in this macro are explained in this wiki article.

    Thanks and regards,

    -George

  • Hi George,

    Thank you. Now the debug label is present in map file. When I tried to debug on CCS (set a break point just before the debug label and step in) , I am getting the error on debug label says "No source available for "TSTLBL_Switch_Start() at C:/Synergy\E2_BCS_SW\Boot\Boot_Code\CCStudio\Debug\Boot.out:{3} 0xbc8{4}"".  But this works in Disassembly mode. Do I need to change any build settings? 

    Is there any way to attach the snapshots?

    -Jagadish

  • Jagadish Palle said:
    I am getting the error on debug label says "No source available for "TSTLBL_Switch_Start()

    I think you can ignore this diagnostic.  I think CCS expects to find a function with this name in your system.  But there isn't one.  So it issues this diagnostic.  Are you seeing any other problems besides this diagnostic?

    Thanks and regards,

    -George

  • Yes. I am not able to set breakpoint on this debug label to read/write local variables. In this example, I need to stop on debug label "File_Switch_Start" and modify the crcResult. When I set a breakpoint on this debug label and run, then I got the error says source code not found before hitting the break point.

    /* Wait to complete the CRC verification process */
    do
    {
      crcResult =
      CRC_Process(CRC1);
    } while (crcResult == CRC_ERR_BUSY);

    DEBUGLABEL("File_Switch_Start");

    /* Set Failure flag based on return value */
    switch (crcResult)
    {
       /* CRC Failure */
       case CRC_ERR_COMPARE:
       ....
       ...
    }

  • I suspect CCS does not support what you are trying to do.  But, I am not sure.  So, I will move this thread to the CCS forum.

    Thanks and regards,

    -George