Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <drow@false.org>
To: Mark Kettenis <mark.kettenis@xs4all.nl>
Cc: gdb@sourceware.org, libc-alpha@sourceware.org
Subject: Re: Notes on a frame_unwind_address_in_block problem
Date: Tue, 18 Jul 2006 18:50:00 -0000	[thread overview]
Message-ID: <20060718183910.GB17864@nevyn.them.org> (raw)
In-Reply-To: <200607132020.k6DKKCSB023812@elgar.sibelius.xs4all.nl>

On Thu, Jul 13, 2006 at 10:20:12PM +0200, Mark Kettenis wrote:
> > Date: Thu, 6 Jul 2006 18:21:57 -0400
> > From: Daniel Jacobowitz <drow@false.org>
> > II. 32-bit.
> > 
> > For 32-bit, though, it gets even more interesting.  Here's where $SUBJECT
> > comes into play.  I have a loaded vDSO (virtual shared object), which
> > exports __kernel_sigreturn.  This points at the first instruction of the
> > trampoline, i.e. one byte after the start of the dwarf2 FDE.  When I am
> > stopped in the signal handler, frame_unwind_address_in_block decides to
> > subtract one.  That points before the symbol, so the frame ID's function
> > ends up being NULL; there's no symbol covering that address.  Then when we
> > arrive at the signal trampoline during "finish", we no longer subtract one
> > - since we're at an executable instruction in the topmost frame - and thus
> > we do find the symbol.  The two frame IDs don't compare equal.
> 
> Ouch.  So in the end having the signal trampoline call the signal
> handler *is* a better design.

Um, I guess it depends what your goal is.  Given the rest of the system
architecture, for GNU/Linux, that'd waste a call instruction and some
code space; not much difference really.

> > Another solution would be to use the FDE start address as the code address
> > for dwarf2 signal frame IDs, instead of the function.  This would work on
> > the assumption that a single FDE would generally cover the entire trampoline
> > - a reasonable assumption, I think, and the consequences for the frame ID
> > changing while single-stepping are less disruptive here than the
> > alternative.
> > 
> > Mark, what do you think of that idea?  It seems to work.  It looks like the
> > patch at the end of this message.
> 
> In general, I think it's a bad idea to do this, but for the special
> case of a signal frame, especially in the presence of the 'S"
> augmentation, that might be a reasonable thing to do.  However, I
> think we can do better than that.  What about checking whether the
> address returned by frame_unwind_address_in_block() is equal to the
> FDE start address and add one bytes if that's the case before looking
> up the function corresponding to that address?

Unfortunately we can't readily; we'd have to add a bit of new code,
since all that's there is a call to frame_func_unwind (next_frame)
and that has no way to do the right thing.

I'd like to trigger off the signal augmentation.  If you'd prefer to
check the FDE start address, could you show me exactly what you have in
mind?

With that patch plus the fixed unwind information gdb.base/*.exp
results are basically clean for x86_64 - best I've ever seen them.
There is a corefile issue which I think is kernel related, and two
annotation tests fail because they don't account for a glibc with debug
information enabled.

-- 
Daniel Jacobowitz
CodeSourcery


      parent reply	other threads:[~2006-07-18 18:39 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-06 22:22 Daniel Jacobowitz
2006-07-13 20:20 ` Mark Kettenis
2006-07-17  7:30   ` Andreas Jaeger
2006-07-17 13:15     ` Mark Kettenis
2006-07-17 13:20       ` Daniel Jacobowitz
2006-07-18  9:48         ` Andreas Jaeger
2006-07-18 18:39           ` Daniel Jacobowitz
2006-08-03  2:04             ` Daniel Jacobowitz
2006-08-03  2:38               ` Andi Kleen
2006-08-03  2:48                 ` Daniel Jacobowitz
2006-08-03  3:12                   ` Andi Kleen
2006-08-03  3:21                     ` Daniel Jacobowitz
2006-08-03  3:29                       ` Andi Kleen
2006-08-03 13:27                         ` Daniel Jacobowitz
2006-08-18 15:08                       ` Andreas Jaeger
2006-08-18 15:15                         ` Daniel Jacobowitz
2006-08-21  8:50                           ` Andreas Jaeger
2006-08-21 14:19                             ` Ulrich Drepper
2006-08-21 14:52                               ` Daniel Jacobowitz
2006-07-18 18:50   ` 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=20060718183910.GB17864@nevyn.them.org \
    --to=drow@false.org \
    --cc=gdb@sourceware.org \
    --cc=libc-alpha@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