7.3. The tracing procedure with XScale

Note

Before you can debug a target, the debug monitor must be installed on the target. If Multi-ICE fails to detect the debug monitor when it connects, Multi-ICE installs the debug monitor. This involves resetting the processor, so any code running out of ROM stops running. To enable the debug monitor to be installed without resetting the processor, you must implement a special reset handler in the program in ROM. See the Multi‑ICE User Guide for information on how to do this.

To trace a program with an XScale target:

  1. 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.

      Note

      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.

  2. Locate the area of your program for which you want to collect trace information.

  3. Display the Trace window by selecting View Trace from the Trace menu and arrange the columns as required.

  4. Select Configure Capture from the Trace menu. The Configure XScale Trace dialog box is displayed (Figure 7.2).

    Figure 7.2.  Configure XScale Trace dialog box

    Configure XScale Trace dialog box

    Select Stop processor when buffer full if required.

    The option Stop processor when buffer full is deselected by default. When this option is set, irrespective of any breakpoints or watchpoints that are set in your code, one buffer-load of trace information is captured and returned to the Trace window whenever you instruct TDT to start tracing. In this case, a buffer-load of trace data is collected at the current execution point in your program. For example, if you want to analyze trace information at the start of the execution of the function main(), you must ensure that program execution commences at that function when you start tracing. You can do this, for example, by stepping through your program to the main() function before you begin tracing.

    If you want tracing to stop when a breakpoint or watchpoint is reached, irrespective of whether the trace buffer is full, you must ensure that the option Stop processor when buffer full is deselected.

    Note

    If Stop processor when buffer full is selected, and the trace buffer becomes full, the debug hardware raises a debug exception. If this happens, the target stops executing the image and the trace is displayed immediately.

  5. Select Start Tracing from the Trace menu.

    Note

    Unlike for ETM targets, you must start tracing before running the target, because you cannot start or stop tracing while the target is running.

  6. Select Go from the Execute menu. Trace information is returned to the Trace window when:

    • the trace buffer is full and the target has stopped running due to a debug exception, if you have the Stop processor when buffer full option checked

    • tracing is enabled and you stop the target from running

    • tracing is enabled and the target has stopped for another reason.

    See Chapter 6 The Trace Window Display for full details of trace output. The XScale trace display describes the ways that the XScale Trace window differs from the ARM ETM Trace window.

Copyright © 2000-2002 ARM Limited. All rights reserved.ARM DUI 0118C
Non-Confidential