From d21839680655c071a811de1d7b41f8d7de4fc462 Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Mon, 14 Sep 2020 11:08:00 -0400 Subject: gdb: remove TYPE_TARGET_STUB gdb/ChangeLog: * gdbtypes.h (TYPE_TARGET_STUB): Remove, replace all uses with type::target_is_stub. Change-Id: I3e7dadcb485d991af68a1e93693e3895b0e755d5 --- gdb/ChangeLog | 5 +++++ gdb/gdbtypes.c | 6 +++--- gdb/gdbtypes.h | 14 ++++++-------- 3 files changed, 14 insertions(+), 11 deletions(-) (limited to 'gdb') diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 644d700..376bb9d 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,10 @@ 2020-09-14 Simon Marchi + * gdbtypes.h (TYPE_TARGET_STUB): Remove, replace all + uses with type::target_is_stub. + +2020-09-14 Simon Marchi + * gdbtypes.h (struct type) : New methods. (TYPE_TARGET_STUB): Use type::is_stub, change all write call diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c index 6dc073f..91f3ed8 100644 --- a/gdb/gdbtypes.c +++ b/gdb/gdbtypes.c @@ -2864,11 +2864,11 @@ check_typedef (struct type *type) } } - if (TYPE_TARGET_STUB (type)) + if (type->target_is_stub ()) { struct type *target_type = check_typedef (TYPE_TARGET_TYPE (type)); - if (target_type->is_stub () || TYPE_TARGET_STUB (target_type)) + if (target_type->is_stub () || target_type->target_is_stub ()) { /* Nothing we can do. */ } @@ -5080,7 +5080,7 @@ recursive_dump_type (struct type *type, int spaces) { puts_filtered (" TYPE_STUB"); } - if (TYPE_TARGET_STUB (type)) + if (type->target_is_stub ()) { puts_filtered (" TYPE_TARGET_STUB"); } diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h index c6c2518..e03564c 100644 --- a/gdb/gdbtypes.h +++ b/gdb/gdbtypes.h @@ -216,14 +216,6 @@ DEF_ENUM_FLAGS_TYPE (enum type_instance_flag_value, type_instance_flags); #define TYPE_ENDIANITY_NOT_DEFAULT(t) (TYPE_MAIN_TYPE (t)->flag_endianity_not_default) -/* * The target type of this type is a stub type, and this type needs - to be updated if it gets un-stubbed in check_typedef. Used for - arrays and ranges, in which TYPE_LENGTH of the array/range gets set - based on the TYPE_LENGTH of the target type. Also, set for - TYPE_CODE_TYPEDEF. */ - -#define TYPE_TARGET_STUB(t) ((t)->target_is_stub ()) - /* * This is a function type which appears to have a prototype. We need this for function calls in order to tell us if it's necessary to coerce the args, or to just do the standard conversions. This @@ -1092,6 +1084,12 @@ struct type this->main_type->m_flag_stub = is_stub; } + /* The target type of this type is a stub type, and this type needs + to be updated if it gets un-stubbed in check_typedef. Used for + arrays and ranges, in which TYPE_LENGTH of the array/range gets set + based on the TYPE_LENGTH of the target type. Also, set for + TYPE_CODE_TYPEDEF. */ + bool target_is_stub () const { return this->main_type->m_flag_target_stub; -- cgit v1.1