Reputation: 1030
How can I log the Program counter values to a file in Trace 32 continuously. The use case is something like, trace through the PC values like in a waveform, to know the exact instructions that were executed just before a crash occurred.
Upvotes: 0
Views: 189
Reputation: 192
Either enable trace for your board or, if you do not have a trace module, run OPEN #1 outfile.txt /Append
and then step through the code in a loop plus something like WRITE #1 Register(PC)
every cycle. (Be mindful that stepping will take considerably longer than running with trace enabled.)
You can use SNOOPer
(with PC selected) or possibly SystemLOG
to get in the ballpark of the fault, but you still might not be able to pinpoint the exact instruction unless you can configure the target and debugger in a way that each incremental PC value is listed.
Upvotes: 0