I'm testing a real-time application on physical hardware via lauterbach-trace32 probe.
Trace32 documentation is too vast and very technical but I'm not able to find how to implement what I need. I would like to know if there is a method to execute a trace32 function every time a specific code line (under test) is reached in program execution.
What I need is something similar to trigger in database scenario, where an automatic event is raised every time a specific condition is satisfied.
Thank you all!
You can always set a breakpoint, which executes a PRACTICE command every time the breakpoints gets hit. E.g.
Break.Set myFunc /CMD "PRINT ""Hello World""" /RESUME
So this will stop your target CPU when functions myFunc() is reached. Then the PRACTICE command PRINT "Hello World"
gets executed and finally your target CPU continues execution (thanks to the option /RESUME
). (Consider that double quotes escape double quotes in strings)
Instead of a single command you can also execute more commands (by using option /CMD
several times) or execute a PRACTICE script.
If you want to trigger debugger actions on a specific code line without stopping the CPU on that code line, you would need a real-time-trace with external trace interface. So e.g. you would need an ARM CPU with Embedded Trace Macro-cell (ETM) or a PowerPC with Nexus interface. Furthermore you would need Lauterbach hardware for trace-recording e.g. a PowerTrace, CombiProbe or uTrace.
If you have a real-time-trace you can set a "trigger-point" on the specific code line and a execute a command when the "trigger-point" triggers. It looks almost the same way than with breakpoints:
Break.Set myFunc /TraceTrigger /CMD "PRINT ""Hello World""" /RESUME
So the only difference is the option "/TraceTrigger". Of course you should ensure that the real-time-trace is actually working with your setup.