All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Engraf <david.engraf@sysgo.com>
To: linux-sh@vger.kernel.org
Subject: [PATCH] sh: Fix ptrace hw_breakpoint handling
Date: Wed, 23 Mar 2011 11:35:42 +0000	[thread overview]
Message-ID: <4D89DB0E.5030508@sysgo.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 470 bytes --]

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.

Signed-off-by: David Engraf <david.engraf@sysgo.com>


[-- Attachment #2: sh-fix-hw-breakpoint-usage.patch --]
[-- Type: text/x-diff, Size: 443 bytes --]

diff --git a/arch/sh/kernel/ptrace_32.c b/arch/sh/kernel/ptrace_32.c
index 90a15d2..e3bd670 100644
--- a/arch/sh/kernel/ptrace_32.c
+++ b/arch/sh/kernel/ptrace_32.c
@@ -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;

             reply	other threads:[~2011-03-23 11:35 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-23 11:35 David Engraf [this message]
2011-03-23 13:25 ` [PATCH] sh: Fix ptrace hw_breakpoint handling Paul Mundt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4D89DB0E.5030508@sysgo.com \
    --to=david.engraf@sysgo.com \
    --cc=linux-sh@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.