Search code examples
trace32lauterbach

How to check current breakpoint function in TRACE32?


I'm trying to check if the program stopped in a function in a TRACE32.

I know I can see the the functions in FRAME window but no idea how to copy them to a variable inside my script.

Any idea how to do that ?


Solution

  • You get the name of the function, where the program counter points to with:

    PRINT sYmbol.FUNCTION(PP())
    

    (Instead of printing the result you can also assign it to a macro.)

    So one approach to check if you've stopped in function myFunc() would be:

    PRINT STRing.ComPare(sYmbol.FUNCTION(PP()),"*\myFunc")  
    

    Another way is to check if the program counter is inside the first and last address of your function myFunc():

    PRINT (ADDRESS.OFFSET(sYmbol.BEGIN(`myFunc`))<=Register(PP))&&(Register(PP)<=ADDRESS.OFFSET(sYmbol.END(`myFunc`)))