Search code examples
gdbarmgdbserver

GDB hardware breakpoint don't work with remote debugging


I use GDBServer to do a remote debug with an ARM11 CPU. The software breakpoint works well, but we i use "hbreak test.c:5" to set a hardware breakpoint, CPU will never stop.

GDB version: 7.3.1

Target CPU: ARM11

Operation:

arm-linux-gdb ./main
(gdb) target remote 192.168.0.1:2345
(gdb) hbreak test.c:5   => HW breakpoint, it doesn't work. but if change to "b test.c:5", it will works
(gdb) c   

Does anybody can tell me how to enable hardware debug with GDB7.3.1? Thanks!


Solution

  • Hardware breakpoints can only be manipulated by JTAG probes. GDB cannot access them, unless you have a JTAG probe (which I doubt you have) connected to your device and a software glue (eg OpenOCD), allowing GDB to communicate with the JTAG probe. On pandaboard, for instance, TI recommends those JTAG probes: http://omapedia.org/wiki/PandaBoard_JTAG_Debugging