From 3cabb6b0694b65c7b5ed800822ca08bd899fc1d1 Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Fri, 22 May 2020 16:55:16 -0400 Subject: gdb: add type::fields / type::set_fields Add the `fields` and `set_fields` methods on `struct type`, in order to remove the `TYPE_FIELDS` macro. In this patch, the `TYPE_FIELDS` macro is changed to the `type::fields`, so all the call sites that use it to set the fields array are changed to use `type::set_fields`. The next patch will remove `TYPE_FIELDS` entirely. gdb/ChangeLog: * gdbtypes.h (struct type) : New methods. (TYPE_FIELDS): Use type::fields. Change all call sites that modify the propery to use type::set_fields instead. Change-Id: I05174ce68f2ce3fccdf5d8b469ff141f14886b33 --- gdb/gnu-v3-abi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gdb/gnu-v3-abi.c') diff --git a/gdb/gnu-v3-abi.c b/gdb/gnu-v3-abi.c index c1967e6..064f924 100644 --- a/gdb/gnu-v3-abi.c +++ b/gdb/gnu-v3-abi.c @@ -166,7 +166,7 @@ build_gdb_vtable_type (struct gdbarch *arch) t = arch_type (arch, TYPE_CODE_STRUCT, offset * TARGET_CHAR_BIT, NULL); t->set_num_fields (field - field_list); - TYPE_FIELDS (t) = field_list; + t->set_fields (field_list); t->set_name ("gdb_gnu_v3_abi_vtable"); INIT_CPLUS_SPECIFIC (t); @@ -1055,7 +1055,7 @@ build_std_type_info_type (struct gdbarch *arch) t = arch_type (arch, TYPE_CODE_STRUCT, offset * TARGET_CHAR_BIT, NULL); t->set_num_fields (field - field_list); - TYPE_FIELDS (t) = field_list; + t->set_fields (field_list); t->set_name ("gdb_gnu_v3_type_info"); INIT_CPLUS_SPECIFIC (t); -- cgit v1.1