This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [RFA] sh-tdep.c: Fix double handling in LE mode
- From: Corinna Vinschen <vinschen at redhat dot com>
- To: gdb-patches at sources dot redhat dot com
- Date: Thu, 29 Apr 2004 14:44:26 +0200
- Subject: Re: [RFA] sh-tdep.c: Fix double handling in LE mode
- References: <20040325171024.GZ17229@cygbert.vinschen.de>
- Reply-to: gdb-patches at sources dot redhat dot com
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.