diff options
author | Jeff Dike <jdike@addtoit.com> | 2005-11-07 03:58:45 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-11-07 10:53:30 -0500 |
commit | 953206858070e5921b9d5931c293ec983a6790cb (patch) | |
tree | 9caf1d094ee6f001856d5c433b3c60f309c9da98 /arch | |
parent | d9b5444eeb3a663ca4a625878b1421c9e9b18e8b (diff) |
[PATCH] uml: improve stub debugging
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@addtoit.com>
Cc: Paolo Giarrusso <blaisorblade@yahoo.it>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/um/kernel/skas/process.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/arch/um/kernel/skas/process.c b/arch/um/kernel/skas/process.c index 5cd0e9929789..42f2da687dc8 100644 --- a/arch/um/kernel/skas/process.c +++ b/arch/um/kernel/skas/process.c | |||
@@ -69,6 +69,17 @@ void wait_stub_done(int pid, int sig, char * fname) | |||
69 | 69 | ||
70 | if((n < 0) || !WIFSTOPPED(status) || | 70 | if((n < 0) || !WIFSTOPPED(status) || |
71 | (WSTOPSIG(status) != SIGUSR1 && WSTOPSIG(status) != SIGTRAP)){ | 71 | (WSTOPSIG(status) != SIGUSR1 && WSTOPSIG(status) != SIGTRAP)){ |
72 | unsigned long regs[FRAME_SIZE]; | ||
73 | if(ptrace(PTRACE_GETREGS, pid, 0, regs) < 0) | ||
74 | printk("Failed to get registers from stub, " | ||
75 | "errno = %d\n", errno); | ||
76 | else { | ||
77 | int i; | ||
78 | |||
79 | printk("Stub registers -\n"); | ||
80 | for(i = 0; i < FRAME_SIZE; i++) | ||
81 | printk("\t%d - %lx\n", i, regs[i]); | ||
82 | } | ||
72 | panic("%s : failed to wait for SIGUSR1/SIGTRAP, " | 83 | panic("%s : failed to wait for SIGUSR1/SIGTRAP, " |
73 | "pid = %d, n = %d, errno = %d, status = 0x%x\n", | 84 | "pid = %d, n = %d, errno = %d, status = 0x%x\n", |
74 | fname, pid, n, errno, status); | 85 | fname, pid, n, errno, status); |