From: will.deacon@arm.com (Will Deacon)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2] ARM: ptrace: remove single-step emulation code
Date: Thu, 10 Feb 2011 11:59:09 -0000 [thread overview]
Message-ID: <002c01cbc919$ed44b720$c7ce2560$@deacon@arm.com> (raw)
In-Reply-To: <alpine.LFD.2.00.1102091427200.14920@xanadu.home>
> > PTRACE_SINGLESTEP is a ptrace request designed to offer single-stepping
> > support to userspace when the underlying architecture has hardware
> > support for this operation.
> >
> > On ARM, we set arch_has_single_step() to 1 and attempt to emulate hardware
> > single-stepping by disassembling the current instruction to determine the
> > next pc and placing a software breakpoint on that location.
> >
> > Unfortunately this has the following problems:
> >
> > 1.) Only a subset of ARMv7 instructions are supported
> > 2.) Thumb-2 is unsupported
> > 3.) The code is not SMP safe
> >
> > We could try to fix this code, but it turns out that because of the above
> > issues it is rarely used in practice. GDB, for example, uses PTRACE_POKETEXT
> > and PTRACE_PEEKTEXT to manage breakpoints itself and does not require any
> > kernel assistance.
> >
> > This patch removes the single-step emulation code from ptrace meaning that
> > the PTRACE_SINGLESTEP request will return -EIO on ARM. Portable code must
> > check the return value from a ptrace call and handle the failure gracefully.
> >
> > Signed-off-by: Will Deacon <will.deacon@arm.com>
>
> Acked-by: Nicolas Pitre <nicolas.pitre@linaro.org>
Thanks Nicolas. I'll leave this over the weekend to see if it
attracts further comment before putting it into the patch system.
Cheers,
Will
prev parent reply other threads:[~2011-02-10 11:59 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-09 10:42 [PATCH v2] ARM: ptrace: remove single-step emulation code Will Deacon
2011-02-09 19:28 ` Nicolas Pitre
2011-02-10 11:59 ` Will Deacon [this message]
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='002c01cbc919$ed44b720$c7ce2560$@deacon@arm.com' \
--to=will.deacon@arm.com \
--cc=linux-arm-kernel@lists.infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).