[INTERRUPTS] Exception handling

This commit is contained in:
2016-11-20 11:26:32 +01:00
parent 0120df249e
commit 5dd42d26ae
11 changed files with 309 additions and 3 deletions

View File

@@ -1,5 +1,6 @@
file sysroot/boot/kernel
target remote localhost:1234
break int_handler_breakpoint
define q
monitor quit
@@ -21,3 +22,17 @@ define reset
monitor system_reset
end
define restore_env
set $name = $arg0
python
registers = ['rax', 'rbx', 'rcx', 'rdx', 'rsi',
'rdi', 'rbp', 'rsp', 'r8', 'r9', 'r10', 'r11',
'r12', 'r13', 'r14', 'r15', 'rip']
values = {}
for r in registers:
values[r] = gdb.parse_and_eval('$name->{}'.format(r))
for r in registers:
gdb.parse_and_eval('${}={}'.format(r, values[r]))
gdb.execute('frame 0')
end