gdb: PowerPC Embedded
21.3.7 PowerPC Embedded
-----------------------
GDB supports using the DVC (Data Value Compare) register to implement in
hardware simple hardware watchpoint conditions of the form:
(gdb) watch ADDRESS|VARIABLE \
if ADDRESS|VARIABLE == CONSTANT EXPRESSION
The DVC register will be automatically used when GDB detects such
pattern in a condition expression, and the created watchpoint uses one
debug register (either the 'exact-watchpoints' option is on and the
variable is scalar, or the variable has a length of one byte). This
feature is available in native GDB running on a Linux kernel version
2.6.34 or newer.
When running on PowerPC embedded processors, GDB automatically uses
ranged hardware watchpoints, unless the 'exact-watchpoints' option is
on, in which case watchpoints using only one debug register are created
when watching variables of scalar types.
You can create an artificial array to watch an arbitrary memory
region using one of the following commands (Expressions):
(gdb) watch *((char *) ADDRESS)@LENGTH
(gdb) watch {char[LENGTH]} ADDRESS
PowerPC embedded processors support masked watchpoints. See the
discussion about the 'mask' argument in Set Watchpoints.
PowerPC embedded processors support hardware accelerated "ranged
breakpoints". A ranged breakpoint stops execution of the inferior
whenever it executes an instruction at any address within the range it
specifies. To set a ranged breakpoint in GDB, use the 'break-range'
command.
GDB provides the following PowerPC-specific commands:
'break-range START-LOCATION, END-LOCATION'
Set a breakpoint for an address range given by START-LOCATION and
END-LOCATION, which can specify a function name, a line number, an
offset of lines from the current line or from the start location,
or an address of an instruction (see Specify Location, for
a list of all the possible ways to specify a LOCATION.) The
breakpoint will stop execution of the inferior whenever it executes
an instruction at any address within the specified range,
(including START-LOCATION and END-LOCATION.)
'set powerpc soft-float'
'show powerpc soft-float'
Force GDB to use (or not use) a software floating point calling
convention. By default, GDB selects the calling convention based
on the selected architecture and the provided executable file.
'set powerpc vector-abi'
'show powerpc vector-abi'
Force GDB to use the specified calling convention for vector
arguments and return values. The valid options are 'auto';
'generic', to avoid vector registers even if they are present;
'altivec', to use AltiVec registers; and 'spe' to use SPE
registers. By default, GDB selects the calling convention based on
the selected architecture and the provided executable file.
'set powerpc exact-watchpoints'
'show powerpc exact-watchpoints'
Allow GDB to use only one debug register when watching a variable
of scalar type, thus assuming that the variable is accessed through
the address of its first byte.