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/windows-tdep.c | |
parent | 1f704f761b34e145f5eabdc222301ce6e9ec9102 (diff) | |
download | binutils-gdb-3cabb6b0694b65c7b5ed800822ca08bd899fc1d1.tar.gz |
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/windows-tdep.c')
-rw-r--r-- | gdb/windows-tdep.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gdb/windows-tdep.c b/gdb/windows-tdep.c index d7c498f2e93..6eec2577f38 100644 --- a/gdb/windows-tdep.c +++ b/gdb/windows-tdep.c @@ -752,8 +752,8 @@ create_enum (struct gdbarch *gdbarch, int bit, const char *name, type = arch_type (gdbarch, TYPE_CODE_ENUM, bit, name); type->set_num_fields (count); - TYPE_FIELDS (type) = (struct field *) - TYPE_ZALLOC (type, sizeof (struct field) * count); + type->set_fields + ((struct field *) TYPE_ZALLOC (type, sizeof (struct field) * count)); TYPE_UNSIGNED (type) = 1; for (i = 0; i < count; i++) |