From 9b22a6965579ea1867aea291d910c96f386b518b Mon Sep 17 00:00:00 2001 From: Brett Weiland Date: Tue, 24 Aug 2021 14:09:29 -0500 Subject: major backup 8.24.21 --- src/debug/gdbinit.gdb | 9 +++- src/debug/gdbinit.py | 28 +++++++++++++ src/debug/i8086.xml | 113 ++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 149 insertions(+), 1 deletion(-) create mode 100755 src/debug/gdbinit.py create mode 100644 src/debug/i8086.xml (limited to 'src/debug') diff --git a/src/debug/gdbinit.gdb b/src/debug/gdbinit.gdb index 6c0cc28..c890f8d 100644 --- a/src/debug/gdbinit.gdb +++ b/src/debug/gdbinit.gdb @@ -1,4 +1,11 @@ target remote localhost:1234 symbol-file debug/debug_syms.o -break *0x7c00 +hb smp_boot + + + +define cs2bs + print (1 << (5 + $arg0)) +end continue + diff --git a/src/debug/gdbinit.py b/src/debug/gdbinit.py new file mode 100755 index 0000000..75ab5ca --- /dev/null +++ b/src/debug/gdbinit.py @@ -0,0 +1,28 @@ +class NextInstructionAddress(gdb.Command): + """ +Run until Next Instruction address. + +Usage: nia + +Put a temporary breakpoint at the address of the next instruction, and continue. + +Useful to step over int interrupts. + +See also: http://stackoverflow.com/questions/24491516/how-to-step-over-interrupt-calls-when-debugging-a-bootloader-bios-with-gdb-and-q +""" + def __init__(self): + super().__init__( + 'nia', + gdb.COMMAND_BREAKPOINTS, + gdb.COMPLETE_NONE, + False + ) + def invoke(self, arg, from_tty): + frame = gdb.selected_frame() + arch = frame.architecture() + pc = gdb.selected_frame().pc() + length = arch.disassemble(pc)[0]['length'] + gdb.Breakpoint('*' + str(pc + length), temporary = True) + gdb.execute('continue') + +NextInstructionAddress() diff --git a/src/debug/i8086.xml b/src/debug/i8086.xml new file mode 100644 index 0000000..0c91287 --- /dev/null +++ b/src/debug/i8086.xml @@ -0,0 +1,113 @@ + + + + + + i8086 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -- cgit v1.2.3