diff options
author | Simon Marchi <simon.marchi@efficios.com> | 2020-05-22 16:55:16 -0400 |
---|---|---|
committer | Simon Marchi <simon.marchi@efficios.com> | 2020-05-22 16:55:16 -0400 |
commit | 3cabb6b0694b65c7b5ed800822ca08bd899fc1d1 (patch) | |
tree | 58ba2ab20a5c34f30dff225f099dea06d0ef531e /gdb/ctfread.c | |
parent | 1f704f761b34e145f5eabdc222301ce6e9ec9102 (diff) | |
download | gdb-3cabb6b0694b65c7b5ed800822ca08bd899fc1d1.zip gdb-3cabb6b0694b65c7b5ed800822ca08bd899fc1d1.tar.gz gdb-3cabb6b0694b65c7b5ed800822ca08bd899fc1d1.tar.bz2 |
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) <fields, set_fields>: New methods.
(TYPE_FIELDS): Use type::fields. Change all call sites that
modify the propery to use type::set_fields instead.
Change-Id: I05174ce68f2ce3fccdf5d8b469ff141f14886b33
Diffstat (limited to 'gdb/ctfread.c')
-rw-r--r-- | gdb/ctfread.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/gdb/ctfread.c b/gdb/ctfread.c index 31f927e..c0694ed 100644 --- a/gdb/ctfread.c +++ b/gdb/ctfread.c @@ -309,8 +309,8 @@ attach_fields_to_type (struct ctf_field_info *fip, struct type *type) /* Record the field count, allocate space for the array of fields. */ type->set_num_fields (nfields); - TYPE_FIELDS (type) - = (struct field *) TYPE_ZALLOC (type, sizeof (struct field) * nfields); + type->set_fields + ((struct field *) TYPE_ZALLOC (type, sizeof (struct field) * nfields)); /* Copy the saved-up fields into the field vector. */ for (int i = 0; i < nfields; ++i) @@ -1143,8 +1143,8 @@ add_stt_func (struct ctf_context *ccp, unsigned long idx) /* If argc is 0, it has a "void" type. */ if (argc != 0) - TYPE_FIELDS (ftype) - = (struct field *) TYPE_ZALLOC (ftype, argc * sizeof (struct field)); + ftype->set_fields + ((struct field *) TYPE_ZALLOC (ftype, argc * sizeof (struct field))); /* TYPE_FIELD_TYPE must never be NULL. Fill it with void_type, if failed to find the argument type. */ |