Skip to content

Commit bbb5832

Browse files
committed
add detailed gdb support
1 parent a8b9240 commit bbb5832

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

118118
debug: build/kernel .gdbinit
119-
$(QEMU) $(QEMUOPTS) -S $(QEMUGDB) &
120-
sleep 1
121-
$(GDB)
119+
@tmux new-session -d \
120+
$(QEMU) $(QEMUOPTS) -S $(QEMUGDB) && \
121+
tmux split-window -h "$(GDB) -ex 'target remote localhost:15234'" && \
122+
tmux -2 attach-session -d
123+
124+
gdbserver: build/kernel
125+
$(QEMU) $(QEMUOPTS) -S $(QEMUGDB)
126+
127+
gdbclient:
128+
$(GDB) -ex "target remote localhost:15234"
122129

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

0 commit comments

Comments
 (0)