Skip to content

Commit

Permalink
Disable kaslr when debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
cpey committed Jun 14, 2022
1 parent 68f55e8 commit d4ad026
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions tools/start-vm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -79,21 +79,23 @@ fi
KERNEL_BUILD=$TOOLS_DIR/../build/linux/arch/x86_64/boot/bzImage-$suffix

DEBUG_OPTS=''
KVM_OPTS=''
if (( $DEBUG )); then
DEBUG_OPTS+="-serial tcp::1234,server,nowait"
CMD_LINE+=" kgdboc=ttyS0,115200"
DEBUG_OPTS+="-serial tcp::1234,server,nowait -smp 1"
CMD_LINE+=" kgdboc=ttyS0,115200 nokaslr"
if (( $WAIT_DEBUG )); then
CMD_LINE+=" kgdbwait"
fi
fi
echo Booting $KERNEL_BUILD
qemu-system-x86_64 \
$DEBUG_OPTS \
$KVM_OPTS \
-kernel $KERNEL_BUILD \
-m $RAM \
-cpu $CPU \
-drive file=$rootfs,index=0,media=disk,format=raw \
-enable-kvm \
-drive file=$rootfs,index=0,media=disk,format=raw \
-append "$CMD_LINE -device vhost-vsock-pci,guest-cid=" \
-nographic \
-netdev user,id=net0,hostfwd=tcp::$VM_PORT-:22 \
Expand Down

0 comments on commit d4ad026

Please sign in to comment.