Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <drow@false.org>
To: Mark Kettenis <mark.kettenis@xs4all.nl>
Cc: gdb-patches@sources.redhat.com
Subject: Re: RFC: Add a mechanism to stop backtraces using dwarf2 frame information
Date: Fri, 08 Apr 2005 12:10:00 -0000	[thread overview]
Message-ID: <20050408121024.GA32446@nevyn.them.org> (raw)
In-Reply-To: <200503042111.j24LBNYD003249@elgar.sibelius.xs4all.nl>

On Fri, Mar 04, 2005 at 10:11:23PM +0100, Mark Kettenis wrote:
>    Date: Wed, 2 Mar 2005 17:15:53 -0500
>    From: Daniel Jacobowitz <drow@false.org>
> 
>    I'd like opinions on this patch.
> 
> I like it ;-).
> 
>    There are some times when it's just not possible to backtrace through
>    hand-written assembly.  This can be true of anything which will never
>    return, and is often true of functions which are called or return in
>    a "unique" manner - the specific case that prompted me to write this was a
>    processor exception handler.  In this instance there is a theoretical return
>    path, but it will almost always lead out of the binary into some other
>    running code, so backtracing through it isn't useful.  Trying to apply
>    normal unwinding just produces garbage.
> 
> Wouldn't it be useful for process startup code of UNIX processes
> (crt0/crt1) and thread startup code too?

Yes, absolutely.

>    I picked an idiom which GDB currently doesn't handle to mean "no backtrace
>    information is available": DW_CFA_undefined in the return address column.
>    Seems a plausible interpretation to me.  This idiom implies that not only
>    is no DWARF unwinding data available, but also that more conventional means
>    of unwinding are unlikely to succeed.  Obviously, if GDB has an earlier
>    sniffer which recognizes the particular location, we can continue
>    backtracing.  This just stops us from falling back to the prologue
>    analyzers.
> 
> So people should take a bit more care in stacking the sniffers;
> nothing new there.
> 
>    What do you think of the idea?  The patch?  If both seem OK, I'll propose
>    the idiom to the DWARF working group.  It doesn't require any changes to the
>    standard, but it might be nice to document it explicitly.
> 
> Could you drop a note to the dwarf working group mailing list to get a
> bit more opinions about this "abuse" of the standard before checking
> this patch in?

I did that.  Andrew replied that he had suggested it previously; Todd
Allen replied that it seemed like a good idea.  Andrew also suggested
an undefined CFA as a barrier, but the implementation of that will look
a bit different; so, Andrew, if you would like an undefined CFA to have
the same effect, feel free to implement it :-)

I've checked in the patch now.

-- 
Daniel Jacobowitz
CodeSourcery, LLC


      reply	other threads:[~2005-04-08 12:10 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-02 22:16 Daniel Jacobowitz
2005-03-04 16:10 ` Daniel Jacobowitz
2005-03-04 21:11 ` Mark Kettenis
2005-04-08 12:10   ` Daniel Jacobowitz [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=20050408121024.GA32446@nevyn.them.org \
    --to=drow@false.org \
    --cc=gdb-patches@sources.redhat.com \
    --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