This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [RFA] arm_store_return_value, big-endian (take 2)
- From: Michael Snyder <msnyder at redhat dot com>
- To: Richard dot Earnshaw at arm dot com
- Cc: gdb-patches at sources dot redhat dot com
- Date: Wed, 13 Nov 2002 11:55:04 -0800
- Subject: Re: [RFA] arm_store_return_value, big-endian (take 2)
- Organization: Red Hat, Inc.
- References: <200211121014.gACAEtF31639@pc960.cambridge.arm.com>
Richard Earnshaw wrote:
>
> > Richard Earnshaw wrote:
> > >
> > > > Richard Earnshaw wrote:
> > > > >
> > > > > > Richard Earnshaw wrote:
> > > > > > >
> > > > > > > Leaving asside the issue of the correctness of write_register_bytes (note
> > > > > > > to self, must finish of my register patches), I don't think this is
> > > > > > > correct -- in fact, I think it's also wrong for little-endian as well.
> > > > > > >
> > > > > > > What should happen is that the smaller-than-word value should be
> > > > > > > zero/sign-extended to 32 bits and then the whole thing stored in A1_REGNUM.
> > > > > >
> > > > > > Ah, thanks. OK, how about this?
> > > > > >
> > > > > > 2002-11-06 Michael Snyder <msnyder@redhat.com>
> > > > > >
> > > > > > * arm-tdep.c (arm_store_return_value): Handle offset of
> > > > > > small types on big-endian machines.
> > > > >
> > > > > And for little-endian?
> > > >
> > > > It already works for little-endian. I've tested this with
> > > > arm-sim, arm-sim/-mbig-endian, and arm-sim/-mthumb.
> > >
> > > But it's not zero/sign extending properly for little-endian, so garbage is
> > > remaining in the top part of A1
> >
> > Ah; well, I didn't make it any worse! ;-)
> > Can I leave that detail for someone else, and just
> > submit this minor improvement?
>
> Given that to fix this for little-endian as well means that you just have
> to *remove* the endianness test from your patch, why is that so hard???!!!!
Oh, I see. Yes, it's no longer necessary. But if it's not so hard,
and you already see what's necessary, why not just do it instead of
ragging on me to do it? ;-)
This what you have in mind? Please just take it from here, I really
didn't intend to spend this much time and energy on it.
Index: arm-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/arm-tdep.c,v
retrieving revision 1.74
diff -p -r1.74 arm-tdep.c
*** arm-tdep.c 1 Nov 2002 21:21:49 -0000 1.74
--- arm-tdep.c 13 Nov 2002 19:48:21 -0000
*************** arm_store_return_value (struct type *typ
*** 2417,2424 ****
break;
}
}
! else
! write_register_bytes (ARM_A1_REGNUM, valbuf, TYPE_LENGTH (type));
}
/* Store the address of the place in which to copy the structure the
--- 2417,2424 ----
break;
}
}
! else
! write_register (ARM_A1_REGNUM, unpack_long (type, valbuf);
}
/* Store the address of the place in which to copy the structure the