2

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 ?

John Smith
  • 777
  • 2
  • 14
  • 37

1 Answers1

4

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`)))
Holger
  • 3,920
  • 1
  • 13
  • 35
  • What do you refer to when you say sYmbol.FUNCTION(PP()) ? what means PP() in that context ? – John Smith Aug 31 '15 at 13:09
  • From ide_func.pdf: "PP() returns the address of the program pointer, which consists of the access class + the CPU program counter (PC). Additionally, the function PP() returns the space ID as a hex value if SYStem.Option.MMUSPACES is set to ON." But if your TRACE32 does not yet have PP() you can also use P:Register(PP) or even P:Register(PC) in most cases. So you would get `PRINT sYmbol.FUNCTION(P:Register(PP))` – Holger Aug 31 '15 at 13:52