Re: gdb code review, pointer madness

Eli Zaretskii
2006-01-25T04:41:07Z

> Date: Tue, 24 Jan 2006 16:00:55 -0800
> From: Jim Blandy <jimb@red-bean.com>
> Cc: gdb-patches@sourceware.org
>
> GDB's current frame model is the result of an incremental cleanup of
> working code, not a fresh design, so it's a little weird.
>
> The natural model would be to have a frame object, with methods that
> read and write that frame's registers. Reading and writing the
> youngest frame's registers would simply read and write the processor's
> current registers. Older frames may have some registers saved on the
> stack by younger frames, so accessing the older frames' registers
> would do a mix of memory accesses and register accesses, as
> appropriate.
>
> GDB's model is that you "unwind" a frame's registers from the next
> younger frame. That is, to access the registers of frame #1 (the
> next-to-youngest frame), you actually apply frame_unwind_register to
> frame #0 (the youngest frame). Okay, whatever. But then the obvious
> question is: how do you access the registers of the youngest frame
> itself? How do you 'unwind' them when they're not wound up?
>
> Thus the sentinel frame, the "-1st" frame.

Ah! wouldn't it be swell if this description finds its way to
gdbint.texinfo?