diff options
author | Jesper Nilsson <jesper.nilsson@axis.com> | 2010-08-04 17:42:43 +0200 |
---|---|---|
committer | Jesper Nilsson <jesper.nilsson@axis.com> | 2010-08-04 18:28:48 +0200 |
commit | b4e8a1813c7d65a7c28a3536da08444c21f2c37b (patch) | |
tree | 7b310dfaf31e41d6ff37a0cef2d271c1fca8003e /arch/cris/mm | |
parent | 028c1f6817c1ef49c61641dc1ae6c629e5bb32df (diff) |
CRIS: Add config for pausing a seg-faulting process
Put it on a wait queue, so we can attach gdb to the process
to debug it instead of just killing it.
Signed-off-by: Jesper Nilsson <jesper.nilsson@axis.com>
Diffstat (limited to 'arch/cris/mm')
-rw-r--r-- | arch/cris/mm/fault.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/arch/cris/mm/fault.c b/arch/cris/mm/fault.c index a2b4c0b8f0f..7705cd7cef3 100644 --- a/arch/cris/mm/fault.c +++ b/arch/cris/mm/fault.c @@ -7,6 +7,7 @@ #include <linux/mm.h> #include <linux/interrupt.h> #include <linux/module.h> +#include <linux/wait.h> #include <asm/uaccess.h> extern int find_fixup_code(struct pt_regs *); @@ -190,14 +191,20 @@ do_page_fault(unsigned long address, struct pt_regs *regs, /* User mode accesses just cause a SIGSEGV */ if (user_mode(regs)) { + printk(KERN_NOTICE "%s (pid %d) segfaults for page " + "address %08lx at pc %08lx\n", + tsk->comm, tsk->pid, + address, instruction_pointer(regs)); +#ifdef CONFIG_NO_SEGFAULT_TERMINATION + DECLARE_WAIT_QUEUE_HEAD(wq); + wait_event_interruptible(wq, 0 == 1); +#else info.si_signo = SIGSEGV; info.si_errno = 0; /* info.si_code has been set above */ info.si_addr = (void *)address; force_sig_info(SIGSEGV, &info, tsk); - printk(KERN_NOTICE "%s (pid %d) segfaults for page " - "address %08lx at pc %08lx\n", - tsk->comm, tsk->pid, address, instruction_pointer(regs)); +#endif return; } |