Search code examples
trace32lauterbach

Lauterbach execute script when breakpoint is hit


I am using Lauterbach to debug a PowerPC embedded C software. I want to execute the below ALGO from a .cmm(PRACTICE) script. Pleas let me know if it is possible:

Set Breakpoint
When Breakpoint is hit, execute a .cmm file. This .cmm file will rewrite the values of an array.
Continue execution of program

I don't want to stub the whole function. The code has to be untouched.


Solution

  • Set the breakpoint with

       Break.Set <addr> /Program /CMD "DO myScript.cmm"
    

    To continue the execution of the target program, add the command Go to the end of the called PRACTICE script.

    If you can't add the command Go to the end of the called PRACTICE script, you'll need a veneer-script like this:

    // Content of myScript.cmm
    DO myAlgorithm.cmm
    Go
    ENDDO
    

    The Break.Set command knows also an option /RESUME, but this is not suitable for your case, since it won't wait until the called PRACTICE script has finished.