diff options
author | Mark Kettenis <kettenis@gnu.org> | 2005-08-16 17:12:35 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@gnu.org> | 2005-08-16 17:12:35 +0000 |
commit | 65ada037fc96409c6e014ce1e6d982480c1f6bed (patch) | |
tree | d63e9d71a2fd3875ccc2dd023cecbd924268e98e | |
parent | 1410d87cafe792f6c57d04b41ab97cf250ba0225 (diff) | |
download | gdb-65ada037fc96409c6e014ce1e6d982480c1f6bed.zip gdb-65ada037fc96409c6e014ce1e6d982480c1f6bed.tar.gz gdb-65ada037fc96409c6e014ce1e6d982480c1f6bed.tar.bz2 |
* ppc-sysv-tdep.c (ppc_sysv_abi_push_dummy_call): Set condition
register appropriately for varargs functions.
-rw-r--r-- | gdb/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/ppc-sysv-tdep.c | 22 |
2 files changed, 25 insertions, 2 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 41a315a..d3951b1 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -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 diff --git a/gdb/ppc-sysv-tdep.c b/gdb/ppc-sysv-tdep.c index b172dc0..3824c99 100644 --- a/gdb/ppc-sysv-tdep.c +++ b/gdb/ppc-sysv-tdep.c @@ -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. */ |