[PATCH 1/10] UML - Improve stub debugging
From: Jeff Dike
Date: Sun Oct 30 2005 - 22:47:30 EST
Add some more debugging information when a stub does something unexpected,
usually segfaulting. Now, it dumps out the stub's registers as well as
the signal.
Signed-off-by: Jeff Dike <jdike@xxxxxxxxxxx>
Index: linux-2.6.14-rc2-mm1/arch/um/kernel/skas/process.c
===================================================================
--- linux-2.6.14-rc2-mm1.orig/arch/um/kernel/skas/process.c 2005-10-05 18:37:51.000000000 -0400
+++ linux-2.6.14-rc2-mm1/arch/um/kernel/skas/process.c 2005-10-05 18:50:23.000000000 -0400
@@ -69,6 +69,17 @@
if((n < 0) || !WIFSTOPPED(status) ||
(WSTOPSIG(status) != SIGUSR1 && WSTOPSIG(status) != SIGTRAP)){
+ unsigned long regs[FRAME_SIZE];
+ if(ptrace(PTRACE_GETREGS, pid, 0, regs) < 0)
+ printk("Failed to get registers from stub, "
+ "errno = %d\n", errno);
+ else {
+ int i;
+
+ printk("Stub registers -\n");
+ for(i = 0; i < FRAME_SIZE; i++)
+ printk("\t%d - %lx\n", i, regs[i]);
+ }
panic("%s : failed to wait for SIGUSR1/SIGTRAP, "
"pid = %d, n = %d, errno = %d, status = 0x%x\n",
fname, pid, n, errno, status);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/