Skip to contentSkip to conversation

print panic message before trapping to debugger

PATCH New Hollis Blanchard 1 participant 1 message Mar 14, 2006

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 print panic message before trapping to debugger

I've found it useful to display the panic message *before* dropping into the debugger. Once there it may be very difficult to find the original message, and often a debugger isn't even needed if you can see what panicked.

# HG changeset patch
# User hollisb@basalt
# Node ID c6267fda4f4c899dbf0f23191a658d7f18ca7c3c # Parent 686cd624618cead274ea9850f0997d41c6134283 print panic message before trapping to debugger

xen/drivers/char/console.c +2 -2
diff -r 686cd624618c -r c6267fda4f4c xen/drivers/char/console.c
@@ -683,8 +683,6 @@ void panic(const char *fmt, ...)
     (void)vsnprintf(buf, sizeof(buf), fmt, args);
     va_end(args);
 
-    debugger_trap_immediate();
-
     /* Spit out multiline message in one go. */
     spin_lock_irqsave(&lock, flags);
     printk("\n****************************************\n");
@@ -694,6 +692,8 @@ void panic(const char *fmt, ...)
     printk("Reboot in five seconds...\n");
     spin_unlock_irqrestore(&lock, flags);
 
+    debugger_trap_immediate();
+
     watchdog_disable();
     mdelay(5000);
     machine_restart(0);
Signature · 2 lines
Hollis Blanchard
IBM Linux Technology Center