]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc/ptrace: Enable hardware breakpoint upon re-registering
authorAravinda Prasad <aravinda@linux.vnet.ibm.com>
Sun, 4 Nov 2012 22:15:28 +0000 (22:15 +0000)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Thu, 15 Nov 2012 02:01:13 +0000 (13:01 +1100)
commit0e261b14cb9c98af30acb64282272163bee1295a
treed797a07b1a1294e30ebe2fd2aadcbc190966850a
parent2ab75423c82d5866b99ac91d75eaf0e5c45edce0
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>
arch/powerpc/kernel/ptrace.c