diff options
author | Dave Kleikamp <shaggy@linux.vnet.ibm.com> | 2009-07-08 09:46:18 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2009-07-15 03:41:45 -0400 |
commit | 28477fb1ed1a00c67b382ae8f37f35708e3bf5dd (patch) | |
tree | 7dda6fa6262aa362175ffdb976da01d9aa7e0e68 | |
parent | e9e961c9a818a2f24711af493b907a8e40a69efc (diff) |
powerpc: Fix booke user_disable_single_step()
On booke processors, gdb is seeing spurious SIGTRAPs when setting a
watchpoint.
user_disable_single_step() simply quits when the DAC is non-zero. It should
be clearing the DBCR0_IC and DBCR0_BT bits from the dbcr0 register and
TIF_SINGLESTEP from the thread flag.
Signed-off-by: Dave Kleikamp <shaggy@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
-rw-r--r-- | arch/powerpc/kernel/ptrace.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/arch/powerpc/kernel/ptrace.c b/arch/powerpc/kernel/ptrace.c index 9fa2c7dcd05a..ef149880c145 100644 --- a/arch/powerpc/kernel/ptrace.c +++ b/arch/powerpc/kernel/ptrace.c | |||
@@ -736,15 +736,16 @@ void user_disable_single_step(struct task_struct *task) | |||
736 | { | 736 | { |
737 | struct pt_regs *regs = task->thread.regs; | 737 | struct pt_regs *regs = task->thread.regs; |
738 | 738 | ||
739 | |||
740 | #if defined(CONFIG_BOOKE) | ||
741 | /* If DAC then do not single step, skip */ | ||
742 | if (task->thread.dabr) | ||
743 | return; | ||
744 | #endif | ||
745 | |||
746 | if (regs != NULL) { | 739 | if (regs != NULL) { |
747 | #if defined(CONFIG_40x) || defined(CONFIG_BOOKE) | 740 | #if defined(CONFIG_BOOKE) |
741 | /* If DAC don't clear DBCRO_IDM or MSR_DE */ | ||
742 | if (task->thread.dabr) | ||
743 | task->thread.dbcr0 &= ~(DBCR0_IC | DBCR0_BT); | ||
744 | else { | ||
745 | task->thread.dbcr0 &= ~(DBCR0_IC | DBCR0_BT | DBCR0_IDM); | ||
746 | regs->msr &= ~MSR_DE; | ||
747 | } | ||
748 | #elif defined(CONFIG_40x) | ||
748 | task->thread.dbcr0 &= ~(DBCR0_IC | DBCR0_BT | DBCR0_IDM); | 749 | task->thread.dbcr0 &= ~(DBCR0_IC | DBCR0_BT | DBCR0_IDM); |
749 | regs->msr &= ~MSR_DE; | 750 | regs->msr &= ~MSR_DE; |
750 | #else | 751 | #else |