Skip to content

Commit

Permalink
configs: provide a fragment to enable gdb for qemu
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
roxell committed Nov 26, 2024
1 parent ed9a4ad commit 0ef04ff
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions kernel/configs/qemu-gdb.config
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 0ef04ff

Please sign in to comment.