| |||
| Home > Trace Facilities > Tracing procedure | |||
This section describes the steps you can use in a typical trace session using an ARM ETM. See The tracing procedure with XScale for information on the equivalent procedure for XScale.
It is suggested that you follow these steps using one of the
ADS sample programs, such as the interwork project
found in the …\examples\interwork directory,
before gathering trace information with your own executable file.
You can use the ETM ARMulator as your first trace target (see ARMulator ETM emulation), so you can become
used to using TDT without the complexity of setting up real hardware.
For each session, you must perform certain operations in a specific order. However, you can select TDT Help from the AXD Help menu at any time (see Using help). Before proceeding with your first trace session, it is recommended that you first determine an area in your code that you will trace.
To trace a program:
Load the program into the debugger:
If the program is not already running, select Load Image from the File menu to load the executable for which you want to gather trace information.
After you load an image into AXD, you might have to change
the top_of_memory variable value to correspond
to the top-of-memory address of your target hardware (see the Debugger
Internals window section in the AXD and armsd
Debuggers Guide).
If the program is already running, or loads or runs from ROM, select Load symbols only… from the File menu.
If you do not load the program symbols into the debugger, you can still trace program execution and data values, but you cannot use symbolic names to refer to addresses, and the debugger cannot link instructions with source code. If you have not loaded program symbols into the debugger, keep the Trace window closed while the program is running, otherwise you will see a large number of error messages.
Check the overall configuration of the ETM hardware by using the Configure ETM dialog box. The options configured in this dialog box are persistent across AXD sessions, and so apply to any subsequent tracing you perform (see Configure ETM).
Display the Trace window by selecting View Trace from the Trace menu and arrange the columns as required.
View the ETM resources, such as the number of address comparators, that are available by selecting View ETM State from the Trace menu (see View ETM State).
Set conditions to either:
Ensure that all trace information is returned (see Using the Enable Tracing action).
Limit trace output to correlate to a specific area of execution. See Chapter 5 Configuring Trace Capture for complete details on setting conditions and triggers.
The Start tracing now? or Restart tracing now? dialog box is displayed when you change the trace capture configuration. If you click Yes, the debugger enables tracing. This writes the trace rules and the ETM configuration to the ETM hardware, and instructs the ETM to start collecting trace data based on these values (see Controlling trace capture).
If you are using breakpoints, all trace information prior to the breakpoint is lost when execution continues beyond the breakpoint.
If your program is not already running, select Go from the Execute menu. Trace information is returned to the Trace window when:
the target processor stops executing the application program, for example if you click Stop from the Execute menu
a trigger action has fired and the trace buffer is full
you select Stop Tracing from the Trace window context menu.
See Chapter 6 The Trace Window Display for full details of trace output.
You can compare the trace output with its corresponding area of code in the executable (see Viewing trace output with source code).
You can also link a row of trace output to its corresponding area of memory in the Memory window (see Viewing memory at a location derived from trace output). This window displays the values in target processor memory at the last point the debugger could read target memory, and might therefore differ from the data values shown in the trace display.
Optionally, you can select Reload trace from the Trace window context menu. This option is available when some form of information is visible in the Trace window. Use it if the displayed trace is incorrect because the debug symbol information is incorrect or incomplete. For example, if decoding the trace requires access to an RTOS kernel and the kernel image is not loaded (see Reloading trace for details).
You can save the trace output to a file (see Saving the trace output to file).