diff --git a/Makefile.example b/Makefile.example index 1614b2ff..554c241d 100644 --- a/Makefile.example +++ b/Makefile.example @@ -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 diff --git a/script.gdb b/script.gdb new file mode 100644 index 00000000..644bde95 --- /dev/null +++ b/script.gdb @@ -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