mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-08-06 06:45:56 +08:00
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
This commit is contained in:
@ -683,8 +683,8 @@ fake_method::fake_method (type_instance_flags flags,
|
||||
allocate memory for auxiliary fields, and free the memory ourselves
|
||||
when we are done with it. */
|
||||
type->set_num_fields (num_types);
|
||||
TYPE_FIELDS (type) = (struct field *)
|
||||
xzalloc (sizeof (struct field) * num_types);
|
||||
type->set_fields
|
||||
((struct field *) xzalloc (sizeof (struct field) * num_types));
|
||||
|
||||
while (num_types-- > 0)
|
||||
TYPE_FIELD_TYPE (type, num_types) = param_types[num_types];
|
||||
|
Reference in New Issue
Block a user