Re: assertion failure in regcache.c

Kris Warkentin
2003-05-23T17:36:04Z

> > I'd start with the obvious thing - a simple tipo in the SH4 register
> > byte function. The code was written long before these sanity checks
> > were added and ``the old way'' makes it very hard to notice that the
> > values are skewed.
> >
> > Andrew
> >
>
>
> yes, look at sh_sh4_register_byte. Maybe FV0_REGNUM or FV_LAST_REGNUM
> are not set correctly or fv_reg_base_num does something wrong. These
> registers with (*1) are pseudo registers, so it's easy that the
> calculations could have been screwed up.

Well, I found the disagreement. It looks to me like
regcache->descr->register_offset[] is pointing to an upwardly growing list
of registers including the pseudo-registers. So you get something like dr5
being 260 in the register_offset array but sh4_register_byte will return 124
which would be the offset of fr10 (taking into account that dr0 is overlaid
on top of the fr regs). I'm inclined to think that the regcache way is
wrong since someone who updates dr0 and then reads fr0 will get conflicting
values. We shouldn't be storing extra copies of the same register.

Where do I go from here?

cheers,

Kris