Skip to contentSkip to conversation

sh: Fix ptrace hw_breakpoint handling

PATCH Applied David Engraf 2 participants 2 messages Mar 23, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sh: Fix ptrace hw_breakpoint handling

sh: Fix ptrace hw_breakpoint handling.

Since commit 34d0b5af50a063cded842716633501b38ff815fb it is no longer possible to debug an application using singlestep. The old commit converted singlestep handling via ptrace to hw_breakpoints. The hw_breakpoint is disabled when an event is triggered and not re-enabled again. This patch re-enables the existing hw_breakpoint before the existing breakpoint is reused.

arch/sh/kernel/ptrace_32.c +2 -0
index 90a15d2..e3bd670 100644
@@ -101,6 +101,8 @@ static int set_single_step(struct task_struct *tsk, unsigned long addr)
 
 		attr = bp->attr;
 		attr.bp_addr = addr;
+		/* reenable breakpoint */
+		attr.disabled = false;
 		err = modify_user_hw_breakpoint(bp, &attr);
 		if (unlikely(err))
 			return err;
Applied
#1 lore raw
Quoted 11 lines · David Engraf

sh: Fix ptrace hw_breakpoint handling.

Since commit 34d0b5af50a063cded842716633501b38ff815fb it is no longer possible to debug an application using singlestep. The old commit converted singlestep handling via ptrace to hw_breakpoints. The hw_breakpoint is disabled when an event is triggered and not re-enabled again. This patch re-enables the existing hw_breakpoint before the existing breakpoint is reused.

Applied, thanks.