This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: find_saved_register(frame) -> next/prev frame?


Andrew Cagney writes:
 > 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

Yes, sorry I should have posted a reply to the list, after some
clarification from Michael. The generic dummy frame stuff is a self
contained system, the generic_find_saved_register function does what
default_get_saved_register does, plus the dummy frame search.

It seems that most (all?) of the multiarched targets use this system,
instead of defining their own dummy frame machinery. 

Yes, the generic version does the search throught the frames in the
correct order.

Elena

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]