# HG changeset patch # User sos22@douglas.cl.cam.ac.uk # Date 1108117452 0 # Node ID 87ebc14decdbd667fc02d7aebe70eb2f412afdce # Parent 2c95c08ed8502b32210c377fcc9a173257889a1f bitkeeper revision 1.1178 (420c87ccD2VdHFZVGUqHR4Zd2yI1mg) After a fatal trap, we want to debug whatever caused the trap rather than the trap handler. Fix things up accordingly. Also add some documentation while I'm here. Signed-off-by: sos22@cl.cam.ac.uk. diff -r 2c95c08ed850 -r 87ebc14decdb xen/arch/x86/traps.c --- a/xen/arch/x86/traps.c Fri Feb 11 01:51:41 2005 +0000 +++ b/xen/arch/x86/traps.c Fri Feb 11 10:24:12 2005 +0000 @@ -123,7 +123,7 @@ asmlinkage void fatal_trap(int trapnr, s printk("System shutting down -- need manual reset.\n"); printk("************************************\n"); - debugger_trap_immediate(); + debugger_trap_fatal(trapnr, regs); /* Lock up the console to prevent spurious output from other CPUs. */ console_force_lock(); diff -r 2c95c08ed850 -r 87ebc14decdb xen/include/asm-x86/debugger.h --- a/xen/include/asm-x86/debugger.h Fri Feb 11 01:51:41 2005 +0000 +++ b/xen/include/asm-x86/debugger.h Fri Feb 11 10:24:12 2005 +0000 @@ -17,6 +17,14 @@ * hook to drop into a debug session. It can also be used to hook off * deliberately caused traps (which you then handle and return non-zero) * but really these should be hooked off 'debugger_trap_entry'. + * + * 3. debugger_trap_immediate(): + * Called if we want to drop into a debugger now. This is essentially the + * same as debugger_trap_fatal, except that we use the current register state + * rather than the state which was in effect when we took the trap. + * Essentially, if we're dying because of an unhandled exception, we call + * debugger_trap_fatal; if we're dying because of a panic() we call + * debugger_trap_immediate(). */ #ifndef __X86_DEBUGGER_H__