diff options
author | Simon Marchi <simon.marchi@efficios.com> | 2020-05-16 12:15:54 -0400 |
---|---|---|
committer | Simon Marchi <simon.marchi@efficios.com> | 2020-05-16 12:36:05 -0400 |
commit | d0e39ea27cde07011967ab74d39cf13dfe3370c4 (patch) | |
tree | 582ea33260f21ba7bce52e063162fb0c83cd8b0b /gdb/stabsread.c | |
parent | 2dab0c7ba0d69bcc16cfe58da279ce915ef24348 (diff) | |
download | gdb-d0e39ea27cde07011967ab74d39cf13dfe3370c4.zip gdb-d0e39ea27cde07011967ab74d39cf13dfe3370c4.tar.gz gdb-d0e39ea27cde07011967ab74d39cf13dfe3370c4.tar.bz2 |
gdb: add type::name / type::set_name
Add the `name` and `set_name` methods on `struct type`, in order to
remove the `TYPE_NAME` macro. In this patch, the `TYPE_NAME` macro is
changed to use `type::name`, so all the call sites that are used to set
the type name are changed to use `type::set_name`. The next patch will
remove `TYPE_NAME` completely.
gdb/ChangeLog:
* gdbtypes.h (struct type) <name, set_name>: New methods.
(TYPE_CODE): Use type::name. Change all call sites used to set
the name to use type::set_name instead.
Diffstat (limited to 'gdb/stabsread.c')
-rw-r--r-- | gdb/stabsread.c | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/gdb/stabsread.c b/gdb/stabsread.c index 716b5f3..12e164c 100644 --- a/gdb/stabsread.c +++ b/gdb/stabsread.c @@ -1294,12 +1294,10 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type, /* Pascal accepts names for pointer types. */ if (get_current_subfile ()->language == language_pascal) - { - TYPE_NAME (SYMBOL_TYPE (sym)) = sym->linkage_name (); - } + SYMBOL_TYPE (sym)->set_name (sym->linkage_name ()); } else - TYPE_NAME (SYMBOL_TYPE (sym)) = sym->linkage_name (); + SYMBOL_TYPE (sym)->set_name (sym->linkage_name ()); } add_symbol_to_list (sym, get_file_symbols ()); @@ -1314,12 +1312,12 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type, SYMBOL_VALUE (struct_sym) = valu; SYMBOL_DOMAIN (struct_sym) = STRUCT_DOMAIN; if (TYPE_NAME (SYMBOL_TYPE (sym)) == 0) - TYPE_NAME (SYMBOL_TYPE (sym)) - = obconcat (&objfile->objfile_obstack, sym->linkage_name (), - (char *) NULL); + SYMBOL_TYPE (sym)->set_name + (obconcat (&objfile->objfile_obstack, sym->linkage_name (), + (char *) NULL)); add_symbol_to_list (struct_sym, get_file_symbols ()); } - + break; case 'T': @@ -1341,9 +1339,9 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type, SYMBOL_VALUE (sym) = valu; SYMBOL_DOMAIN (sym) = STRUCT_DOMAIN; if (TYPE_NAME (SYMBOL_TYPE (sym)) == 0) - TYPE_NAME (SYMBOL_TYPE (sym)) - = obconcat (&objfile->objfile_obstack, sym->linkage_name (), - (char *) NULL); + SYMBOL_TYPE (sym)->set_name + (obconcat (&objfile->objfile_obstack, sym->linkage_name (), + (char *) NULL)); add_symbol_to_list (sym, get_file_symbols ()); if (synonym) @@ -1356,9 +1354,9 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type, SYMBOL_VALUE (typedef_sym) = valu; SYMBOL_DOMAIN (typedef_sym) = VAR_DOMAIN; if (TYPE_NAME (SYMBOL_TYPE (sym)) == 0) - TYPE_NAME (SYMBOL_TYPE (sym)) - = obconcat (&objfile->objfile_obstack, sym->linkage_name (), - (char *) NULL); + SYMBOL_TYPE (sym)->set_name + (obconcat (&objfile->objfile_obstack, sym->linkage_name (), + (char *) NULL)); add_symbol_to_list (typedef_sym, get_file_symbols ()); } break; @@ -1688,7 +1686,7 @@ again: type. */ type = dbx_alloc_type (typenums, objfile); type->set_code (code); - TYPE_NAME (type) = type_name; + type->set_name (type_name); INIT_CPLUS_SPECIFIC (type); TYPE_STUB (type) = 1; @@ -1752,7 +1750,7 @@ again: "complete_this_type" function, but never create unnecessary copies of a type otherwise. */ replace_type (type, xtype); - TYPE_NAME (type) = NULL; + type->set_name (NULL); } else { |