AArch64 AAPCS: Ignore static members
authorAlan Hayward <alan.hayward@arm.com>
Thu, 24 Jan 2019 08:17:39 +0000 (08:17 +0000)
committerAlan Hayward <alan.hayward@arm.com>
Thu, 24 Jan 2019 08:26:07 +0000 (08:26 +0000)
commit353229bf405113e6ba2fe21f2a691bc63aa94bd8
tree7a8e1d2774cf12dd5d77d390ebce0a3900fb2570
parent388a192d73df7439bf375d8b8042bb53a6be9c60
AArch64 AAPCS: Ignore static members

Static members in C++ structs are global data and therefore not part of the
list of struct members considered for passing in registers.

Note the corresponding code in GCC (from which the GDB AAPCS code is based)
does not have any static member checks due to the static members not being
part of the struct type at that point.

Extend gdb.base/infcall-nested-structs.exp to test structs with static
members when compiled for C++.  XFAIL more cases for x86_64 (see gdb/24104).
For completeness, ensure some test cases have both empty structures and
static members.

Also fixes gdb.dwarf2/dw2-cp-infcall-ref-static.exp.

gdb/ChangeLog:

* aarch64-tdep.c (aapcs_is_vfp_call_or_return_candidate_1): Check
for static members.
(pass_in_v_vfp_candidate): Likewise.

gdb/testsuite/ChangeLog:

* gdb.base/infcall-nested-structs.c (struct struct_static_02_01):
New structure.
(struct struct_static_02_02): Likewise.
(struct struct_static_02_03): Likewise.
(struct struct_static_02_04): Likewise.
(struct struct_static_04_01): Likewise.
(struct struct_static_04_02): Likewise.
(struct struct_static_04_03): Likewise.
(struct struct_static_04_04): Likewise.
(struct struct_static_06_01): Likewise.
(struct struct_static_06_02): Likewise.
(struct struct_static_06_03): Likewise.
(struct struct_static_06_04): Likewise.
(cmp_struct_static_02_01): Likewise.
(cmp_struct_static_02_02): Likewise.
(cmp_struct_static_02_03): Likewise.
(cmp_struct_static_02_04): Likewise.
(cmp_struct_static_04_01): Likewise.
(cmp_struct_static_04_02): Likewise.
(cmp_struct_static_04_03): Likewise.
(cmp_struct_static_04_04): Likewise.
(cmp_struct_static_06_01): Likewise.
(cmp_struct_static_06_02): Likewise.
(cmp_struct_static_06_03): Likewise.
(cmp_struct_static_06_04): Likewise.
(call_all): Test new structs.
* gdb.base/infcall-nested-structs.exp: Likewise.
gdb/ChangeLog
gdb/aarch64-tdep.c
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.base/infcall-nested-structs.c
gdb/testsuite/gdb.base/infcall-nested-structs.exp