* mips-tdep.c (mips_n32n64_push_dummy_call): Sign-extend
authorMaciej W. Rozycki <macro@linux-mips.org>
Thu, 20 Dec 2007 17:13:57 +0000 (17:13 +0000)
committerMaciej W. Rozycki <macro@linux-mips.org>
Thu, 20 Dec 2007 17:13:57 +0000 (17:13 +0000)
integers and 32-bit pointers as required by the ABI.

gdb/ChangeLog
gdb/mips-tdep.c

index ce6e80d9511e00ea686188b8bcf7fb5ef11ea0a2..3d56550ee54067fbf232fa1bba41383c5bb0eb3e 100644 (file)
@@ -1,3 +1,9 @@
+2007-12-20  David Ung  <davidu@mips.com>
+            Maciej W. Rozycki  <macro@mips.com>
+
+       * mips-tdep.c (mips_n32n64_push_dummy_call): Sign-extend
+       integers and 32-bit pointers as required by the ABI.
+
 2007-12-20  Joel Brobecker  <brobecker@adacore.com>
 
        * symtab.h: Remove "defs.h" #include.
index 193a21b32b055f14b5662cb12633c72303413b95..d4c8a3c197f542657963bab8ce45242a5a78a998 100644 (file)
@@ -3184,8 +3184,21 @@ mips_n32n64_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
                 purpose register.  */
              if (argreg <= MIPS_LAST_ARG_REGNUM)
                {
-                 LONGEST regval =
-                   extract_unsigned_integer (val, partial_len);
+                 LONGEST regval;
+
+                 /* Sign extend pointers, 32-bit integers and signed
+                    16-bit and 8-bit integers; everything else is taken
+                    as is.  */
+
+                 if ((partial_len == 4
+                      && (typecode == TYPE_CODE_PTR
+                          || typecode == TYPE_CODE_INT))
+                     || (partial_len < 4
+                         && typecode == TYPE_CODE_INT
+                         && !TYPE_UNSIGNED (arg_type)))
+                   regval = extract_signed_integer (val, partial_len);
+                 else
+                   regval = extract_unsigned_integer (val, partial_len);
 
                  /* A non-floating-point argument being passed in a
                     general register.  If a struct or union, and if
This page took 0.031518 seconds and 4 git commands to generate.