diff --git a/.gitignore b/.gitignore index 7cb136b..da2de2d 100644 --- a/.gitignore +++ b/.gitignore @@ -2,7 +2,6 @@ /build* *.bak tags -.gdbinit popcorn.log *.o *.a diff --git a/assets/debugging/popcorn.elf-gdb.py b/assets/debugging/popcorn.elf-gdb.py new file mode 100644 index 0000000..6ebd4d5 --- /dev/null +++ b/assets/debugging/popcorn.elf-gdb.py @@ -0,0 +1,4 @@ +import time +time.sleep(2.5) +gdb.execute("target remote :1234") +gdb.execute("set waiting = false") diff --git a/scripts/templates/build.ninja.j2 b/scripts/templates/build.ninja.j2 index 309fb6f..f421b79 100644 --- a/scripts/templates/build.ninja.j2 +++ b/scripts/templates/build.ninja.j2 @@ -158,6 +158,9 @@ build $builddir/flash.img : cp $srcroot/assets/ovmf/x64/OVMF.fd build $builddir/popcorn.elf | $builddir/popcorn.elf.debug : strip $builddir/host/popcorn.elf name = kernel +build $builddir/popcorn.elf-gdb.py : cp ${srcroot}/assets/debugging/popcorn.elf-gdb.py + name = kernel debug python scripts + build $builddir/fatroot/popcorn.elf : cp $builddir/popcorn.elf name = kernel to FAT image