From c8a3b559eb7f26309b473fd6dd9fc11b10de7001 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Thu, 3 Jun 2004 11:46:34 +0000 Subject: [PATCH] * sh-tdep.c (sh3e_sh4_store_return_value): Correctly store double values in little endian mode. --- gdb/ChangeLog | 5 +++++ gdb/sh-tdep.c | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index e1b2b2a..6e380db 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2004-06-03 Corinna Vinschen + + * sh-tdep.c (sh3e_sh4_store_return_value): Correctly store + double values in little endian mode. + 2004-06-02 Albert Chin-A-Young Committed by Andrew Cagney. diff --git a/gdb/sh-tdep.c b/gdb/sh-tdep.c index 45833fc..d8b29c9 100644 --- a/gdb/sh-tdep.c +++ b/gdb/sh-tdep.c @@ -1147,7 +1147,11 @@ sh3e_sh4_store_return_value (struct type *type, struct regcache *regcache, 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); -- 2.7.4