The cross GDB for your architecture should be used, either sh4-linux-gdb or arm-linux-gdb.

Connecting GDB to the kernel debugger

Before debugging, the debugger must connect to the KGDB using the chosen communication method. For example:

  • Using the serial port:
    % sh4-linux-gdb
    (gdb) file vmlinux
    (gdb) set remotebreak 1
    (gdb) set remotebaud 115200
    (gdb) target remote /dev/ttyS1
    (gdb) continue

  • Using KGDB ethernet support:
    % sh4-linux-gdb
    (gdb) file vmlinux
    (gdb) set remotebreak 0
    (gdb) target remote udp:<src-ip>:<src-port>
    (gdb) continue

The kernel can then be debugged like any other application.