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.

Automating breakpoint using DSS in CCS - Setting breakpoint in the middle of the function

Hello All,

I am working on a Breakpoint automation project for one of the application code.

I understand that DSS supports setting breakpoint using function name , line number and address. But I have the below requirement.

Suppose I have a function : 

int fun ()

{

int a = 10;

b = 10 ;

a = a+b;

if ( b == a)

{

a = 100;

}

else 

a = 30;

}

If at all I need to set a breakpoint at "if (b==a) " , then is there any other method do this. 

I am aware that I can add .asm tags in between , but when I add .asm tags , there should not be any change in Checksum . And I am working on TMSlS20216 processor.

Thanks

Rohini

  • Hi Rohini,
    You can set a breakpoint by specifying the source file and line number in that source file. Hence you can specify the source file that contains the "fun" function and the line number that "if (b==a) " is on. This assumes that you do not have optimization enabled. if you do have optimization enabled, it is best to set your breakpoint on a specific address.

    Thanks
    ki
  • Hi Ki,

    Thanks for the response.

    I am bit hesitant to use line numbers to set the breakpoint, since line numbers might change in case if someone modifies the code , also we will have modify the scripts for most of the files in case if the code gets modified.

    And regarding using address to set the breakpoint , fox ex , If i need to set the breakpoint at "if(a==b)", how do I do it . Can you pls explain in details.

    Thanks
    Rohini
  • You can add a label above the source line:

    label:

    if ( b == a)

    then set a breakpoint on the label:

    debugSession.breakpoint.add("label")

    Thanks

    ki