Adding a fragment to make it easier to know what options is needed to build a kernel to get the that you can debug in qemu.
First you need to start qemu with flags '-s -S' and then connect with gdb like below: $ gdb \ ./obj-dir/vmlinux -iex 'add-auto-load-safe-path \ ./obj-dir' -ex 'target remote localhost:1234' Signed-off-by: Anders Roxell <anders.rox...@linaro.org> --- kernel/configs/qemu-gdb.config | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 kernel/configs/qemu-gdb.config diff --git a/kernel/configs/qemu-gdb.config b/kernel/configs/qemu-gdb.config new file mode 100644 index 000000000000..30465905ff93 --- /dev/null +++ b/kernel/configs/qemu-gdb.config @@ -0,0 +1,7 @@ +# Enable debug info for gdb +# CONFIG_COMPILE_TEST is not set +CONFIG_DEBUG_INFO=y +CONFIG_GDB_SCRIPTS=y + +# Easier to debug +# CONFIG_RANDOMIZE_BASE is not set -- 2.19.2