0

I got a situation on ARM controller, where in the underlying OS layer, an exception is reported by calling osException(). The caller of this function also passes the pc(program counter). I have set a breakpoint on osException() and can print the value of pc on trace32 AREA. Further, I would like to focus the Trace32 view to the source code where this program counter is pointing to. How can I do it using a trace32 scripts ?

Sumen
  • 1
  • 1
  • 2
  • How do you currently print the PC to the AREA window? Do you have the PC saved in a PRACTICE macro, or do you get it with some TRACE32 function? – Holger Oct 21 '22 at 12:54
  • its is a parameter passed when calling osException(uint pc). When the breakpoint is hit at this function call, the value of the variable pc is printed using Var.PRINT "Exception at " pc – Sumen Oct 21 '22 at 12:57

1 Answers1

2

I think the command you are searching for is

List Var.VALUE(pc)

The command List [<address>] opens a windows showing the target application a the given address. If you omit the parameter , the window will focus on the address, where the current program counter is pointing to. (The current program counter point of course somewhere inside osException())

The function Var.VALUE(<HllExpr>) returns the value of the given high-level-language expression. So if you have a variable pc it return the value of this variable for all TRACE32 commands not starting with Var.

Holger
  • 3,920
  • 1
  • 13
  • 35