[RFA] sh-tdep.c: Fix double handling in LE mode
Corinna Vinschen
vinschen@redhat.com
Thu Apr 29 12:44:00 GMT 2004
Ping?
On Mar 25 18:10, Corinna Vinschen wrote:
> Hi,
>
> the below pretty trivial patch fixes two FAILs on SH4 and SH4a in
> little endian mode.
>
> Ok, to apply?
>
> Corinna
>
> * sh-tdep.c (sh3e_sh4_store_return_value): Correctly store
> double values in little endian mode.
>
> Index: sh-tdep.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/sh-tdep.c,v
> retrieving revision 1.167
> diff -u -p -r1.167 sh-tdep.c
> --- sh-tdep.c 8 Mar 2004 10:18:13 -0000 1.167
> +++ sh-tdep.c 25 Mar 2004 17:07:51 -0000
> @@ -1147,7 +1147,11 @@ sh3e_sh4_store_return_value (struct type
> int len = TYPE_LENGTH (type);
> int i, regnum = FP0_REGNUM;
> for (i = 0; i < len; i += 4)
> - regcache_raw_write (regcache, regnum++, (char *) valbuf + i);
> + if (TARGET_BYTE_ORDER == BFD_ENDIAN_LITTLE)
> + regcache_raw_write (regcache, regnum++,
> + (char *) valbuf + len - 4 - i);
> + else
> + regcache_raw_write (regcache, regnum++, (char *) valbuf + i);
> }
> else
> sh_default_store_return_value (type, regcache, valbuf);
>
> --
> Corinna Vinschen
> Cygwin Developer
> Red Hat, Inc.
--
Corinna Vinschen
Cygwin Co-Project Leader
Red Hat, Inc.
More information about the Gdb-patches
mailing list