Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Mark Kettenis <kettenis@chello.nl>
To: eliz@elta.co.il
Cc: gdb@sources.redhat.com
Subject: Re: [RFC] Non-executable stack on SPARC
Date: Sun, 01 Feb 2004 17:48:00 -0000	[thread overview]
Message-ID: <200402011748.i11HmJRR000558@elgar.kettenis.dyndns.org> (raw)
In-Reply-To: <uad49omd7.fsf@elta.co.il> (message from Eli Zaretskii on 27 Jan 2004 09:56:52 +0200)

   Date: 27 Jan 2004 09:56:52 +0200
   From: Eli Zaretskii <eliz@elta.co.il>

   > Date: Mon, 26 Jan 2004 13:42:30 +0100 (CET)
   > From: Mark Kettenis <kettenis@chello.nl>
   > 
   > With my patch,
   > or with the suggestions I made below, GDB will usually still see
   > SIGSEG under normal circumstances.  GDB will only convert such a
   > signal into SIGTRAP if there's a breakpoint inserted at the point
   > where the inferior stopped.

   Where is this last condition tested to be true?  The if clause where
   you wanted to add SIGSEGV doesn't test that, I think.

It's quite a bit further down where this gets resolved; see
infrun.c:1962.  The signal is only converted into SIGTRAP if the
signal can be explained by a breakpoint.

   > As to punting the SIGSEGV to SIGTRAP conversion to the architecture:
   > we could do this in target_wait() or target_wait_hook(), but that
   > would offload it to the target we're running on and not to the
   > architecture.

   So perhaps we need an architecture way to do such conversions.

   My line of thought is that it's IMHO fundamentally wrong to push
   target- or architecture-specific details into the application level of
   GDB, which is what infrun.c is.  infrun.c should deal with high-level
   logic of handling a stopped inferior, it should not IMHO know about
   intricacies of specific targets.

The question is to what extent this is an intricacy of a specific
target.  All targets that use ON_STACK call dummies and have a
non-executable stack will need this adjustment.  More and more systems
gain non-executable stacks.  Hopefully no other ABI's besides SPARC
will require ON_STACK call dummies, but that's probably wishful
thinking.

Anyway, the SIGSEGV would be handled exactly as we already handle
SIGILL and SIGEMT.  Pushing things off to the target/architecture
vector would involve code duplication that I'd rather avoid.

Mark


  reply	other threads:[~2004-02-01 17:48 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-01-25 23:50 Mark Kettenis
2004-01-25 23:59 ` Daniel Jacobowitz
2004-01-26  6:51   ` Eli Zaretskii
2004-01-26  6:51 ` Eli Zaretskii
2004-01-26 12:42   ` Mark Kettenis
2004-01-27  8:16     ` Eli Zaretskii
2004-02-01 17:48       ` Mark Kettenis [this message]
2004-02-01 20:13         ` Eli Zaretskii
2004-02-02 18:37           ` Andrew Cagney
2004-01-26 16:21 ` Andrew Cagney
2004-01-27  8:00   ` Eli Zaretskii
2004-02-01 17:54   ` Mark Kettenis
2004-02-02 18:27     ` Andrew Cagney

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=200402011748.i11HmJRR000558@elgar.kettenis.dyndns.org \
    --to=kettenis@chello.nl \
    --cc=eliz@elta.co.il \
    --cc=gdb@sources.redhat.com \
    /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