aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTianhao Wang <shrik3@mailbox.org>2024-06-04 17:53:37 +0200
committerTianhao Wang <shrik3@mailbox.org>2024-06-11 15:17:12 +0200
commitb3b486c868353f8d6f56739529978042ba939e09 (patch)
tree398f775b8e0eb759f8b98149c109c1ca95a8cad7
parent4bce609d2a0145e70f44227636a68348e9b23cf9 (diff)
debug: add basic setup for qemu/gdb
-rw-r--r--Makefile6
1 files changed, 6 insertions, 0 deletions
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---"