From b4b73759537ae830d8b48834b419b095561d4d4a Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Mon, 14 Sep 2020 11:07:58 -0400 Subject: gdb: add type::is_stub / type::set_is_stub Add the `is_stub` and `set_is_stub` methods on `struct type`, in order to remove the `TYPE_STUB` macro. In this patch, the macro is changed to use the getter, so all the call sites of the macro that are used as a setter are changed to use the setter method directly. The next patch will remove the macro completely. gdb/ChangeLog: * gdbtypes.h (struct type) : New methods. (TYPE_STUB): Use type::is_stub, change all write call sites to use type::set_is_stub. Change-Id: Ie935e8fe72c908afd8718411e83f4ff00c386bf3 --- gdb/dwarf2/read.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'gdb/dwarf2') diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c index 267cf0f..f17401e 100644 --- a/gdb/dwarf2/read.c +++ b/gdb/dwarf2/read.c @@ -16081,18 +16081,18 @@ read_structure_type (struct die_info *die, struct dwarf2_cu *cu) { /* ICC<14 does not output the required DW_AT_declaration on incomplete types, but gives them a size of zero. */ - TYPE_STUB (type) = 1; + type->set_is_stub (true); } else TYPE_STUB_SUPPORTED (type) = 1; if (die_is_declaration (die, cu)) - TYPE_STUB (type) = 1; + type->set_is_stub (true); else if (attr == NULL && die->child == NULL && producer_is_realview (cu->producer)) /* RealView does not output the required DW_AT_declaration on incomplete types. */ - TYPE_STUB (type) = 1; + type->set_is_stub (true); /* We need to add the type field to the die immediately so we don't infinitely recurse when dealing with pointers to the structure @@ -16631,7 +16631,7 @@ read_enumeration_type (struct die_info *die, struct dwarf2_cu *cu) Types. When another package uses such a type, an incomplete DIE may be generated by the compiler. */ if (die_is_declaration (die, cu)) - TYPE_STUB (type) = 1; + type->set_is_stub (true); /* If this type has an underlying type that is not a stub, then we may use its attributes. We always use the "unsigned" attribute @@ -18444,7 +18444,7 @@ read_unspecified_type (struct die_info *die, struct dwarf2_cu *cu) such a type, we treat it as a stub, and try to resolve it later on, when needed. */ if (cu->language == language_ada) - TYPE_STUB (type) = 1; + type->set_is_stub (true); return set_die_type (die, type, cu); } -- cgit v1.1