]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
* ppc-sysv-tdep.c (ppc_sysv_abi_push_dummy_call): Set condition
authorMark Kettenis <kettenis@gnu.org>
Tue, 16 Aug 2005 17:12:35 +0000 (17:12 +0000)
committerMark Kettenis <kettenis@gnu.org>
Tue, 16 Aug 2005 17:12:35 +0000 (17:12 +0000)
register appropriately for varargs functions.

gdb/ChangeLog
gdb/ppc-sysv-tdep.c

index 41a315ab802e6e70fa0868d9d69e0a30d383ca19..d3951b1cc7739a1b02358abbb2254456f0ba9ec5 100644 (file)
@@ -1,3 +1,8 @@
+2005-08-16  Mark Kettenis  <kettenis@gnu.org>
+
+       * ppc-sysv-tdep.c (ppc_sysv_abi_push_dummy_call): Set condition
+       register appropriately for varargs functions.
+
 2005-08-15  Kevin Buettner  <kevinb@redhat.com>
 
        * MAINTAINERS (ms1): New target ISA entry.  List myself as
index b172dc01d396a7718799091e4655f5195e041f8b..3824c99a6fa173a3cc5873bcdfd5aef0b9d41a3e 100644 (file)
@@ -1,8 +1,8 @@
 /* Target-dependent code for PowerPC systems using the SVR4 ABI
    for GDB, the GNU debugger.
 
-   Copyright 2000, 2001, 2002, 2003, 2005 Free Software Foundation,
-   Inc.
+   Copyright 2000, 2001, 2002, 2003, 2005
+   Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -295,6 +295,24 @@ ppc_sysv_abi_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
          /* Ensure that the stack is still 16 byte aligned.  */
          sp = align_down (sp, 16);
        }
+
+      /* The psABI says that "A caller of a function that takes a
+        variable argument list shall set condition register bit 6 to
+        1 if it passes one or more arguments in the floating-point
+        registers. It is strongly recommended that the caller set the
+        bit to 0 otherwise..."  Doing this for normal functions too
+        shouldn't hurt.  */
+      if (write_pass)
+       {
+         ULONGEST cr;
+
+         regcache_cooked_read_unsigned (regcache, tdep->ppc_cr_regnum, &cr);
+         if (freg > 1)
+           cr |= 0x02000000;
+         else
+           cr &= ~0x02000000;
+         regcache_cooked_write_unsigned (regcache, tdep->ppc_cr_regnum, cr);
+       }
     }
 
   /* Update %sp.   */