aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/kernel/signal.c
diff options
context:
space:
mode:
authorRussell King <rmk@dyn-67.arm.linux.org.uk>2007-03-04 04:50:28 -0500
committerRussell King <rmk+kernel@arm.linux.org.uk>2007-04-21 15:34:58 -0400
commitb2a0d36fde90fa9dd20b7dde21dbcff09b130b38 (patch)
tree354fe85244f011e17e1c96243f5f7925ba16b6b6 /arch/arm/kernel/signal.c
parent0f0a00beb80624a446ba7c0152cd171008eeab2e (diff)
[ARM] ptrace: clean up single stepping support
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/kernel/signal.c')
-rw-r--r--arch/arm/kernel/signal.c22
1 files changed, 5 insertions, 17 deletions
diff --git a/arch/arm/kernel/signal.c b/arch/arm/kernel/signal.c
index 3843d3bab2dd..54cdf1aeefc3 100644
--- a/arch/arm/kernel/signal.c
+++ b/arch/arm/kernel/signal.c
@@ -9,7 +9,6 @@
9 */ 9 */
10#include <linux/errno.h> 10#include <linux/errno.h>
11#include <linux/signal.h> 11#include <linux/signal.h>
12#include <linux/ptrace.h>
13#include <linux/personality.h> 12#include <linux/personality.h>
14#include <linux/freezer.h> 13#include <linux/freezer.h>
15 14
@@ -285,11 +284,7 @@ asmlinkage int sys_sigreturn(struct pt_regs *regs)
285 if (restore_sigframe(regs, frame)) 284 if (restore_sigframe(regs, frame))
286 goto badframe; 285 goto badframe;
287 286
288 /* Send SIGTRAP if we're single-stepping */ 287 single_step_trap(current);
289 if (current->ptrace & PT_SINGLESTEP) {
290 ptrace_cancel_bpt(current);
291 send_sig(SIGTRAP, current, 1);
292 }
293 288
294 return regs->ARM_r0; 289 return regs->ARM_r0;
295 290
@@ -324,11 +319,7 @@ asmlinkage int sys_rt_sigreturn(struct pt_regs *regs)
324 if (do_sigaltstack(&frame->sig.uc.uc_stack, NULL, regs->ARM_sp) == -EFAULT) 319 if (do_sigaltstack(&frame->sig.uc.uc_stack, NULL, regs->ARM_sp) == -EFAULT)
325 goto badframe; 320 goto badframe;
326 321
327 /* Send SIGTRAP if we're single-stepping */ 322 single_step_trap(current);
328 if (current->ptrace & PT_SINGLESTEP) {
329 ptrace_cancel_bpt(current);
330 send_sig(SIGTRAP, current, 1);
331 }
332 323
333 return regs->ARM_r0; 324 return regs->ARM_r0;
334 325
@@ -644,14 +635,12 @@ static int do_signal(sigset_t *oldset, struct pt_regs *regs, int syscall)
644 if (try_to_freeze()) 635 if (try_to_freeze())
645 goto no_signal; 636 goto no_signal;
646 637
647 if (current->ptrace & PT_SINGLESTEP) 638 single_step_clear(current);
648 ptrace_cancel_bpt(current);
649 639
650 signr = get_signal_to_deliver(&info, &ka, regs, NULL); 640 signr = get_signal_to_deliver(&info, &ka, regs, NULL);
651 if (signr > 0) { 641 if (signr > 0) {
652 handle_signal(signr, &ka, &info, oldset, regs, syscall); 642 handle_signal(signr, &ka, &info, oldset, regs, syscall);
653 if (current->ptrace & PT_SINGLESTEP) 643 single_step_set(current);
654 ptrace_set_bpt(current);
655 return 1; 644 return 1;
656 } 645 }
657 646
@@ -705,8 +694,7 @@ static int do_signal(sigset_t *oldset, struct pt_regs *regs, int syscall)
705 restart_syscall(regs); 694 restart_syscall(regs);
706 } 695 }
707 } 696 }
708 if (current->ptrace & PT_SINGLESTEP) 697 single_step_set(current);
709 ptrace_set_bpt(current);
710 return 0; 698 return 0;
711} 699}
712 700