bdi
GDB
for GNU Debugger, BDI2000 (ARM)
User Manual
42
© Copyright 1997-2005 by ABATRON AG Switzerland
V 1.17
3.3.3 Breakpoint Handling
If your GDB version does not support the Z-packet protocol unit, it inserts breakpoints by replacing
code via simple memory read / write commands. When breakpoint mode HARD is selected, the BDI
checks the memory write commands for such hidden "Set Breakpoint" actions. If such a write is de-
tected, the write is not performed and the BDI sets an appropriate hardware breakpoint. The BDI as-
sumes that this is a "Set Breakpoint" action when memory write length is 4 bytes and the pattern to
write is the one defined with the BREAKMODE parameter (default is 0xE7FFDEFE).
If your GDB version make use of the Z-Packet, then GDB tells the BDI to set / clear breakpoints with
this special protocol unit. The BDI will respond to this request by replacing code in memory or by set-
ting the appropriate hardware breakpoint. The pattern used to replace memory is the one defined
with the BREAKMODE parameter. It is recommended to define a pattern of 0xDFFFDFFF in this
case because this pattern allows to debug mixed ARM/Thumb applications.
The ARM IceBreaker supports two hardware breakpoints (watchpoints). For ARM7 and ARM9 one
of them is used to support software breakpoints and vector catching for ARM7 targets. The other can
be used for a hardware breakpoint. To make both available for hardware breakpoints, you should se-
lect BREAKMODE HARD and disable vector catching.
For ARM9E the BKPT instruction is always used to implement software breakpoints. In that case no
hardware breakpoint (watchpoint) is used to implement software breakpoints.
User controlled hardware breakpoints:
The ARM IceBreaker has a special watchpoint hardware integrated. Normally the BDI controls this
hardware in response to Telnet commands (BI, BDx) or when breakpoint mode HARD is selected.
Via the Telnet commands BI and BDx, you cannot access all the features of the breakpoint hardware.
Therefore the BDI assumes that the user will control / setup this watchpoint hardware as soon as the
appropriate Watchpoint Control register is written to. This way the debugger or the user via Telnet has
full access to all features of this watchpoint hardware. When setting a watchpoint, use the following
register numbers. The values will be written to the IceBreaker immediately before a target restart.
100 : Watchpoint 0 Address Value
110 : Watchpoint 1 Address Value
101 : Watchpoint 0 Address Mask
111 : Watchpoint 1 Address Mask
102 : Watchpoint 0 Data Value
112 : Watchpoint 1 Data Value
103 : Watchpoint 0 Data Mask
113 : Watchpoint 1 Data Mask
104 : Watchpoint 0 Control Value
114 : Watchpoint 1 Control Value
105 : Watchpoint 0 Control Mask
115 : Watchpoint 1 Control Mask
Example:
BDI> rmib 100 0x00104560
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.
(gdb) target remote bdi2000:2001
Remote debugging using bdi2000:2001
0x10b2 in start ()
(gdb) monitor md 0 1
00000000 : 0xe59ff018 - 442503144 ...