Skip to content

Commit b86e0a6

Browse files
committed
add detailed gdb support
1 parent 7d72bde commit b86e0a6

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
@@ -112,9 +112,16 @@ QEMUGDB = $(shell if $(QEMU) -help | grep -q '^-gdb'; \
112112
else echo "-s -p 15234"; fi)
113113

114114
debug: build/kernel .gdbinit
115-
$(QEMU) $(QEMUOPTS) -S $(QEMUGDB) &
116-
sleep 1
117-
$(GDB)
115+
@tmux new-session -d \
116+
$(QEMU) $(QEMUOPTS) -S $(QEMUGDB) && \
117+
tmux split-window -h "$(GDB) -ex 'target remote localhost:15234'" && \
118+
tmux -2 attach-session -d
119+
120+
gdbserver: build/kernel
121+
$(QEMU) $(QEMUOPTS) -S $(QEMUGDB)
122+
123+
gdbclient:
124+
$(GDB) -ex "target remote localhost:15234"
118125

119126
CHAPTER ?= $(shell git rev-parse --abbrev-ref HEAD | grep -oP 'ch\K[0-9]')
120127

0 commit comments

Comments
 (0)