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 (see 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-locationset powerpc soft-float
show powerpc soft-float
set powerpc vector-abi
show powerpc vector-abi
set powerpc exact-watchpoints
show powerpc exact-watchpoints