PPC checkpoints
In addition to software breakpoints, PPC also supports hardware breakpoints implemented through registers IABR
(and possibly IABR2
depending on the base version). These are instruction breakpoints, but there are also data breakpoints (implemented with DABR
and possibly DABR2
). If your kernel supports two sets of hardware breakpoint registers (for example, IABR2 and DABR2), you can do more than just trigger at a specific address: you can specify an entire contiguous range of addresses as a breakpoint. For data checkpoints, you can also specify whether you want them to run on write, read, or access.
source to share
With gdb and a function that does hexadecimal operations, I get 0x7fe00008. This seems to be tw instruction :
0b01111111111000000000000000001000
011111 31
11111 condition flags: lt, gt, ge, logical lt, logical gt
00000 rA
00000 rB
0000000100 constant 4
0 reserved
i.e. compare r0 with r0 and the trap for any result.
Parsing GDB is just an extended mnemonictrap
EDIT: I am using "GNU gdb 6.3.50-20050815 (Apple version gdb-696) (Sat Oct 20 18:20:28 GMT 2007)"
EDIT 2: It's also possible that conditional breakpoints will use other forms, tw
or twi
if the required values ββare already in the register and the debugger doesn't need to keep track of the hit counter.
source to share