Skip to content

Commit ea675b5

Browse files
committed
add detailed gdb support
1 parent 7f00252 commit ea675b5

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

Makefile

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,13 @@ QEMUGDB = $(shell if $(QEMU) -help | grep -q '^-gdb'; \
102102
else echo "-s -p 15234"; fi)
103103

104104
debug: build/kernel .gdbinit
105-
$(QEMU) $(QEMUOPTS) -S $(QEMUGDB) &
106-
sleep 1
107-
$(GDB)
105+
@tmux new-session -d \
106+
$(QEMU) $(QEMUOPTS) -S $(QEMUGDB) && \
107+
tmux split-window -h "$(GDB) -ex 'target remote localhost:15234'" && \
108+
tmux -2 attach-session -d
109+
110+
gdbserver: build/kernel
111+
$(QEMU) $(QEMUOPTS) -S $(QEMUGDB)
112+
113+
gdbclient:
114+
$(GDB) -ex "target remote localhost:15234"

0 commit comments

Comments
 (0)