Skip to content

Commit b3b486c

Browse files
committed
debug: add basic setup for qemu/gdb
1 parent 4bce609 commit b3b486c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,12 @@ clean:
9595
qemu: bootdisk.iso
9696
qemu-system-x86_64 -drive file=./bootdisk.iso,format=raw -k en-us
9797

98+
gdb:
99+
gdb -x /tmp/gdbcommands.$(shell id -u) build/kernel
100+
101+
qemu-gdb: bootdisk.iso
102+
@echo "target remote localhost:$(shell echo $$(( $$(id -u) % (65536 - 1024) + 1024 )))" > /tmp/gdbcommands.$(shell id -u)
103+
@qemu-system-x86_64 -drive file=bootdisk.iso,format=raw -k en-us -S -gdb tcp::$(shell echo $$(( $$(id -u) % (65536 - 1024) + 1024 )))
98104

99105
test:
100106
@echo "---BUILD DIR---"

0 commit comments

Comments
 (0)