From 33e768c8cdbc41138da66505082f324d66dd6700 Mon Sep 17 00:00:00 2001 From: Rex Jolliff Date: Sat, 31 Oct 1998 22:30:08 +0000 Subject: [PATCH] added descriptive text to exception dump svn path=/trunk/; revision=85 --- reactos/ntoskrnl/hal/x86/exp.c | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/reactos/ntoskrnl/hal/x86/exp.c b/reactos/ntoskrnl/hal/x86/exp.c index 7f8326f3aa4..4481a8ecad2 100644 --- a/reactos/ntoskrnl/hal/x86/exp.c +++ b/reactos/ntoskrnl/hal/x86/exp.c @@ -148,6 +148,27 @@ asmlinkage void exception_handler(unsigned int edi, unsigned int cr2; unsigned int i; unsigned int* stack; + static char *TypeStrings[] = + { + "Divide Error", + "Debug Trap", + "Unknown(2)", + "Breakpoint", + "Overflow", + "BOUND range exceeded", + "Invalid Opcode", + "No Math Coprocessor", + "Double Fault", + "Unknown(9)", + "Invalid TSS", + "Segment Not Present", + "Stack Segment Fault", + "General Protection", + "Page Fault", + "Math Fault", + "Alignment Check", + "Machine Check" + }; __asm__("cli\n\t"); @@ -175,7 +196,14 @@ asmlinkage void exception_handler(unsigned int edi, /* * Print out the CPU registers */ - printk("Exception: %d(%x)\n",type,error_code&0xffff); + if (type < 19) + { + printk("%s Exception: %d(%x)\n",TypeStrings[type],type,error_code&0xffff); + } + else + { + printk("Exception: %d(%x)\n",type,error_code&0xffff); + } printk("CS:EIP %x:%x\n",cs&0xffff,eip); printk("DS %x ES %x FS %x GS %x\n",ds&0xffff,es&0xffff,fs&0xffff, gs&0xfff);