This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH] Fix complex doube/long double return of i386
- From: Mark Kettenis <mark dot kettenis at xs4all dot nl>
- To: gdb-patches at sourceware dot org
- Date: Wed, 24 Oct 2012 16:56:07 +0200 (CEST)
- Subject: [PATCH] Fix complex doube/long double return of i386
Just like on amd64, returning complex numbers wasn't handled. The
official System V ABI doesn't mention complex numbers, but returning
them as if they are a struct (just like the large decimal floating
point types) is the only sensible thing to do.
Committed.
2012-10-24 Mark Kettenis <kettenis@gnu.org>
PR gdb/12783
* i386-tdep.c (i386_return_value): Handle complex double and long
double.
Index: i386-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/i386-tdep.c,v
retrieving revision 1.358
diff -u -p -r1.358 i386-tdep.c
--- i386-tdep.c 15 Oct 2012 20:37:39 -0000 1.358
+++ i386-tdep.c 24 Oct 2012 14:50:13 -0000
@@ -2630,6 +2630,9 @@ i386_return_value (struct gdbarch *gdbar
|| code == TYPE_CODE_UNION
|| code == TYPE_CODE_ARRAY)
&& !i386_reg_struct_return_p (gdbarch, type))
+ /* Complex double and long double uses the struct return covention. */
+ || (code == TYPE_CODE_COMPLEX && TYPE_LENGTH (type) == 16)
+ || (code == TYPE_CODE_COMPLEX && TYPE_LENGTH (type) == 24)
/* 128-bit decimal float uses the struct return convention. */
|| (code == TYPE_CODE_DECFLOAT && TYPE_LENGTH (type) == 16))
{