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: breakpoint not working as expected in DSS script

Tool/software: Code Composer Studio

Hi All,

I am unable to set a breakpoint in the code using Debug Sever Scripting [DSS]. It is never hits the breakpoint and continues to execute the function in infinite loop.

I am not getting any error or warnings from DSS either.

Let me know how to resolve this issue.

Code snippet :-

main.cpp

25    while(1)
26    {
27      func();
28      #breakpoint
39    }



dss.py

bp = debugSession.breakpoint.add(file_path,28)
debugSession.target.run()

  • Hello,

    Did you generate a verbose log and check for an errors? If you did, and no errors where found, try running your script from the Scripting Console to see if everything is working as expected (if the breakpoint is getting set, etc). You may want to modify the script so that it does not shut down the debugger after the script is executed.

    https://software-dl.ti.com/ccs/esd/documents/users_guide/sdto_dss_handbook.html#scripting-console

    Thanks

    ki

  • Hi Ki,

    The breakpoint is only working when I set the breakpoint at the end of the while loop. Is this behavior expected?

    Adding a breakpoint at a hard-coded line number is not ideal for me.

    In the documentation, I found that there are two other ways to add a breakpoint [ Using address and symbol]. Can you cite an example where I can set a breakpoint using address?

  • Parameswaran L said:
    The breakpoint is only working when I set the breakpoint at the end of the while loop. Is this behavior expected?

    It depends. For code with some optimization, this would not be uncommmon.

    Parameswaran L said:
    In the documentation, I found that there are two other ways to add a breakpoint [ Using address and symbol]. Can you cite an example where I can set a breakpoint using address?

    Setting by address is quite simple, you just pass in the address as the only parameter

    bp = debugSession.breakpoint.add(address);

    Thanks

    ki

  • Hi Ki,

    When I add a breakpoint using address of a function, the breakpoint hits before calling the function itself. Is this expected behavior?

    So, I created a dummy function after the actual function to hit the breakpoint and it is working.

    If I set a breakpoint using address of a variable, when will the breakpoint be set? During the variable initialization or declaration?

    An unrelated question, How can I send arguments to main function while running the target code using debugSession.target.run()?

  • Parameswaran L said:

    When I add a breakpoint using address of a function, the breakpoint hits before calling the function itself. Is this expected behavior?

    So, I created a dummy function after the actual function to hit the breakpoint and it is working.

    If I set a breakpoint using address of a variable, when will the breakpoint be set? During the variable initialization or declaration?

    As mentioned in my last post - it depends. There are several factors here, including optimization settings. To be safe, it is good to do the experimentation that you are doing to confirm in your case

    Parameswaran L said:
    An unrelated question, How can I send arguments to main function while running the target code using debugSession.target.run()?

    You need to pass the array of arguments as a parameter to the loadProgram API:

    Please refer to the DSS API doc for more information:

    public void loadProgram(java.lang.String sFileName,
                            java.lang.Object[] args)
                     throws ScriptingException

    In the future, please create a new thread for an unrelated question.

    Thanks

    ki

  • Hi Ki,

    Thank you for the quick response to the questions.

    I will create a new thread for unrelated questions from now on.