2.10.3. Viewing trace information

To view the trace data, click on the Trace tab. This tab enables you to view:

The Trace tab also shows error and warning messages where appropriate (see Status lines in the Trace tab).

Columns in the Trace tab

The columns displayed in the Trace tab depend on the items you have selected in the Columns section of the Trace Data menu (see Displaying columns in the Trace tab). The following columns are available:

Elem

Displays the position of each element within the trace buffer, where the value can represent either:

  • An index within the trace buffer.

  • A cycle number, if your trace capture device supports cycle-accurate tracing. To display cycle numbers in this column you must select Cycle accurate tracing in the Configure ETM dialog box (see Cycle accurate tracing).

This column is displayed by default.

Time/unit

Displays the timestamp value. To change the format of the values, select View → Scale Time Units from the menu.

This column shows information only when either Enable Timestamps or Cycle accurate tracing is selected in the Configure ETM dialog box (see Enable Timestamping and Cycle accurate tracing). To scale between times and cycle numbers, select View → Define Processor Speed for Scaling... from the menu.

This column is displayed by default.

+Time

Displays a delta timestamp value, indicating the time taken between the previous instruction and the current instruction. To change the format of the values, select View → Scale Time Units from the menu.

This column shows information only when either Enable Timestamps or Cycle accurate tracing is selected in the Configure ETM dialog box (see Enable Timestamping and Cycle accurate tracing).

This column is not displayed by default.

Type

Displays the access type of the current element, which can be any of:

Bus

Bus state change.

Code

Code access (fetch).

Data

Data access (read or write).

DMA

Direct Memory Access (DMA) transfer operation.

Exec

Instruction was executed.

Folded

Folded branch (folded by branch prediction unit and never issued).

FoldNoEx

Folded branch (folded by branch prediction unit and never issued) was not executed.

Int

Interrupt vectoring.

Instr

Instructions on targets where the trace does not contain executed flags.

Note

The instruction might or might not have been executed.

NoExec

An instruction has not been executed.

Pin

Pin state change.

PreF

Prefetch (so not executed).

Prob

External probe state change.

Note

If an access type is prefixed by R, this indicates a read access. A W prefix indicates a write access.

This column is displayed by default.

Symbolic

Displays the symbolic position information for the current element, and takes one of the following forms:

  • source_symbol_name+offset

    For example, Arr_2_Glob+0x65 might be a data access to the variable address Arr_2_Glob, with an offset of 0x65.

  • source_symbol_name[\[~]#line_number[..#line_number]]

    source_symbol_name

    This can be any symbolic information, including a function, module, variable, or low-level symbol

    ~

    This means that the corresponding instruction, and the instructions corresponding to the symbols with the same line number, implement the same line of code. For example, instructions that implement a branch or loop.

    #line_number[..#line_number]

    This means that the corresponding instructions span the specified lines of source code.

    For example, your trace output might have the following sequence of symbols:

    Func_2\#159
    Func_2\~#159
    Func_2\#161..#164
    

    The instructions corresponding to the symbols Func_2\#159 and Func_2\~#159 both implement the source code at line 159 in the function Func_2().

    The instruction corresponding to the symbol Func_2\#161..#164 spans lines 161 to 164 of the source in the function Func_2().

This column is displayed by default.

Address

Displays the address of the instruction or data accessed.

This column is displayed by default.

Data/Hex

Displays data values in hexadecimal form.

This column is not displayed by default.

Data/Dec

Displays data values in decimal form.

This column is not displayed by default.

Opcode

Displays the opcode of the instruction accessed.

This column is displayed by default.

Other

For instructions, the disassembled instruction is displayed. For data, the display has the following format:

<Data> ‘character’ | hexvalue [‘character’ | hexvalue ...]

character

is a printable character or a C-style escape code.

hexvalue

is the hexadecimal value of the character if it is neither a printable character, nor an escape code.

For example:

<Data> ‘\f’ 0x03 ‘\0’ ‘\0’

This column is displayed by default.

Count

Displays the number of times a particular address was accessed.

This column is not displayed by default.

Displaying columns in the Trace tab

The options that are selected in the Columns section of the Trace Data menu control what information is displayed in the Trace tab. Table 2.5 summarizes the relationship between items in the Trace Data menu and the columns that are displayed:

Table 2.5. Trace Data menu items and column names

Trace Data Menu itemColumn name
PositionElem
Absolute TimeTime/unit
Relative Time+Time
Access TypeType
Address as ValueAddress
Address as Symbol/LineSymbolic
Data Value in HexData/Hex
Data Value in DecimalData/Dec
OpcodeOpcode
Interpretation of Data/OpcodeOther
Count of HitsCount

Rows in the Trace tab

You can control the type of trace information displayed by selecting the required option(s) from the Trace Data menu:

All Trace

Displays all entries in the trace buffer, regardless of type.

Instruction Boundaries

Displays instruction boundaries, divided by ruler lines. This is useful if you want to see loaded and stored data associated with the instruction that loaded or stored the data. This also shows the traced instructions, even if the Instructions option is not selected.

Instructions

Displays all instructions.

Data

Displays all data.

Function Boundaries

Displays additional rows giving the function boundaries.

Note

Function boundaries show where a function was called. Where the compiler inlines function calls, function boundaries are not shown.

If you display Inferred Registers and Function Boundaries but no other instruction records, then this view shows values passed into and returned from functions. Therefore, you can track function behavior. When you are running AAPCS-compliant code on an ARM processor registers r0-r3 contain function parameters, and r0 contains a function’s return value.

Interleaved Source

Displays the source lines associated with each trace buffer entry interleaved with the buffer entry. The corresponding code is displayed after each buffer entry. Where several successive buffer entries are associated with the same or overlapping sets of source lines, the source line is shown after the first buffer entry and then suppressed. Source code that is executed repeatedly is shown for each execution.

Inferred Registers

Displays inferred register values interleaved with the trace data, as shown in Figure 2.19. It also shows the instruction boundaries, even if the Instruction boundaries option is not selected.

Inferred register values are inferred from the traced instructions, and are not read from the registers. This means that not all register values are always known.

Note

The Inferred Registers view is only available if you are using an ARM architecture-based processor. In addition, traced instructions must be shown in the Trace tab. That is, when any of the Instructions and Instruction boundaries options is selected.

Figure 2.19.  Example of inferred registers

Example of inferred registers

The register data is shown following the instruction opcode, and shows the values in the registers after the instruction has executed. Register data is displayed in the following way:

  • Register names are gray.

  • Unchanged register values are black.

  • Changed register values are blue.

  • Unknown register values are represented by --------. If a register value became unknown in the current cycle, this appears in blue to indicate a changed register value.

The amount of information that can be inferred depends on the amount of information contained in the trace. If you have not traced data, few register values can be inferred. With full data trace, most register values can be inferred.

Note

When any of the Instructions and Instruction Boundaries options is selected, the inferred register values show the values contained in the registers after the instruction was executed.

When no instruction rows are displayed but Function Boundaries are displayed, the inferred register values shown are the values contained in the registers before the instruction at the function boundary was executed.

You can use the menu items at the bottom of the Trace Data menu to instruct RealView Debugger to display:

  • only those registers where the value is known

  • only those register where the value has changed between instructions

  • a narrower view of the registers in the display.

Only Known Registers

Enables you to view only those registers whose values are known.

This option is only available when Inferred Registers is selected.

Only Changing Registers

Enables you to view only those registers where the values have changed between instructions.

This option is only available when Inferred Registers is selected.

Narrow Register View

Enables you to view six registers on a line, instead of eight.

This option is only available when Inferred Registers is selected.

Status lines in the Trace tab

Some rows of the returned trace output in the Analysis window are for status-only purposes, and provide information about the processor cycle. These status lines are displayed in red, and can be any of the following messages:

Error messages

The Error messages that might be displayed in the Trace tab are:

Error: Synchronization Lost

Indicates that RealView Debugger has detected trace data that does not correspond to the image loaded into the debugger, and therefore cannot be decoded.

Error: ETM FIFO Overflow

Indicates that tracing was temporarily suspended because the ETM FIFO buffer became full. When this occurs, there is a discontinuity of returned trace information.

Error: Coprocessor data transfer of unknown size

When tracing data, RealView Debugger executed an unrecognized coprocessor memory access instruction, and the decompressor could not deduce the amount of data transferred by the instruction. Decompression of data tracing, and data address tracing, stop until appropriate synchronization points are found in the trace data.

Error: Data synchronization lost following FIFO overflow

Some versions of the ARM ETM can cause corrupt data trace after a FIFO overflow has occurred. If the decompressor sees a case where this is likely to have happened, it outputs this message, and suppresses data and data address tracing until it can resynchronize.

Error: Unexpected exception

The instruction has marked an exception, but the exception address does not appear to be a valid exception address.

Error: Instruction not known

The decompressor was not in sync for this instruction, but later discovered that this instruction was an exception.

Error: Incorrect synchronization address

An address broadcast for synchronization did not match that being maintained by the decompressor.

Error: Instruction data overflowed end of buffer

The data for the instruction is not in the buffer. This can occur when trace capture has stopped because it filled the buffer between the instruction being traced and its data being traced. All available data addresses and data are traced.

Error: The next instruction was traced as a branch

The instruction on the next line is not a branch, but the ETM traced it as a branch. This usually indicates that the wrong image is loaded into the debugger, or the code is self-modifying.

Error: The next instruction was not traced as an indirect branch

The instruction on the next line is an indirect branch, but the ETM did not trace it as an indirect branch. This usually indicates that the wrong image is loaded into the debugger, or the code is self-modifying.

Error: The next instruction was traced as a memory access instruction

The trace from the ETM indicated that the instruction on the next line read some data from memory, or wrote some data to memory, but the instruction is not a memory access instruction. This usually indicates that the wrong image is loaded into the debugger, or the code is self-modifying. Decompression of data tracing and data address tracing stops until appropriate synchronization points are found in the trace data.

Error: The next instruction should have been executed unconditionally

The trace from the ETM indicated that the instruction on the next line failed its condition code test, so was not executed, but the instruction is one that must be executed unconditionally. This usually indicates that the wrong image is loaded into the debugger, or the code is self-modifying.

Error: Corrupt address in trace data

The trace data contains an impossible address. This only occurs as a result of a hardware problem (such as a faulty connector).

Error: The next instruction was not traced as a branch

The current instruction is a branch but the trace does not indicate this. This usually indicates that the wrong image is loaded into the debugger, or the code is self-modifying. Decompression of data tracing and data address tracing stop until appropriate synchronization points are found in the trace data.

Error: The next instruction could not be read

The memory containing the traced instruction could not be read. This might occur if the application image attempts to execute a region of unreadable memory, in which case the instruction aborts with a Prefetch Abort. It might also occur if trace is decoded while the image is still running, and the image attempts to execute code outside the loaded image.

Warning messages

The Warning messages that might be displayed in the Trace tab are:

Warning: Debug State

Indicates that tracing was suspended for several processor cycles because the processor entered debug state.

Warning: Trace Pause

Indicates that tracing was temporarily suspended because of the trace conditions that have been set. Trace Pause represents the period of execution between the areas you have defined to be traced.

Warning: Instruction address synchronization has been restored

This message occurs after a problem in which instruction address synchronization has been lost. It indicates that the decompressor has found a point at which it can resume decompressing instruction addresses.

Warning: Unable to trace Jazelle state, trace data ignored

The ETM detected the processor entering Jazelle® (bytecode) state. The decompressor is unable to decompress Jazelle bytecode execution, so all trace output is suppressed until the processor leaves Jazelle state.

Warning: Data address synchronization restored

This message occurs after a problem in which data address synchronization has been lost. It indicates that the decompressor has found a point at which it can resume decompressing data addresses.

Warning: Data synchronization restored

This message occurs after a problem in which data synchronization has been lost. It indicates that the decompressor has found a point at which it can resume decompressing data.

Warning: Memory address unknown, insufficient trace data

This warning only occurs near the beginning of the decoded trace when the trace buffer (not the FIFO) of the trace capture hardware has overflowed. It means that there has not yet been a complete memory access address in the trace data, and therefore the trace decoder cannot calculate the address of a data access. The ETM outputs a complete address on the first data access traced, and repeats this every 1024 cycles after this, if there are data accesses to be traced. To reduce buffer usage, other memory addresses are output relative to the last full memory address. If the buffer overflows, and the complete address is lost, the decoder cannot calculate data addresses that occur before the next full data address is emitted.

Warning: Data suppression protected ETM FIFO from overflow

This warning occurs when you have enabled data suppression (see FIFO overflow protection), and the ETM has to suppress the output of data in an attempt to prevent an ETM FIFO overflow. This is usually followed by the Warning: Data synchronization restored status line when data trace is restored.

Copyright © 2006 ARM Limited. All rights reserved.ARM DUI 0335A
Non-Confidential