bdiGDB for BDI2000 (PowerPC 7440/7450/86xx) User Manual 37
© Copyright 1997-2015 by ABATRON AG Switzerland V 1.13
3.3.3 Breakpoint Handling
GDB versions before V5.0:
GDB inserts breakpoints by replacing code via simple memory read / write commands. There is no
command like "Set Breakpoint" defined in the GDB remote protocol. When breakpoint mode HARD
is selected, the BDI checks the memory write commands for such hidden "Set Breakpoint" actions.
If such a write is detected, the write is not performed and the BDI sets an appropriate hardware break-
point. The BDI assumes that this is a "Set Breakpoint" action when memory write length is 4 bytes
and the pattern to write is 0x7D821008 (tw 12,r2,r2).
GDB version V5.x:
GDB version >= 5.0 uses the Z-packet to set breakpoints (watchpoints). For software breakpoints,
the BDI replaces code with 0x7D821008 (tw 12,r2,r2). When breakpoint mode HARD is selected,
the BDI sets an appropriate hardware breakpoint.
3.3.4 GDB monitor command
The BDI supports the GDB V5.x "monitor" command. Telnet commands are executed and the Telnet
output is returned to GDB. This way you can for example switch the BDI breakpoint mode from within
your GDB session.
(gdb) target remote bdi2000:2001
Remote debugging using bdi2000:2001
0x10b2 in start ()
(gdb) monitor break
Breakpoint mode is SOFT
(gdb) mon break hard
(gdb) mon break
Breakpoint mode is HARD
(gdb)