From 45c5fcf5cb3a48543e4d3a77ef5ccbc7f764e0bb Mon Sep 17 00:00:00 2001 From: Idan Horowitz Date: Fri, 25 Mar 2022 00:03:32 +0200 Subject: [PATCH] Meta: Disable KASLR when debugging the kernel with GDB This lets GDB resolve the kernel symbols correctly. --- Meta/serenity.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Meta/serenity.sh b/Meta/serenity.sh index 799022cecc..41317b7063 100755 --- a/Meta/serenity.sh +++ b/Meta/serenity.sh @@ -464,6 +464,8 @@ elif [ "$CMD" = "__tmux_cmd" ]; then fi # We need to make sure qemu doesn't start until we continue in gdb export SERENITY_EXTRA_QEMU_ARGS="${SERENITY_EXTRA_QEMU_ARGS} -d int -no-reboot -no-shutdown -S" + # We need to disable kaslr to let gdb map the kernel symbols correctly + export SERENITY_KERNEL_CMDLINE="${SERENITY_KERNEL_CMDLINE} disable_kaslr" set_tmux_title 'qemu' build_target run elif [ "$CMD" = "gdb" ]; then