2.3.134. TRACEDATAACCESS

The TRACEDATAACCESS command sets a trace point on data accesses, that is, either reads or writes.

Note

This command is valid only for ETM-based hardware targets.

Syntax

TRACEDATAACCESS [,qualifier...] {address | address_range}

where:

qualifier

Is an ordered list of zero or more qualifiers. The possible qualifiers are described in List of qualifiers.

address

Specifies the address at which the tracepoint is placed.

address_range

Specifies the address range for the tracepoint. See Specifying address ranges for details on how to specify an address range.

Description

This command sets a tracepoint at the address or address range you specify that triggers when an instruction access at the indicated address accesses data from memory.

The tracepoint type is by default to trigger, that is, start collecting trace information into the trace buffer. You can modify the action using the hw_out: qualifier to, for example, stop tracing.

For more information about tracepoints and the way you access the ETM, see the Embedded Trace Macrocell Specification and the chapter that describes tracing in RealView Debugger v1.8 Extensions User Guide.

List of qualifiers

The command qualifiers are as follows, but not all qualifiers are available for all of the supported trace targets:

gui

If an error occurs when executing the command or when the tracepoint is triggered, the GUI is used to report it. Otherwise, the error is reported to the command pane.

Note

This qualifier has no effect in the headless debugger.

hw_ahigh:(n)

Specifies the high address for an address-range tracepoint. The low address is specified by the standard tracepoint address.

For example, this command sets a tracepoint that triggers when a data access is made by any instruction in the address range from 0x1000 to 0x1200:


TRCDA,hw_ahigh:0x1200 0x1000

hw_dvalue:(n)

Specifies a data value to be compared to values transmitted on the processor data bus.

For example, this command sets a tracepoint that triggers for a data read or a data write of the data value 0x400 at an instruction at address 0x1FA00:


TRCDA,hw_dvalue:0x400 0x1FA00

hw_dhigh:(n)

Specifies the high data value for a data-range tracepoint. The low data value is specified by the hw_dvalue qualifier.

For example, this command sets a tracepoint that triggers for any data read or a data write of the data value between 0x00-0x18 at an instruction at address 0x1000:


TRCDA,hw_dvalue:0x0,hw_dhigh:0x18 0x1000

hw_dmask:(n)

Specifies the data value mask value used for in comparisons with a data-value tracepoint. Data values that match the value specified by the hw_dvalue qualifier when masked with this value cause the tracepoint to trigger.

For example, this command sets a tracepoint that triggers for any data read or a data write of the data value between 0x400-0x4FF at an instruction at address 0x1000:


TRCDA,hw_dvalue:0x400,hw_dmask:0xF00 0x1000

hw_passcount:(n)

Specifies the number of times that the specified condition has to occur to trigger the tracepoint.

You can use this option to set up and use the ARM ETM counter hardware, if the ETM has counters exists and there is one available for use. ETM counters are 32 bits.

hw_and:{[then-]id}

Perform an and or an and-then conjunction with an existing tracepoint. For example, hw_and:h2, or hw_and:"then-h2", where 2 is the tracepoint id of another tracepoint.

In the and form, the conditions associated with both tracepoints are chained together, so that the action associated with the second tracepoint is performed only when both conditions match at the same time.

In the and-then form, when the condition for the first tracepoint is met, the second tracepoint is enabled. When the second tracepoint condition is matched, even if the first condition no longer matches, the actions associated are performed.

The id is one of:

  • the tracepoint list index of an existing of tracepoint, and has the format hindex, for example h1

  • prev for the last tracepoint specified for this connection

  • next for the target of this condition.

For example, these two commands set a tracepoint that triggers the trace buffer when a data access in code at line 582 of modify.c is followed by another data access at line 379 of access.c:


TRCDA \MODIFY_1\#582
TRCDA,hw_and:then-1 \ACCESS_1\#379

hw_in:{s}

Input trigger tests. The string s is specific to the trace connection being used. For the ARM ETM, the following case-sensitive forms are defined:

"Size of Data Access=s"

For data comparisons, check the data access size against the specified value, and return True if it matches, where s is:

Any

Any access size.

Halfword

16-bit accesses.

Word

32-bit accesses.

For example, this command sets a tracepoint that triggers for any 16-bit data read or a write that occurs in the program code between 0x1E000-0x1FF00:


TRCDA,hw_in:"Size of Data Access=Halfword" 0x1E00..0x1FF00

hw_out:{s}

Output trigger tests. The string s is specific to the trace connection being used. For the ARM ETM, the following case-sensitive form is defined:

"Tracepoint Type=s"

Specify the trace action for this command, where s is:

Trigger

Sets a trigger point.

Start Tracing

Sets a trace start point.

Stop Tracing

Sets a trace stop point.

Trace Instr

Sets an instruction-only trace range.

Trace Instr and Data

Sets an instruction and data trace range.

For example, this command sets a tracepoint that traces all instructions executed between program code addresses 0x1E000-0x1FF00, but does not trace instructions outside this range:


TRCDA,hw_out:"Tracepoint Type=Trace Instr" 0x1E00..0x1FF00

hw_not:{s}

Use this qualifier to invert the sense of an address, data, or hw_and term specified in the same command. The argument s can be set to:

addr

Invert the tracepoint address value.

data

Invert the tracepoint value.

then

Invert an associated hw_and:{then} condition.

For example, to trace when a data value does not match a mask, you can write:


TRCDA,hw_not:data,hw_dmask:0x00FF ...

The trace commands require an address value, and the addr variant of hw_not uses this address.


TRCDA,hw_not:addr 0x10040..0x10060

This means to trace execution at addresses other than the range 0x10040-0x10060, that is, exclude this region from the trace.

The hw_not:then variant of the command is used in conjunction with hw_and to form or and nand-then conditions.

modify:(n)

Instead of creating a new tracepoint, modify the tracepoint with tracepoint ID number n by replacing the address expression and the qualifiers of the existing tracepoint to those specified in this command.

Note

You cannot use this qualifier with the hw_and qualifier to change a non-chained tracepoint to a chained tracepoint. However, you can modify a chained tracepoint with any other qualifier and also change the address expression.

Examples

The following examples show how to use TRACEDATAACCESS:

TRACEDATAACCESS \MATH_1\#449.3

Set a trace trigger at statement 3 of line 449 in the file math.c.

TRCDA \MAIN_1\#35..\MAIN_1\#63

Start tracing instructions when a data access in the code between line 35-63 of main.c occurs.

TRCDA,hw_pass:5,hw_out:"Tracepoint Type=Start Tracing" \MAIN_1\#35

Start tracing when a data access at line 35 of main.c occurs.

TRCDA,hw_out:"Tracepoint Type=Stop Tracing" \GUI_1\#35..\GUI_1\#78

Stop tracing when any instruction between line 35-78 of gui.c accesses data.

Alias

TRCDACCES is an alias of TRACEDATAACCESS.

See also

The following commands provide similar or related functionality:

Copyright © 2002-2005 ARM Limited. All rights reserved.ARM DUI 0175G
Non-Confidential