I am trying to setup KGDB to debug our arm64 kernel. My setup is that target is running on kernel 3.14 (with some arm64 kgdb patches back ported), on host I used the linaro toolchain 4.8 aarch64-linux-gnu-gdb, and whenever I issue:
target remote /dev/ttyS0
I got the error message:
Remote 'g' packet reply is too long:
I Googled a lot on the problem, and none of them worked out for me. I think this problem is specific to arm64. Does anyone here by any chance know how to proceed?
Inspired the question here: https://answers.launchpad.net/gcc-arm-embedded/+question/193249
I found the solution. Before issuing
do the following
I took aarch64.xml from the latest gdb source code: gdb-7.8/gdb/features/aarch64.xml. By doing that, we instruct the GDB client to accept more registers than it initially expects.
The root cause seems that the GDB client is only expecting 31 registers and register SP, PC, CPSR, but kernel gdb stub returns not only those registers but other FPU registers, which cause error message: