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: Andrew Cagney <ac131313 at cygnus dot com>
- Subject: Re: RFA: USE_STRUCT_CONVENTION for NetBSD/i386
- From: jtc at redback dot com (J.T. Conklin)
- Date: 24 Mar 2000 14:24:02 -0800
- Cc: gdb-patches at sourceware dot cygnus dot com
- References: <5msnxieegg.fsf@jtc.redbacknetworks.com> <38DAD990.D91D6D1B@cygnus.com>
- Reply-To: jtc at redback dot com
>>>>> "Andrew" == Andrew Cagney <ac131313@cygnus.com> writes:
>> ! 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);
>> ! }
>> !
Andrew> I'd add a FIXME pointing out known problems with the function.
Andrew> Otherwize ok.
It's not i386nbsd_use_struct_convention() that needs a FIXME, as it
now properly identifies all functions which return structures via a
hidden pointer vs. those which return structures via registers. It's
i386_extract_return_type() which doesn't know that structures with a
single float or double field are returned in floating point registers.
Andrew> I assume Mark is trying to figure out why NetBSD can't simply
Andrew> use a common i386_use_struct_convention function. I take it
Andrew> from your answer, that NetBSD's convention isn't 100% standard
Andrew> (where standard would mean what someone other than Linux or
Andrew> *BSD did. Solaris/x86?).
I don't think NetBSD does anything non-standard other than defining
DEFAULT_PCC_STRUCT_RETURN to 0 in its gcc config. So this behavior
should be shared among all x86 targets that do the same: cygwin,
freebsd, linux-aout, and mach.
--jtc
--
J.T. Conklin
RedBack Networks