summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorSilas Boyd-Wickizer <[email protected]>2009-09-15 17:15:36 -0400
committerSilas Boyd-Wickizer <[email protected]>2009-09-15 17:15:36 -0400
commit568bbae801dcde879a3738d482ed2b0570875c6c (patch)
tree7ff0d347aa2601cdae11f327a4127a227006b61e /Makefile
parentc51e175bf06862150643e2746056171500e0b928 (diff)
downloadxv6-labs-568bbae801dcde879a3738d482ed2b0570875c6c.tar.gz
xv6-labs-568bbae801dcde879a3738d482ed2b0570875c6c.tar.bz2
xv6-labs-568bbae801dcde879a3738d482ed2b0570875c6c.zip
qemu-gdb target and script
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile15
1 files changed, 13 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 8fe23b7..52190a5 100644
--- a/Makefile
+++ b/Makefile
@@ -138,11 +138,22 @@ bochs : fs.img xv6.img
if [ ! -e .bochsrc ]; then ln -s dot-bochsrc .bochsrc; fi
bochs -q
+# try to generate a unique GDB port
+GDBPORT = $(shell expr `id -u` % 5000 + 25000)
+QEMUOPTS = -smp 2 -hdb fs.img xv6.img
+
qemu: fs.img xv6.img
- qemu -parallel stdio -smp 2 -hdb fs.img xv6.img
+ qemu -parallel mon:stdio $(QEMUOPTS)
qemutty: fs.img xv6.img
- qemu -nographic -smp 2 -hdb fs.img xv6.img
+ qemu -nographic $(QEMUOPTS)
+
+.gdbinit: .gdbinit.tmpl
+ sed "s/localhost:1234/localhost:$(GDBPORT)/" < $^ > $@
+
+qemu-gdb: fs.img xv6.img .gdbinit
+ @echo "*** Now run 'gdb'." 1>&2
+ qemu -parallel mon:stdio $(QEMUOPTS) -s -S -p $(GDBPORT)
# CUT HERE
# prepare dist for students