New Makefile target: qemudbg
This target starts qemu in Debug-Mode and GDB. There is a GDB-Script file script.gdb which is extensible to match your debugging needs.
This commit is contained in:
parent
3a0e42eef1
commit
58115dc000
2 changed files with 16 additions and 0 deletions
|
@ -19,6 +19,8 @@ RANLIB_FOR_TARGET=ranlib
|
|||
STRIP_FOR_TARGET=strip
|
||||
READELF_FOR_TARGET=readelf
|
||||
NASM = nasm
|
||||
EMU=qemu
|
||||
GDB=gdb
|
||||
|
||||
MAKE = make
|
||||
NASMFLAGS = -felf32 -g
|
||||
|
@ -71,6 +73,13 @@ $(NAME).elf:
|
|||
qemu: newlib tools $(NAME).elf
|
||||
qemu -smp 2 -net nic,model=rtl8139 -net user,hostfwd=tcp::12345-:7 -net dump -kernel metalsvm.elf -initrd tools/initrd.img
|
||||
|
||||
qemudbg: newlib tools $(NAME).elf
|
||||
qemu -S -s -smp 2 -net nic,model=rtl8139 -net user,hostfwd=tcp::12345-:7 -net dump -kernel metalsvm.elf -initrd tools/initrd.img
|
||||
|
||||
gdb: $(NAME).elf
|
||||
make qemudbg > /dev/null &
|
||||
$(GDB) -x script.gdb
|
||||
|
||||
clean:
|
||||
$Q$(RM) $(NAME).elf $(NAME).sym *~
|
||||
$Q$(MAKE) -C tools clean
|
||||
|
|
7
script.gdb
Normal file
7
script.gdb
Normal file
|
@ -0,0 +1,7 @@
|
|||
# Constant part of the script
|
||||
symbol-file metalsvm.sym
|
||||
target remote localhost:1234
|
||||
|
||||
# Configure breakpoints and everything as you wish here.
|
||||
break main
|
||||
continue
|
Loading…
Add table
Reference in a new issue