From 5d14b6e5d6525ce462c30501644922a10f8682eb Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Mon, 8 Jun 2020 15:26:04 -0400 Subject: gdb: add field::type / field::set_type Add the `type` and `set_type` methods on `struct field`, in order to remoremove the `FIELD_TYPE` macro. In this patch, the `FIELD_TYPE` macro is changed to use `field::type`, so all the call sites that are useused to set the field's type are changed to use `field::set_type`. The next patch will remove `FIELD_TYPE` completely. Note that because of the name clash between the existing field named `type` and the new method, I renamed the field `m_type`. It is not private per-se, because we can't make `struct field` a non-POD yet, but it should be considered private anyway (not accessed outside `struct field`). gdb/ChangeLog: * gdbtypes.h (struct field) : New methods. Rename `type` field to... : ... this. Change references throughout to use type or set_type methods. (FIELD_TYPE): Use field::type. Change call sites that modify the field's type to use field::set_type instead. Change-Id: Ie21f866e3b7f8a51ea49b722d07d272a724459a0 --- gdb/eval.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gdb/eval.c') diff --git a/gdb/eval.c b/gdb/eval.c index 6759d22..61f5ba7 100644 --- a/gdb/eval.c +++ b/gdb/eval.c @@ -686,7 +686,7 @@ fake_method::fake_method (type_instance_flags flags, ((struct field *) xzalloc (sizeof (struct field) * num_types)); while (num_types-- > 0) - TYPE_FIELD_TYPE (type, num_types) = param_types[num_types]; + type->field (num_types).set_type (param_types[num_types]); } fake_method::~fake_method () -- cgit v1.1