This is the mail archive of the
gdb-patches@sourceware.cygnus.com
mailing list for the GDB project.
Re: RFA: USE_STRUCT_CONVENTION for NetBSD/i386
- To: ac131313 at cygnus dot com
- Subject: Re: RFA: USE_STRUCT_CONVENTION for NetBSD/i386
- From: Mark Kettenis <kettenis at wins dot uva dot nl>
- Date: Fri, 24 Mar 2000 12:21:52 +0100
- CC: jtc at redback dot com, gdb-patches at sourceware dot cygnus dot com
- References: <5msnxieegg.fsf@jtc.redbacknetworks.com> <38DAD990.D91D6D1B@cygnus.com>
Date: Fri, 24 Mar 2000 13:57:20 +1100
From: Andrew Cagney <ac131313@cygnus.com>
"J.T. Conklin" wrote:
> ! int
> ! i386nbsd_use_struct_convention (int gcc_p, struct type *type)
> ! {
> ! return !(TYPE_LENGTH (type) == 1
> ! || TYPE_LENGTH (type) == 2
> ! || TYPE_LENGTH (type) == 4
> ! || TYPE_LENGTH (type) == 8);
> ! }
> !
I'd add a FIXME pointing out known problems with the function.
Otherwize ok.
Well, it's not the i386nbsd_use_struct_convention that's the problem,
so a FIXME there would not be very useful.
I assume Mark is trying to figure out why NetBSD can't simply use a
common i386_use_struct_convention function. I take it from your answer,
that NetBSD's convention isn't 100% standard (where standard would mean
what someone other than Linux or *BSD did. Solaris/x86?).
Basically, what we're talking about is the difference between the
System V ABI (Linux/ELF, Solaris/x86 and other System V-derived
systems) and the old, more efficient GCC convention used by NetBSD and
FreeBSD and Linux/a.out. For the System V ABI,
generic_use_struct_convention does the right thing. But we need a
different one for the other systems.
I'm a bit surprised by the fact that small struct's containing one
float are returned in the FP registers, so I want to investigate that
a bit, but I think it should be possible to have
i386_extract_return_value do the right thing there too.
Since this didn't work in the past anyway, I don't think it is release
critical though.
Mark