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.

Breakpoint programmatically



hello everyone,

 

ich am using IAR Workbench, i want to set a breakpoint but not by doubleclicking the position where i want to set it. i want to do it programmatically.

the Background is : i just need the linker output file : file.txt   to use with another tool (and debbuging). i cant set breakpoints with this tool. therefore i want them to be set automatically.

 

i read about C-SPY macro file and so on...

 

i hope the problem is clear, and someone can help.

 

thanks

 

  • You did not say what the "another tool" is.  I hesitate to say that it is not possible to get what you want. I suggest that you do the following simple experiment and draw your own conclusions.

    (1) Write a simple program (or use one of your existing programs), delete all the break-points in the source code. Compile & Link to generate a file.txt.

    (2) Go back to the same source code and set a few break-points. Compile & Link to generate another file.txt.

    You can now compare the two file.txt (one without break-point, one with). You will see that they are identical to each other.

  • yes you are right, i tried this befor and the files are identical.that why i am trying something else.

    the other tool is LabVIEW.

    but i think its possible, someone did it in Code Composer, i can ask him on monday. and i think it should be also possible in IAR workbench.

    i will report.

     

    thanks.

  • hello,

    yes i asked others, and it seems to be impossible ;(

    but i can use the function msp430_breakpoint from the msp430.dll and the msp430_run to run to breakpoint, it works .

     

    thanks

  • Hello,

    I didn't understand u r problem exactly but long back i tried mor or les the same.

    U have to prepare the macro file for putting the break points programatically.

    C-Spy has it's own marcos which can be used to wrtining the script.

    For example to set break point at a pariticular code line we can use "__setCodeBreak" like

    __setCodeBreak(<functionName>, <count>, <condition>, "TRUE", "");

     

     

    u can get the complete macros in the "EWSTM8_UserGuide" datasheet.

    this macro file has be included in "project->debugger->setupmacro" options.

  • hello,

    i think u understood my problem exactly ;)

    i have tired this before. i created this text-file :

    execUserSetup()

    {

                __setCodeBreak("functionname", 0, "1", "TRUE", "");

    }

     

    i saved it as xxxx.mac, and included the file in project->debugger->setupmacro" options...

    but nothing happened, no breakpoints has been set.

     

    did i make a mistake creating the mac-file ???

  • yaa, it seems you misssed a small point.

    for the function "__setCodeBreak" u need to provide complete path and line numbers.

    example:

    void main(void)
    {
     
      WATCHDOG_CONTROL = WDT_PASSWORD + WDT_HOLD;

      initClocks () ;

      userMain ();

    }

    for putting a break point at initclock the code will be

    execUserSetup()
    {
                __setCodeBreak("{D:\\bonangrx\\TEMP_FED\\CommonSource\\startMain.c}.55.9", 0, "1", "TRUE", "");
    }

    where "D:\\bonangrx\\TEMP_FED\\CommonSource\\startMain.c" is the file name and 55 is the Row and  9 is the coloumn number.

    Every backslash should follow one more backslash("\").

     

  • Hello Rajesh,

     

    actually it worked, but the Linker Outputfile still doesn't contain infos about the breakpoints, it still looks like one from the Programm without breakpoints.

    but i managed to do it in LabVIEW in reading the Map-File and search for the Adress of the function where i want to put my Breakpoint.

     

    Thanks for all the replies.

**Attention** This is a public forum