diff options
author | Tom Tromey <tom@tromey.com> | 2018-04-17 13:51:24 -0600 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2018-06-01 10:19:55 -0600 |
commit | e86ca25fd6cc06488c9dda936cf83f0fcdf6b58b (patch) | |
tree | e7cd08ab978fa972959ac445c3799e9ccbf0ebc0 /gdb/gdbtypes.h | |
parent | c1ec8cea7ff53eb76cb7c354b813c67fde755409 (diff) | |
download | binutils-gdb-e86ca25fd6cc06488c9dda936cf83f0fcdf6b58b.tar.gz |
Remove TYPE_TAG_NAME
TYPE_TAG_NAME has been an occasional source of confusion and bugs. It
seems to me that it is only useful for C and C++ -- but even there,
not so much, because at least with DWARF there doesn't seem to be any
way to wind up with a type where the name and the tag name are both
non-NULL and different.
So, this patch removes TYPE_TAG_NAME entirely. This should save a
little memory, but more importantly, it simplifies this part of gdb.
A few minor test suite adjustments were needed. In some situations
the new code does not yield identical output to the old code.
gdb/ChangeLog
2018-06-01 Tom Tromey <tom@tromey.com>
* valops.c (enum_constant_from_type, value_namespace_elt)
(value_maybe_namespace_elt): Update.
* valarith.c (find_size_for_pointer_math): Update.
* target-descriptions.c (make_gdb_type): Update.
* symmisc.c (print_symbol): Update.
* stabsread.c (define_symbol, read_type)
(complain_about_struct_wipeout, add_undefined_type)
(cleanup_undefined_types_1): Update.
* rust-lang.c (rust_tuple_type_p, rust_slice_type_p)
(rust_range_type_p, val_print_struct, rust_print_struct_def)
(rust_internal_print_type, rust_composite_type)
(rust_evaluate_funcall, rust_evaluate_subexp)
(rust_inclusive_range_type_p): Update.
* python/py-type.c (typy_get_tag): Update.
* p-typeprint.c (pascal_type_print_base): Update.
* mdebugread.c (parse_symbol, parse_type): Update.
* m2-typeprint.c (m2_long_set, m2_record_fields, m2_enum):
Update.
* guile/scm-type.c (gdbscm_type_tag): Update.
* go-lang.c (sixg_string_p): Update.
* gnu-v3-abi.c (build_gdb_vtable_type, build_std_type_info_type):
Update.
* gdbtypes.h (struct main_type) <tag_name>: Remove.
(TYPE_TAG_NAME): Remove.
* gdbtypes.c (type_name_no_tag): Simplify.
(check_typedef, check_types_equal, recursive_dump_type)
(copy_type_recursive, arch_composite_type): Update.
* f-typeprint.c (f_type_print_base): Update. Print "Type" prefix
in summary mode when needed.
* eval.c (evaluate_funcall): Update.
* dwarf2read.c (fixup_go_packaging, read_structure_type)
(process_structure_scope, read_enumeration_type)
(read_namespace_type, read_module_type, determine_prefix): Update.
* cp-support.c (inspect_type): Update.
* coffread.c (process_coff_symbol, decode_base_type): Update.
* c-varobj.c (c_is_path_expr_parent): Update.
* c-typeprint.c (c_type_print_base_struct_union): Update.
(c_type_print_base_1): Update. Print struct/class/union/enum in
summary when using C language.
* ax-gdb.c (gen_struct_ref, gen_namespace_elt)
(gen_maybe_namespace_elt): Update.
* ada-lang.c (ada_type_name): Simplify.
(empty_record, ada_template_to_fixed_record_type_1)
(template_to_static_fixed_type)
(to_record_with_fixed_variant_part, ada_check_typedef): Update.
gdb/testsuite/ChangeLog
2018-06-01 Tom Tromey <tom@tromey.com>
* gdb.xml/tdesc-regs.exp (load_description): Update expected
results.
* gdb.dwarf2/method-ptr.exp: Set language to C++.
* gdb.dwarf2/member-ptr-forwardref.exp: Set language to C++.
* gdb.cp/typeid.exp (do_typeid_tests): Update type_re.
* gdb.base/maint.exp (maint_pass_if): Update.
Diffstat (limited to 'gdb/gdbtypes.h')
-rw-r--r-- | gdb/gdbtypes.h | 21 |
1 files changed, 3 insertions, 18 deletions
diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h index 2a1ed609d18..1399b8efc13 100644 --- a/gdb/gdbtypes.h +++ b/gdb/gdbtypes.h @@ -721,26 +721,12 @@ struct main_type /* * Name of this type, or NULL if none. - This is used for printing only, except by poorly designed C++ - code. For looking up a name, look for a symbol in the - VAR_DOMAIN. This is generally allocated in the objfile's - obstack. However coffread.c uses malloc. */ + This is used for printing only. For looking up a name, look for + a symbol in the VAR_DOMAIN. This is generally allocated in the + objfile's obstack. However coffread.c uses malloc. */ const char *name; - /* * Tag name for this type, or NULL if none. This means that the - name of the type consists of a keyword followed by the tag name. - Which keyword is determined by the type code ("struct" for - TYPE_CODE_STRUCT, etc.). As far as I know C/C++ are the only - languages with this feature. - - This is used for printing only, except by poorly designed C++ code. - For looking up a name, look for a symbol in the STRUCT_DOMAIN. - One more legitimate use is that if TYPE_STUB is set, this is - the name to use to look for definitions in other files. */ - - const char *tag_name; - /* * Every type is now associated with a particular objfile, and the type is allocated on the objfile_obstack for that objfile. One problem however, is that there are times when gdb allocates new @@ -1293,7 +1279,6 @@ extern void allocate_gnat_aux_type (struct type *); #define TYPE_INSTANCE_FLAGS(thistype) (thistype)->instance_flags #define TYPE_MAIN_TYPE(thistype) (thistype)->main_type #define TYPE_NAME(thistype) TYPE_MAIN_TYPE(thistype)->name -#define TYPE_TAG_NAME(type) TYPE_MAIN_TYPE(type)->tag_name #define TYPE_TARGET_TYPE(thistype) TYPE_MAIN_TYPE(thistype)->target_type #define TYPE_POINTER_TYPE(thistype) (thistype)->pointer_type #define TYPE_REFERENCE_TYPE(thistype) (thistype)->reference_type |