This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Re: think-o: frame.c:find_saved_register() frame1 = get_prev_frame (frame1) backwards?
- From: Daniel Jacobowitz <drow at mvista dot com>
- To: Kevin Buettner <kevinb at redhat dot com>
- Cc: Andrew Cagney <ac131313 at cygnus dot com>, gdb at sources dot redhat dot com
- Date: Fri, 15 Feb 2002 17:54:20 -0500
- Subject: Re: think-o: frame.c:find_saved_register() frame1 = get_prev_frame (frame1) backwards?
- References: <3C697103.5060908@cygnus.com> <1020215225041.ZM9434@localhost.localdomain>
On Fri, Feb 15, 2002 at 03:50:41PM -0700, Kevin Buettner wrote:
> On Feb 12, 2:46pm, Andrew Cagney wrote:
>
> > (it dates back to prior to Red Hats CVS repository). I think this is
> > going the wrong way, looking in frame.h the doco indicates:
> >
> > /* Pointers to the next (down, inner) and previous (up, outer)
> > frame_info's in the frame cache. */
> > struct frame_info *next; /* down, inner */
> > struct frame_info *prev; /* up, outer */
> >
> > and blockframe.c:get_prev_frame() returns the next ``up, outer'':
> >
> > /* If we have the prev one, return it */
> > if (next_frame->prev)
> > return next_frame->prev;
> >
> > Given:
> >
> > a() { b (); }
> >
> > then it is b() that is saving registers used by a(). And b() is ``down,
> > inner''.
> >
> > confused,
> > Andrew
>
> I don't know. I've also gotten confused when staring at this code. I
> don't find the terms "next", "down", or "inner" to be helpful at all
> when trying to figure it out either. I think we ought to be referring
> to "callers" and "callees".
While they may not be 100% accurate (call dummies for instance, signal
handlers...) I strongly agree. That's a much clearer term.
--
Daniel Jacobowitz Carnegie Mellon University
MontaVista Software Debian GNU/Linux Developer