aboutsummaryrefslogtreecommitdiff
path: root/gdb/aarch64-tdep.c
diff options
context:
space:
mode:
authorAlan Hayward <alan.hayward@arm.com>2019-01-24 08:17:39 +0000
committerAlan Hayward <alan.hayward@arm.com>2019-01-24 08:26:07 +0000
commit353229bf405113e6ba2fe21f2a691bc63aa94bd8 (patch)
tree7a8e1d2774cf12dd5d77d390ebce0a3900fb2570 /gdb/aarch64-tdep.c
parent388a192d73df7439bf375d8b8042bb53a6be9c60 (diff)
downloadgdb-353229bf405113e6ba2fe21f2a691bc63aa94bd8.zip
gdb-353229bf405113e6ba2fe21f2a691bc63aa94bd8.tar.gz
gdb-353229bf405113e6ba2fe21f2a691bc63aa94bd8.tar.bz2
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.
Diffstat (limited to 'gdb/aarch64-tdep.c')
-rw-r--r--gdb/aarch64-tdep.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/gdb/aarch64-tdep.c b/gdb/aarch64-tdep.c
index 7c5d748..fb79b57 100644
--- a/gdb/aarch64-tdep.c
+++ b/gdb/aarch64-tdep.c
@@ -1224,6 +1224,10 @@ aapcs_is_vfp_call_or_return_candidate_1 (struct type *type,
for (int i = 0; i < TYPE_NFIELDS (type); i++)
{
+ /* Ignore any static fields. */
+ if (field_is_static (&TYPE_FIELD (type, i)))
+ continue;
+
struct type *member = check_typedef (TYPE_FIELD_TYPE (type, i));
int sub_count = aapcs_is_vfp_call_or_return_candidate_1
@@ -1502,6 +1506,10 @@ pass_in_v_vfp_candidate (struct gdbarch *gdbarch, struct regcache *regcache,
case TYPE_CODE_UNION:
for (int i = 0; i < TYPE_NFIELDS (arg_type); i++)
{
+ /* Don't include static fields. */
+ if (field_is_static (&TYPE_FIELD (arg_type, i)))
+ continue;
+
struct value *field = value_primitive_field (arg, 0, i, arg_type);
struct type *field_type = check_typedef (value_type (field));