Print the error code for unhandled exceptions too, to ease debugging. Also use the symbolic name for the #PF vector. Signed-off-by: Mathias Krause --- lib/x86/desc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/x86/desc.c b/lib/x86/desc.c index fca37b9a5cee..f4cdfbc92c56 100644 --- a/lib/x86/desc.c +++ b/lib/x86/desc.c @@ -141,10 +141,10 @@ const char* exception_mnemonic(int vector) void unhandled_exception(struct ex_regs *regs, bool cpu) { - printf("Unhandled %sexception %ld %s at ip %016lx\n", + printf("Unhandled %sexception %ld %s(%lx) at ip %016lx\n", cpu ? "cpu " : "", regs->vector, - exception_mnemonic(regs->vector), regs->rip); - if (regs->vector == 14) + exception_mnemonic(regs->vector), regs->error_code, regs->rip); + if (regs->vector == PF_VECTOR) printf("PF at %#lx addr %#lx\n", regs->rip, read_cr2()); printf("error_code=%04lx rflags=%08lx cs=%08lx\n" -- 2.30.2