Re: [PATCH] mips_extract_struct_return_value: use saved regcache

Michael Snyder
2002-09-10T21:26:24Z

Daniel Jacobowitz wrote:
>
> On Tue, Sep 10, 2002 at 01:08:33PM -0700, Michael Snyder wrote:
> > Andrew Cagney wrote:
> > >
> > > > ! mips_extract_struct_value_address (struct regcache *regcache)
> > > > {
> > > > /* FIXME: This will only work at random. The caller passes the
> > > > struct_return address in V0, but it is not preserved. It may
> > > > still be there, or this may be a random value. */
> > > > ! CORE_ADDR val;
> > > > ! regcache_cooked_read_unsigned (regcache, V0_REGNUM, &val);
> > > > ! return val;
> > > > }
> > >
> > > FYI,
> > >
> > > This should be regcache_cooked_read_signed() so that the address is sign
> > > extended.
> >
> > Are you sure? Arm, i386, and cris all use unsigned.
> > I just copied them.
>
> Yes, Andrew's right - this is a quirk of MIPS.

OK then -- I'll change it.
Thanks (Daniel and Andrew)

>
> > > I think val should also be a LONGEST.
> >
> > OK, will change.
> >
>
> --
> Daniel Jacobowitz
> MontaVista Software Debian GNU/Linux Developer