| |||
| Home > Tracing Tutorial > Using triggers to collect trace around a specific data access > Capturing trace before a trigger | |||
To display the capture trace before a trigger:
Unload and reload the image:
Right-click on the Load Image+Symbols entry
in the Process Control view to display the context menu.
Select Unload from the context menu. The image is unloaded.
Right-click on the Load Image+Symbols entry
in the Process Control view to display the context menu.
Select Load from the context
menu. The image is reloaded and the PC is reset to the image entry
point (0x8000). The previous tracepoint is removed.
Set a trigger tracepoint on data writes to output_port that
activates after 200 passes:
Select Debug → Tracepoints → Create Tracepoint... from the Code window main menu to display the Create Tracepoint dialog box. Figure 10.77 shows an example.
Select Trigger from the tracepoint type drop-down list.
Select Data Write from the
tracepoint comparison type drop-down list (that is, the on field).
Enter the address to be traced (that is, the when field).
In this case, the address to be traced corresponds to the symbol output_port.
Therefore, enter @trace\\output_port.
Because this is a pointer, you do not have to prefix the variable
name with &.
In the Optional Settings group,
enter 200 in the Pass times text
box.
Click OK. The Create Tracepoint dialog box closes, and the tracepoint is set. RealView Debugger generates a TRACEDATAWRITE CLI command, which is also displayed in the Cmd tab of the Output view:
trcdwrite,hw_out:"Tracepoint Type=Trigger",hw_pass:200 @trace\\output_port
Click Run on
the Debug toolbar to start execution. The trigger is activated after 200
writes to output_port, and the captured trace
is displayed in the Trace tab of the Analysis
window. Figure 10.78 shows
an example.
Select Find Trigger from the Analysis window Find menu. RealView Debugger searches the trace output and the line of trace corresponding to the trigger point is selected.
Scroll down the trace output to see the captured trace after the trigger point. Figure 10.79 shows an example.
Click Stop on the Debug toolbar to stop execution.
the following in the RealView Debugger Command Line Reference Guide:
Chapter 2 RealView Debugger Commands for details of the TRACEDATAWRITE command.