Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Andrew Cagney <cagney@gnu.org>
To: Mark Kettenis <kettenis@chello.nl>
Cc: gdb@sources.redhat.com
Subject: Re: [RFC] Non-executable stack on SPARC
Date: Mon, 26 Jan 2004 16:21:00 -0000	[thread overview]
Message-ID: <40153E6D.2050805@gnu.org> (raw)
In-Reply-To: <200401252350.i0PNoB1O021806@elgar.kettenis.dyndns.org>

> A while ago, I established that getting inferior function calls on
> SPARC working with a non-executable stack is remarkably simple.  Just
> acknowledging that breakpoint instructions may cause SIGSEGV, as per
> the attached patch, is enough.  However, some people were afraid that
> blindly applying this patch might cause some problems on other
> targets.  I think there are two alternatives:

I thought the original patch was already committed? :-(

> 1. Only check for SIGSEGV if the target in question uses "ON_STACK"
>    for its call_dummy_location.

A more robust check would be to confirm that a breakpoint is at that 
address (naturally ignoring decr pc after break :-).  However, does 
later code check exactly that - confirming that the breakpoint explains 
the stop reason?

> 2. Add a new method to the architecture vector to check whether a
>    particular signal may have been the result of a breakpoint
>    instruction.  Suggested name & signature:
> 
>    int breakpoint_signal_p (struct gdbarch *gdbarch, int signal)

For this, that would be wrong.  The target, in combination with the 
breakpoint code, determines if a breakpoint leads to a sigsegv.  Ex: 
breakpoint code uses the target to unmap code segment, the target 
indicates that a segment isn't executable, ...

> Preferences?
> 
> I'd like to get this sorted before 6.1, since OpenBSD/sparc has a
> non-executable stack, and some people are running SPARC Solaris with a
> non-executable stack too.

Assuming that for VLIW gdb replaces the entire instruction bundle with a 
breakpoint, a breakpoint instruction can only ever generate a sigtrap 
(et.al.) (if executed) or sigsegv (if not accessible) so provided there 
is a breakpoint at the PC I don't think there is any possability of 
confusion (but again ignore decr pc after break :-).

Andrew



  parent reply	other threads:[~2004-01-26 16:21 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
2004-02-01 20:13         ` Eli Zaretskii
2004-02-02 18:37           ` Andrew Cagney
2004-01-26 16:21 ` Andrew Cagney [this message]
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=40153E6D.2050805@gnu.org \
    --to=cagney@gnu.org \
    --cc=gdb@sources.redhat.com \
    --cc=kettenis@chello.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