| |||
| Home > RealView Debugger Commands > Alphabetical command reference > BREAKREAD | |||
The BREAKREAD command sets a read breakpoint at the specified memory location(s).
BREAKREAD [address | address_range]
[;macro_call]
where:
address | address_rangeSpecifies a single address in target memory, or an address range.
macro_callSpecifies a macro and any parameters it requires.
BREAKREAD is used to set or modify data read breakpoints. Data read breakpoints trigger when data that matches a condition is read from memory at a particular address or address range. If the command has no arguments, it behaves like DTBREAK on DTBREAK, listing the current breakpoints.
If you do not specify an address, the read breakpoint is set at the address defined by the current value of the PC. The breakpoint is triggered if the target program reads data from any specified target memory area.
If specified, this macro runs when the breakpoint is triggered and after the instruction at the breakpoint is executed. If the macro returns a true (nonzero) value, execution continues. If the macro returns a false (zero) value, or if you do not specify a macro, target execution stops and the debugger waits in command mode.
The list of qualifiers is dependent on the processor and vehicle and so the GUI does not present things that do not make sense. The command handler generates an error if a specific combination is not allowed for a specific processor or vehicle, but this is determined when you issue the command. The possible qualifiers are:
append:(n)Instead of creating a new breakpoint, append the
qualifiers specified with this command to an existing breakpoint
with breakpoint ID number .
You cannot change the breakpoint address.n
continueAny triggering of the breakpoint is recorded (for example, as a journal entry, or by the action of a macro) but execution then continues.
context:{context}Sets the context for other expressions in this breakpoint command to the value of context. This provides an alternative to specifying the complete context for every symbol. For example:
BREAKREAD,context:{\HELLO_1\HELLO_C},when:{status>0} #15
This causes a breakpoint to be set at line 15 of hello.c that
is triggered only when the variable status defined
in hello.c is greater than zero. The alternative
form is:
BREAD,when:{\HELLO_1\HELLO_C\status>0} \HELLO_1\HELLO_C\#15
data_onlyThe
breakpoint is triggered if a data value, specified using hw_dvalue,
is detected by the debug hardware on the processor data bus.
guiIf an error occurs when executing the command or when the breakpoint is triggered, the GUI is used to report it. Otherwise, the error is reported to the command pane.
hw_ahigh:(n)Specifies the high address for an address-range breakpoint. The low address is specified by the standard breakpoint address.
This facility is not supported by ARM EmbeddedICE macrocells. For
example, this command sets a breakpoint that triggers for any address
between 0x1000-0x1200:
BREAKREAD,hw_ahigh:0x1200 0x1000
hw_amask:(n)Specifies the address mask value for an address-range breakpoint. Addresses that match the standard breakpoint address when masked with this value cause the breakpoint to trigger.
This facility is supported by ARM EmbeddedICE macrocells.
For example, this command sets a breakpoint that triggers for any address
between 0x1FA00-0x1FA0F:
BREAKREAD,hw_amask:0xFFFF0 0x1FA00
hw_dvalue:(n)Specifies a data value to be compared to values transmitted on the processor data bus.
This facility is supported by ARM EmbeddedICE macrocells.
For example, this command sets a breakpoint that triggers for the
data value 0x400:
BREAKREAD,hw_dvalue:0x440 0x1FA00
hw_dhigh:(n)Specifies the high data value for a data-range breakpoint.
The low data value is specified by the hw_dvalue qualifier.
This facility is not supported by ARM EmbeddedICE macrocells. For
example, this command sets a breakpoint that triggers for any data
value between 0x00-0x18:
BREAKREAD,hw_dvalue:0x0,hw_dhigh:0x18 0x1000
hw_dmask:(n)Specifies the data value mask value for a data-range
breakpoint. Data values that match the value specified by the hw_dvalue qualifier
when masked with this value cause the breakpoint to trigger.
This facility is supported by ARM EmbeddedICE macrocells.
For example, this command sets a breakpoint that triggers for any
data value between 0x400-0x4F0:
BREAKREAD,hw_dvalue:0x440,hw_dmask:0xF0F 0x1FA00
hw_passcount:(n)Specifies the number of times that the specified
condition has to occur to trigger the breakpoint. The default value
is 1. This qualifier differs from passcount only
in that it is implemented in hardware. is
limited to a 32-bit value by the debugger, but might be much more
limited by the target hardware, for example to 8 or 16 bits.n
You can combine hardware and software pass counts to supplement the hardware one for higher count values. When both hardware and software pass counts are defined:
When the hardware count reaches zero, the software count is decremented.
When the software count reaches zero, the breakpoint triggers.
hw_and:{[then-]id}Perform an and or an and-then conjunction
with an existing breakpoint. For example, hw_and:{2},
or hw_and:{then-2}, where 2 is
the breakpoint id of another breakpoint.
In the and form, the conditions associated with both breakpoints are tied, so that the action associated with the second breakpoint are performed only when both conditions simultaneously match.
In the and-then form, when the condition
for the first breakpoint is met, the second breakpoint is enabled
but the program is not yet stopped. When the second breakpoint condition
is matched, the actions associated are performed. At this point,
unless the continue qualifier is specified in
the second breakpoint, the program stops.
The is one
of:id
the breakpoint list index of an existing breakpoint
prev for the last breakpoint
specified for this connection.
Debugger internal handle numbers are not available to users to identify breakpoints.
hw_in:{}In trigger tests. The string that follows matches hardware-supported input tests, per vehicle and processor, as a list of names or a value.
hw_out:{s}Not supported in this release.
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 can
be set to:s
addrInvert the breakpoint address value.
dataInvert the breakpoint value.
thenInvert
an associated hw_and:{then} condition.
For example, to break when a data value does not match a mask, you can write:
BREAKREAD,hw_not:data,hw_dmask:0x00FF ...
The break commands require an address value, and the addr variant
of hw_not uses this address.
BREAKREAD,hw_not:addr 0x10040
This means to break at any address other than 0x10040.
This is probably not useful.
The hw_not:then variant of the command
is used in conjunction with hw_and to form nand and nand-then conditions.
This facility is not supported by ARM EmbeddedICE macrocells.
macro:(MacroCall(arg1,arg2))The triggering of the breakpoint results in the specified macro being executed. Any program variables or functions must be in scope at the time the breakpoint request is entered, or the names must be fully qualified.
message:{message}Triggering of the breakpoint results in being
output. Prefixing message with message$ enables
you to write the message text to window n$n,
where n is between 50-1024.
modify:(n)Instead of creating a new breakpoint, modify the
breakpoint with breakpoint ID number by
replacing the address expression and the qualifiers of the existing
breakpoint to those specified in this command.n
obj:(n)This condition is true if the argument matches
the C++ object pointer, normally called nthis.
passcount:(n)Specifies the number of times that the specified condition has to occur to trigger the breakpoint. The default value is 1. If you specify this in the middle of a sequence of break conditions, those specified before the passcount are processed whether or not the count reaches zero. Only the conditions specified afterwards are run only when the count reaches zero.
There is a hardware passcount qualifier available, hw_passcount, for
debug hardware that supports it.
If a hardware breakpoint uses a passcount,
the counting is performed on the host, and so program execution
stops briefly every time the breakpoint is hit, even when the count
has not been reached.
sampleNot supported in this release.
register:expressionThe breakpoint is triggered if the value stored
in the specified memory-mapped register is read. The register is
identified by expression. For example:
ba,register:PR1
or
ba,register:@PR1
You cannot specify core registers with this qualifier.
timedTriggering records the time, in whatever units the debug hardware chooses, from the last reset of time. The time can be in nanoseconds, microseconds, processor cycles, instructions, or units. See the documentation for the hardware interface for more information.
The recorded times are displayed in the Resource Viewer window and in the breakpoint information for this breakpoint.
The timed qualifier can be used for simple profiling, or for
a measure of specific response times. If you use timed and continue, the
debugger keeps a log of times for each break.
update:{@}Update the named windows, or all windows, by reading the memory
and processor state when the breakpoint triggers. You can use the
name all to refresh all windows, or a name specified in
the title bar of the window.
This qualifier enables you to get an overview of the process state at a particular point, without having to manually restart the process at each break. The update still takes a significant period of time, and so this method is unsuitable as a non-intrusive debugging tool.
when:{condition}The breakpoint is triggered whenever condition,
a debugger expression, evaluates to TRUE.
when_not:{condition}The breakpoint is triggered whenever condition,
a debugger expression, evaluates to FALSE.
The following examples show how to use BREAKREAD:
Stop program execution if a read occurs at location 0x8000.
Stop program execution if a read occurs in the 257
bytes from 0x100-0x200 (inclusive).
The following commands provide similar or related functionality: