aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/kernel/ptrace.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/ptrace.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/ptrace.c')
-rw-r--r--arch/arm/kernel/ptrace.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/arch/arm/kernel/ptrace.c b/arch/arm/kernel/ptrace.c
index 9254ba2f46fc..e594b84cca83 100644
--- a/arch/arm/kernel/ptrace.c
+++ b/arch/arm/kernel/ptrace.c
@@ -457,13 +457,10 @@ void ptrace_cancel_bpt(struct task_struct *child)
457 457
458/* 458/*
459 * Called by kernel/ptrace.c when detaching.. 459 * Called by kernel/ptrace.c when detaching..
460 *
461 * Make sure the single step bit is not set.
462 */ 460 */
463void ptrace_disable(struct task_struct *child) 461void ptrace_disable(struct task_struct *child)
464{ 462{
465 child->ptrace &= ~PT_SINGLESTEP; 463 single_step_disable(child);
466 ptrace_cancel_bpt(child);
467} 464}
468 465
469/* 466/*
@@ -712,9 +709,7 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
712 else 709 else
713 clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE); 710 clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
714 child->exit_code = data; 711 child->exit_code = data;
715 /* make sure single-step breakpoint is gone. */ 712 single_step_disable(child);
716 child->ptrace &= ~PT_SINGLESTEP;
717 ptrace_cancel_bpt(child);
718 wake_up_process(child); 713 wake_up_process(child);
719 ret = 0; 714 ret = 0;
720 break; 715 break;
@@ -725,9 +720,7 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
725 * exit. 720 * exit.
726 */ 721 */
727 case PTRACE_KILL: 722 case PTRACE_KILL:
728 /* make sure single-step breakpoint is gone. */ 723 single_step_disable(child);
729 child->ptrace &= ~PT_SINGLESTEP;
730 ptrace_cancel_bpt(child);
731 if (child->exit_state != EXIT_ZOMBIE) { 724 if (child->exit_state != EXIT_ZOMBIE) {
732 child->exit_code = SIGKILL; 725 child->exit_code = SIGKILL;
733 wake_up_process(child); 726 wake_up_process(child);
@@ -742,7 +735,7 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
742 ret = -EIO; 735 ret = -EIO;
743 if (!valid_signal(data)) 736 if (!valid_signal(data))
744 break; 737 break;
745 child->ptrace |= PT_SINGLESTEP; 738 single_step_enable(child);
746 clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE); 739 clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
747 child->exit_code = data; 740 child->exit_code = data;
748 /* give it a chance to run. */ 741 /* give it a chance to run. */