aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/ptrace.c
diff options
context:
space:
mode:
authorAravinda Prasad <aravinda@linux.vnet.ibm.com>2012-11-04 17:15:28 -0500
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2012-11-14 21:01:13 -0500
commita53fd61ac2f411745471c1c877d5e072fbbf0e5c (patch)
treed797a07b1a1294e30ebe2fd2aadcbc190966850a /arch/powerpc/kernel/ptrace.c
parent79597be99ac96b1409eb7ae41c336696d7c4f4d9 (diff)
powerpc/ptrace: Enable hardware breakpoint upon re-registering
On powerpc, ptrace will disable hardware breakpoint request once the breakpoint is hit. It is the responsibility of the caller to set it again. However, when the caller sets the hardware breakpoint again using ptrace(PTRACE_SET_DEBUGREG, child_pid, 0, addr), the hardware breakpoint is not enabled. While gdb's approach is to unregister and re-register the hardware breakpoint every time the breakpoint is hit - which is working fine, this could affect other programs trying to re-register hardware breakpoint without unregistering. This patch enables hardware breakpoint if the caller is re-registering. Signed-off-by: Aravinda Prasad <aravinda@linux.vnet.ibm.com> Acked-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/kernel/ptrace.c')
-rw-r--r--arch/powerpc/kernel/ptrace.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/powerpc/kernel/ptrace.c b/arch/powerpc/kernel/ptrace.c
index 817b4116e5bb..c4970004d44d 100644
--- a/arch/powerpc/kernel/ptrace.c
+++ b/arch/powerpc/kernel/ptrace.c
@@ -952,6 +952,10 @@ int ptrace_set_debugreg(struct task_struct *task, unsigned long addr,
952 arch_bp_generic_fields(data & 952 arch_bp_generic_fields(data &
953 (DABR_DATA_WRITE | DABR_DATA_READ), 953 (DABR_DATA_WRITE | DABR_DATA_READ),
954 &attr.bp_type); 954 &attr.bp_type);
955
956 /* Enable breakpoint */
957 attr.disabled = false;
958
955 ret = modify_user_hw_breakpoint(bp, &attr); 959 ret = modify_user_hw_breakpoint(bp, &attr);
956 if (ret) { 960 if (ret) {
957 ptrace_put_breakpoints(task); 961 ptrace_put_breakpoints(task);