This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH v3] [amd64] Fix AMD64 return value ABI in expression evaluation
- From: Tom Tromey <tom at tromey dot com>
- To: "Leszek Swirski via gdb-patches" <gdb-patches at sourceware dot org>
- Cc: Leszek Swirski <leszeks at google dot com>, palves at redhat dot com
- Date: Tue, 16 Apr 2019 10:39:28 -0600
- Subject: Re: [PATCH v3] [amd64] Fix AMD64 return value ABI in expression evaluation
- References: <20190214151602.147300-1-leszeks@google.com> <20190214151810.149322-1-leszeks@google.com>
>>>>> ">" == Leszek Swirski via gdb-patches <gdb-patches@sourceware.org> writes:
>> This ABI mismatch resulted in issues when calling a function that returns
>> a class of size <16 bytes which has a base class, including issues such
>> as the "this" pointer being incorrect (as it was passed as the second
>> argument rather than the first).
I'm still looking into the problem, but this regressed an internal test
case here at AdaCore. In particular, this patch doesn't seem to treat
bitfields the same way that gcc does.
>> * amd64-tdep.c (amd64_classify_aggregate): Use cp_pass_by_reference
>> rather than a hand-rolled POD check when checking for forced MEMORY
>> classification.
This mentions cp_pass_by_reference but the patch doesn't actually
introduce a call to this function.
>> - /* 1. If the size of an object is larger than two eightbytes, or in
>> - C++, is a non-POD structure or union type, or contains
>> + /* 1. If the size of an object is larger than two eightbytes, or it has
>> unaligned fields, it has class memory. */
This area seems to differ between gcc and gdb as well. The psABI
mentions using 8 eightbytes here, but then has a complicated footnote
about the post-merge cleanup, so I'm not certain if gcc and gdb always
agree in practice.
Tom