PowerPC Embedded (Debugging with ROCGDB)

Next: AVR, Previous: OpenRISC 1000, Up: Embedded Processors [Contents][Index]

#### 22.3.8 PowerPC Embedded

ROCGDB 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 ROCGDB 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 ROCGDB running on a Linux kernel version 2.6.34 or newer.

When running on PowerPC embedded processors, ROCGDB 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 ROCGDB, use the `break-range` command.

ROCGDB 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 ROCGDB to use (or not use) a software floating point calling convention. By default, ROCGDB selects the calling convention based on the selected architecture and the provided executable file.

`set powerpc vector-abi`
`show powerpc vector-abi`

  Force ROCGDB 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, ROCGDB selects the calling convention based on the selected architecture and the provided executable file.

`set powerpc exact-watchpoints`
`show powerpc exact-watchpoints`

  Allow ROCGDB 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.

Next: AVR, Previous: OpenRISC 1000, Up: Embedded Processors [Contents][Index]