summaryrefslogtreecommitdiff
path: root/gdb/mdebugread.c
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@efficios.com>2020-05-22 16:55:16 -0400
committerSimon Marchi <simon.marchi@efficios.com>2020-05-22 16:55:16 -0400
commit3cabb6b0694b65c7b5ed800822ca08bd899fc1d1 (patch)
tree58ba2ab20a5c34f30dff225f099dea06d0ef531e /gdb/mdebugread.c
parent1f704f761b34e145f5eabdc222301ce6e9ec9102 (diff)
downloadbinutils-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/mdebugread.c')
-rw-r--r--gdb/mdebugread.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/gdb/mdebugread.c b/gdb/mdebugread.c
index f634dbb08f1..aeecb14f19e 100644
--- a/gdb/mdebugread.c
+++ b/gdb/mdebugread.c
@@ -1018,9 +1018,8 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend,
t->set_code (type_code);
TYPE_LENGTH (t) = sh->value;
t->set_num_fields (nfields);
- TYPE_FIELDS (t) = f = ((struct field *)
- TYPE_ALLOC (t,
- nfields * sizeof (struct field)));
+ f = ((struct field *) TYPE_ALLOC (t, nfields * sizeof (struct field)));
+ t->set_fields (f);
if (type_code == TYPE_CODE_ENUM)
{
@@ -1187,8 +1186,9 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend,
struct block_iterator iter;
ftype->set_num_fields (nparams);
- TYPE_FIELDS (ftype) = (struct field *)
- TYPE_ALLOC (ftype, nparams * sizeof (struct field));
+ ftype->set_fields
+ ((struct field *)
+ TYPE_ALLOC (ftype, nparams * sizeof (struct field)));
iparams = 0;
ALL_BLOCK_SYMBOLS (cblock, iter, sym)