Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Maciej W. Rozycki" <macro@codesourcery.com>
To: Mark Kettenis <mark.kettenis@xs4all.nl>
Cc: Joel Brobecker <brobecker@adacore.com>, <gdb-patches@sourceware.org>
Subject: Re: [RFA 1/2] mips: Switch inferior function calls to ON_STACK method.
Date: Tue, 08 May 2012 15:08:00 -0000	[thread overview]
Message-ID: <alpine.DEB.1.10.1205081550050.18334@tp.orcam.me.uk> (raw)
In-Reply-To: <201205051144.q45Bitv4006357@glazunov.sibelius.xs4all.nl>

On Sat, 5 May 2012, Mark Kettenis wrote:

> >  As per my suggestion I think it makes sense to document any peculiarities 
> > of this specific implementation here as well (in this case the safety to 
> > use with non-executable stack).
> 
> The non-executable stack issue really isn't specific to this
> implementation though.  On OpenBSD the stack is non-executable on all
> architectures where it is possible (including through a clever trick
> on i386).  I haven't tried ON_STACK on all of them, but it works on
> all of them.

 After some thinking I realised that the reliance on signal delivery to 
work properly to trap non-executable stack may actually be a problem for 
bare-iron targets.  I'd expect TLB exceptions not to be forwarded up the 
debug stack in a typical JTAG debugging scenario -- it's not obvious how 
they should be mapped to signals even, the low-level hardware has no way 
to classify them and not all have to be fatal; in about the most 
sophisticated scenario (which is not unlikely, I did that many times 
myself) consider debugging Linux (the kernel) through JTAG.

 Instead you'll have the joy of running or stepping through the exception 
handler (from the probe's point of view it's really no different to an 
ordinary jump; in the hardware stepping mode the processor will just trap 
at the exception handler's entry point instead of the intended breakpoint 
location) on the target and your device being debugged may go astray, e.g. 
panic blinking LEDs or trigger hardware reset.

 Given that this feature in the MIPS case comes from the SmartMIPS ASE 
(that as noted earlier has been designed with smart cards in mind) I think 
such a scenario is actually not unlikely, even though, as I say, I have 
never had an opportunity to deal with a MIPS processor that had this 
non-executable stack feature implemented.

  Maciej


  reply	other threads:[~2012-05-08 15:08 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-03 19:03 Getting rid of AT_SYMBOL inferior call method Joel Brobecker
2012-05-03 19:03 ` [RFA 1/2] mips: Switch inferior function calls to ON_STACK method Joel Brobecker
2012-05-03 21:09   ` Maciej W. Rozycki
2012-05-03 21:50     ` Joel Brobecker
2012-05-03 23:29       ` Maciej W. Rozycki
2012-05-04 20:58         ` Joel Brobecker
2012-05-04 21:19           ` Mark Kettenis
2012-05-04 23:25             ` Maciej W. Rozycki
2012-05-05 11:45               ` Mark Kettenis
2012-05-08 15:08                 ` Maciej W. Rozycki [this message]
2012-05-08 16:06                   ` Joel Brobecker
2012-05-08 20:26                     ` Maciej W. Rozycki
2012-05-08 20:43                       ` Joel Brobecker
2012-05-08 22:08                         ` Joel Brobecker
2012-05-09  7:32                           ` Maciej W. Rozycki
2012-05-09  8:24                             ` Mark Kettenis
2012-05-09  9:14                               ` Maciej W. Rozycki
2012-05-09 16:08                                 ` Tom Tromey
2012-05-09 14:35                               ` Joel Brobecker
2012-05-14  9:44                                 ` Maciej W. Rozycki
2012-05-14 15:01                                   ` Joel Brobecker
2012-05-14 16:48                                     ` Maciej W. Rozycki
2012-06-11 10:14                                   ` Maciej W. Rozycki
2012-05-09  6:21                         ` Maciej W. Rozycki
2012-05-04 22:41           ` Maciej W. Rozycki
2012-05-04 21:34     ` Mark Kettenis
2012-05-05  1:31       ` Maciej W. Rozycki
2012-05-03 21:44   ` Mark Kettenis
2012-05-03 21:58     ` Joel Brobecker
2012-05-04  2:11       ` Yao Qi
2012-05-03 22:03   ` Joel Brobecker
2012-05-03 19:03 ` [commit 2/2] Remove AT_SYMBOL Joel Brobecker
2012-05-09 14:37   ` Joel Brobecker

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=alpine.DEB.1.10.1205081550050.18334@tp.orcam.me.uk \
    --to=macro@codesourcery.com \
    --cc=brobecker@adacore.com \
    --cc=gdb-patches@sourceware.org \
    --cc=mark.kettenis@xs4all.nl \
    /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