From b3b486c868353f8d6f56739529978042ba939e09 Mon Sep 17 00:00:00 2001 From: Tianhao Wang Date: Tue, 4 Jun 2024 17:53:37 +0200 Subject: debug: add basic setup for qemu/gdb --- Makefile | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Makefile b/Makefile index 3fbe202..8575032 100644 --- a/Makefile +++ b/Makefile @@ -95,6 +95,12 @@ clean: qemu: bootdisk.iso qemu-system-x86_64 -drive file=./bootdisk.iso,format=raw -k en-us +gdb: + gdb -x /tmp/gdbcommands.$(shell id -u) build/kernel + +qemu-gdb: bootdisk.iso + @echo "target remote localhost:$(shell echo $$(( $$(id -u) % (65536 - 1024) + 1024 )))" > /tmp/gdbcommands.$(shell id -u) + @qemu-system-x86_64 -drive file=bootdisk.iso,format=raw -k en-us -S -gdb tcp::$(shell echo $$(( $$(id -u) % (65536 - 1024) + 1024 ))) test: @echo "---BUILD DIR---" -- cgit v1.2.3-70-g09d2