This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: find_saved_register(frame) -> next/prev frame?
Elena Zannoni wrote:
>
> Michael Snyder writes:
> > Andrew Cagney wrote:
> > >
> > > > It seems that find_saved_register is called only by mips_get_saved_register()
> > > > and default_get_saved_register().
> > > >
> > > > There is another function, generic_get_saved_register() in
> > > > blockframe.c which is basically identical to
> > > > default_get_saved_register
> >
> > Not at all! generic_get_saved_register is a special
> > purpose function, and if you look at the code you
> > should be able to see that it is very different
> > from default_get_saved_register.
> >
>
> Can you please explain it to me. I am obviously missing something,
> then. The comments are not helping in explaining the difference, and
> the name 'generic' doesn't indicate what the special purpose is. How
> does one choose to use one versus the other? It seems that all the
> multiarched targets are using the generic version. And the
> non-multiarched one are using the default version.
Hmm,
if (PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame))
{
if (lval) /* found it in a CALL_DUMMY frame */
it's this bit that is different. It has code to handle a call dummy
where the raw registers were saved in (GDB) local buffer instead of on
the stack.
However, it does iterate over the frames the way I think it should so I
think default_get_saved_register() is wrong.
I think (attempt two) they are ``identical'' if the above becomes:
if (PC_IN_CALL_DUMMY (...) && using_generic_dummy_frames)
Andrew