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.

TMS570LS3137-EP: CCS debugger

Part Number: TMS570LS3137-EP

Hi,

We are using CCS version 6.0.1 and compiler version v18.1.0.LTS. For the development testing using automated breakpoint method, we would like to introduce assembly labels(__asm(" label name ");_, in the 'C' functions. However the compiler reference document does not recommend the same. Below is the excerpt from the compiler reference document that 

NOTE: Avoid Disrupting the C/C++ Environment With asm Statements


Be careful not to disrupt the C/C++ environment with __asm statements. The compiler does
not check the inserted instructions. Inserting jumps and labels into C/C++ code can cause
unpredictable results in variables manipulated in or around the inserted code. Directives that
change sections or otherwise affect the assembly environment can also be troublesome.
Be especially careful when you use optimization with __asm statements. Although the
compiler cannot remove __asm statements, it can significantly rearrange the code order near
them and cause undesired results.

Please note we intend to use the labels to put breakpoints for the verification purpose and there won't be any GOTO statements associated with these labels. Can you please elaborate on the implications of inserting assembly labels. Will it result in an unpredictable environment?

Thanks,

Sundaram 

  • The real issue is if you use both "jumps and labels". Using __asm() for just labels will not disrupt the program execution. However, if the optimizer is used, the labels may not end up where you expect then to be. I suggest you use the disassembly window to examine where in the code the label was placed. You may then find it easier to set a breakpoint based on the address in the disassembly.