This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [commit] Split d10v-tdep.c into trad-frame.[hc]
On Sun, Jun 08, 2003 at 01:45:06PM -0400, Andrew Cagney wrote:
>
> >>+struct trad_frame
>
> trad_frame_saved_regs?
trad_frame_saved_reg? Even if you'll only ever use this as an array,
the structure is a singular register.
> >>+{
> >>+ /* If non-zero (and regnum >= 0), the stack address at which the
> >>+ register is saved. By default, it is assumed that the register
> >>+ was not saved (addr == 0). Remember, a LONGEST can always fit a
> >>+ CORE_ADDR. */
> >>+ LONGEST addr;
> >>+ /* else, if regnum >=0 (and addr == 0), the REGNUM that contains
> >>+ this registers value. By default, it is assumed that the
> >>+ registers are not moved (the register's value is still in that
> >>+ register and regnum == the index). */
> >>+ int regnum;
> >>+ /* else, if regnum < 0, ADDR is the registers value. */
> >>+};
> >
> >
> >Gyuh? I looked at this for a couple of minutes and couldn't make heads
> >or tails of it until I went to look at trad-frame.c: this structure
> >isn't a frame at all, it's a single saved register. Could you rename
> >it, and update the comments?
> >
> >I'm also not sure I understand all the combinations:
> > regnum < 0, addr is the register value
> > regnum >= 0 and addr 0, regnum holds the new register number (in the
> > next frame?)
>
> The previous frame's register is found in REGNUM in this frame. Need to
> unwind the next frame's REGNUM to get the value of register REGNUM in
> this frame.
The third REGNUM there means the array index, not the REGNUM member,
right?
> > regnum >= 0 and addr non-zero, addr is the save address - but what's
> > regnum mean? Nothing?
>
> Nothing.
OK, I see. I'd appreciate it if you clarified that in the comment.
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer