This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[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, 25 Mar 2004 18:10:24 +0100
- Subject: [RFA] sh-tdep.c: Fix double handling in LE mode
- Reply-to: gdb-patches at sources dot redhat dot com
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.