This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: frameless_look_for_prologue
- To: Andrew Cagney <ac131313 at cygnus dot com>
- Subject: Re: frameless_look_for_prologue
- From: Michael Snyder <msnyder at cygnus dot com>
- Date: Fri, 09 Mar 2001 13:36:39 -0800
- CC: David Taylor <taylor at cygnus dot com>, gdb-patches at sourceware dot cygnus dot com
- Organization: Red Hat
- References: <200103091450.JAA05215@texas.cygnus.com> <3AA93E14.2DAFC405@cygnus.com>
Andrew Cagney wrote:
>
> David Taylor wrote:
> >
> > I believe that every target that does:
> >
> > set_gdbarch_frameless_function_invocation (gdbarch,
> > frameless_look_for_prologue);
> >
> > has a bug.
> >
> > The function frameless_look_for_prologue invokes PROLOGUE_FRAMELESS_P
> > with one argument -- the pc of the *START* of the function.
> >
> > For backtraces, get_prev_frame wants to know not "does this function
> > eventually set up a frame if I execute far enough into it", but rather
> > "does this function have a frame at the point where the program has
> > currently stopped".
>
> I don't think this is right. As far as I know, the behavour is:
>
> o gdb sets a breakpoint at the end
> of the function prologue
>
> i.e. break foo
> not break *foo
>
> o the target runs through to the end of
> the prologue so that the stack frame's
> construction is complete.
>
> GDB can only do correct backtraces after the frame has been
> constructed. GDB doesn't handle backtraces part way through a stack
> frame.
>
> As far as I know, to make things so that GDB could re-construct a
> partially built frame, GDB would need to understand things like dwarf2's
> live range splitting stuff (correct name?) along with a few other dwarf2
> (?) features which would, together, let GDB construct its frame frame
> based on an aribtrary function address.
It varies from ABI to ABI, and base-port to base-port.
For some targets, backtrace can succeed even if you're
stopped at an arbitrary point in the prologue. Of course,
evaluation of the function's parameters probably won't work...