From: Mark Kettenis <mark.kettenis@xs4all.nl>
To: gdb-patches@sources.redhat.com
Cc: kevinb@redhat.com, cagney@gnu.org
Subject: [ping] [RFA] Fix varargs calls for PowerPC System V ABI
Date: Fri, 12 Aug 2005 16:30:00 -0000 [thread overview]
Message-ID: <200506191030.j5JAUtRE023985@elgar.sibelius.xs4all.nl> (raw)
Message-ID: <20050812163000.oBsclcXDzf8gDFRkIil6VU2y5mW0deU5_y0nS30G_5U@z> (raw)
Sent this one about two months ago. Kevin is excused since I
misspelled his mail address ;-).
------- Start of forwarded message -------
Date: Sun, 19 Jun 2005 12:30:55 +0200 (CEST)
From: Mark Kettenis <kettenis@elgar.sibelius.xs4all.nl>
To: gdb-patches@sources.redhat.com
CC: kevinb@redhat.com, cagney@gnu.org
Subject: [ping] [RFA] Fix varargs calls for PowerPC System V ABI
The patch below fixes
FAIL: gdb.base/varargs.exp: print find_max_double(5,1.0,17.0,2.0,3.0,4.0)
on my OpenBSD/macppc system. Rather than having a (possibly) fragile
check for vararg-ness, it always sets the bit in the condition
register. Normal functions shouldn't care for it, and indeed the way
we did these calls in the past, the condition register might be set to
anything.
OK?
Mark
Index: ChangeLog
from Mark Kettenis <kettenis@gnu.org>
* ppc-sysv-tdep.c (ppc_sysv_abi_push_dummy_call): Set condition
register appropriately for varargs functions.
Index: ppc-sysv-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/ppc-sysv-tdep.c,v
retrieving revision 1.29
diff -u -p -r1.29 ppc-sysv-tdep.c
--- ppc-sysv-tdep.c 25 May 2005 03:12:13 -0000 1.29
+++ ppc-sysv-tdep.c 19 Jun 2005 10:24:55 -0000
@@ -295,6 +295,24 @@ ppc_sysv_abi_push_dummy_call (struct gdb
/* 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. */
next reply other threads:[~2005-08-12 12:05 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-06-19 10:31 Mark Kettenis [this message]
2005-08-12 16:30 ` Mark Kettenis
2005-08-15 23:05 ` Kevin Buettner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200506191030.j5JAUtRE023985@elgar.sibelius.xs4all.nl \
--to=mark.kettenis@xs4all.nl \
--cc=cagney@gnu.org \
--cc=gdb-patches@sources.redhat.com \
--cc=kevinb@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox