* tm-sparc.h, tm-68k.h (EXTRACT_RETURN_VALUE): fix output of
authorStu Grossman <grossman@cygnus>
Sat, 26 Oct 1991 01:06:16 +0000 (01:06 +0000)
committerStu Grossman <grossman@cygnus>
Sat, 26 Oct 1991 01:06:16 +0000 (01:06 +0000)
short return values for sparc and 68k.  Patch from Paul Eggert.

gdb/ChangeLog
gdb/tm-68k.h
gdb/tm-sparc.h

index 006f86d6567f5b95537f6d356aff7977d96d7db7..89099cd855976a6f78c740d9c79b42adb77067c3 100644 (file)
@@ -1,5 +1,8 @@
 Fri Oct 25 16:06:38 1991  Stu Grossman  (grossman at cygnus.com)
 
+       * tm-sparc.h, tm-68k.h (EXTRACT_RETURN_VALUE):  fix output of
+       short return values for sparc and 68k.  Patch from Paul Eggert.
+
        * coffread.c, coredep.c, i386-xdep.c:  install patches for
        SysV/386 3.2 from Mauro DePalma.
 
index d89f23d9c45bef3e60818ec44034d0c9dfc572e2..f501495352c5cddc119ae10715e4acfcbef89ca3 100644 (file)
@@ -275,7 +275,9 @@ extern struct ext_format ext_format_68881;
 
 #if !defined (EXTRACT_RETURN_VALUE)
 #define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
-  bcopy (REGBUF, VALBUF, TYPE_LENGTH (TYPE))
+  bcopy ((char *)(REGBUF) +                                            \
+                (TYPE_LENGTH(TYPE) >= 4 ? 0 : 4 - TYPE_LENGTH(TYPE)),  \
+        VALBUF, TYPE_LENGTH(TYPE))
 #endif
 
 /* Write into appropriate registers a function return value
index d89781b8849cef80dd7ebf2e49781eb55448e6d3..866788be7426c8f93d33920bb8a12b0186ffc313 100644 (file)
@@ -267,7 +267,9 @@ extern CORE_ADDR sparc_pc_adjust();
               (VALBUF), TYPE_LENGTH(TYPE));                               \
       }                                                                           \
     else                                                                  \
-      bcopy (((int *)(REGBUF))+8, (VALBUF), TYPE_LENGTH (TYPE));           \
+      bcopy ((char *)(REGBUF) + 4 * 8 +                                           \
+                    (TYPE_LENGTH(TYPE) >= 4 ? 0 : 4 - TYPE_LENGTH(TYPE)), \
+            (VALBUF), TYPE_LENGTH(TYPE));                                 \
   }
 
 /* Write into appropriate registers a function return value