This is the mail archive of the
mailing list for the GDB project.
Re: [RFC] Move the frame zero PC check earlier
- From: Mark Kettenis <mark dot kettenis at xs4all dot nl>
- To: andrew dot stubbs at st dot com
- Cc: gdb-patches at sourceware dot org
- Date: Sat, 22 Jul 2006 13:22:53 +0200 (CEST)
- Subject: Re: [RFC] Move the frame zero PC check earlier
- References: <firstname.lastname@example.org> <20060517155729.GF27234@adacore.com> <email@example.com.> <446C3EB3.firstname.lastname@example.org> <email@example.com.> <firstname.lastname@example.org> <email@example.com.> <200605182004.k4IK49Eh003764@elgar.sibelius.xs4all.nl> <firstname.lastname@example.org.> <200605202129.k4KLT4g4014877@elgar.sibelius.xs4all.nl> <20060521020434.GA9432@nevyn.them.org> <44C0F828.email@example.com>
> Date: Fri, 21 Jul 2006 16:52:08 +0100
> From: Andrew STUBBS <firstname.lastname@example.org>
> This is a feature I would like to see.
Thanks Andrew, for reminding us.
> Daniel Jacobowitz wrote:
> > On Sat, May 20, 2006 at 11:29:04PM +0200, Mark Kettenis wrote:
> >> I actually think that something like that is the way to go. It's
> >> closely related to what Dan wrote about in:
> >> http://sourceware.org/ml/gdb/2006-05/msg00109.html
> >> and I'd like to have a go at implementing option #2 in that mail.
> > That (the frame unwinder end-of-stack method) wouldn't actually help
> > with this problem; that's why I sent the two separately (they were
> > originally the same message when I was writing it). The architecture
> > unwinder could report a saved pc of zero as terminating the stack, but
> > in all the cases I'm interested in, the DWARF-2 unwinder is actually
> > used for the bottom frame.
But the "having a saved pc of zero" is only one of the conventions
used for terminating the frame chain. So the DWARF-2 unwinder would
still fail to do the right thing for ISA/ABI's that use a different
convention. So I think we need an ISA/ABI-specefic callback to
determine whether a frame is the outermost frame, just like we already
have for signal trampolines. This actually matches the following idea
I had pretty well:
The outermost frame is special, just like sigtramp and dummy frames.
Why not introduce a new frame type OUTERMOST_FRAME and make
get_prev_frame() return NULL if that's the type of THIS_FRAME's? This
would require some changes to the current frame unwinder
infrastructure, since the type is currently hardcoded into the
unwinder. That would have the additional benefit that we could get
rid of the bogosity that we have multiple frame unwinder definitions
in the DWARF-2 unwinder just to handle signal trampolines.