This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [RFA] Fix argumens to return_value_location
- To: Andrew Cagney <ac131313 at cygnus dot com>
- Subject: Re: [RFA] Fix argumens to return_value_location
- From: Jim Blandy <jimb at zwingli dot cygnus dot com>
- Date: 11 May 2001 19:47:06 -0500
- Cc: gdb-patches at sources dot redhat dot com
- References: <20010411203745.25B9E5E9CB@zwingli.cygnus.com><3AFA15AD.3000102@cygnus.com>
Andrew Cagney <ac131313@cygnus.com> writes:
> > 2001-04-11 Jim Blandy <jimb@redhat.com>
> >
> > * mips-tdep.c (return_value_location): Swap `hi' and `lo'
> > arguments, to match the way this function is actually called.
>
>
> Can you instead change the calls to read &hi, &lo? It's probably a
> personal thing I prefer big endian orderings - hi before lo :-)
>
> Looking at the code, I think it managed to bumble its way through almost
> all the different cases anyway.
I know --- this didn't really fix too many failures. But how could it
have worked otherwise? I mean, the wrong register numbers are going
into *hi and *lo.
I have committed the following change. Yea, verily, I shall rue this
day.
2001-05-11 Jim Blandy <jimb@redhat.com>
* mips-tdep.c (mips_store_return_value,
mips_extract_return_value): Pass arguments to
return_value_location in the proper order.
Index: mips-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/mips-tdep.c,v
retrieving revision 1.48
diff -c -c -b -F'^(' -r1.48 mips-tdep.c
*** mips-tdep.c 2001/05/04 04:15:25 1.48
--- mips-tdep.c 2001/05/12 00:26:58
***************
*** 3209,3215 ****
{
struct return_value_word lo;
struct return_value_word hi;
! return_value_location (valtype, &lo, &hi);
memcpy (valbuf + lo.buf_offset,
regbuf + REGISTER_BYTE (lo.reg) + lo.reg_offset,
--- 3209,3215 ----
{
struct return_value_word lo;
struct return_value_word hi;
! return_value_location (valtype, &hi, &lo);
memcpy (valbuf + lo.buf_offset,
regbuf + REGISTER_BYTE (lo.reg) + lo.reg_offset,
***************
*** 3230,3236 ****
char raw_buffer[MAX_REGISTER_RAW_SIZE];
struct return_value_word lo;
struct return_value_word hi;
! return_value_location (valtype, &lo, &hi);
memset (raw_buffer, 0, sizeof (raw_buffer));
memcpy (raw_buffer + lo.reg_offset, valbuf + lo.buf_offset, lo.len);
--- 3230,3236 ----
char raw_buffer[MAX_REGISTER_RAW_SIZE];
struct return_value_word lo;
struct return_value_word hi;
! return_value_location (valtype, &hi, &lo);
memset (raw_buffer, 0, sizeof (raw_buffer));
memcpy (raw_buffer + lo.reg_offset, valbuf + lo.buf_offset, lo.len);