+2019-11-27 Christian Biesinger <cbiesinger@google.com>
+
+ * ada-exp.y (write_ambiguous_var): Replace SYMBOL_SET_LINKAGE_NAME
+ with sym->set_linkage_name.
+ * coffread.c (coff_read_enum_type): Likewise.
+ * mdebugread.c (parse_symbol): Likewise.
+ * stabsread.c (patch_block_stabs): Likewise.
+ (define_symbol): Likewise.
+ (read_enum_type): Likewise.
+ (common_block_end): Likewise.
+ * symtab.h (struct general_symbol_info) <set_linkage_name>: New
+ function.
+ (SYMBOL_SET_LINKAGE_NAME): Remove.
+ * xcoffread.c (process_xcoff_symbol): Replace SYMBOL_SET_LINKAGE_NAME
+ with sym->set_linkage_name.
+
2019-11-27 Andrew Burgess <andrew.burgess@embecosm.com>
* mi/mi-cmds.c (mi_cmds): Add 'symbol-info-modules' entry.
struct symbol *sym = new (&temp_parse_space) symbol ();
SYMBOL_DOMAIN (sym) = UNDEF_DOMAIN;
- SYMBOL_SET_LINKAGE_NAME (sym,
- obstack_strndup (&temp_parse_space, name, len));
+ sym->set_linkage_name (obstack_strndup (&temp_parse_space, name, len));
SYMBOL_LANGUAGE (sym) = language_ada;
write_exp_elt_opcode (par_state, OP_VAR_VALUE);
sym = allocate_symbol (objfile);
name = obstack_strdup (&objfile->objfile_obstack, name);
- SYMBOL_SET_LINKAGE_NAME (sym, name);
+ sym->set_linkage_name (name);
SYMBOL_ACLASS_INDEX (sym) = LOC_CONST;
SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
SYMBOL_VALUE (sym) = ms->c_value;
FIELD_BITSIZE (*f) = 0;
enum_sym = allocate_symbol (mdebugread_objfile);
- SYMBOL_SET_LINKAGE_NAME
- (enum_sym,
- obstack_strdup (&mdebugread_objfile->objfile_obstack,
+ enum_sym->set_linkage_name
+ (obstack_strdup (&mdebugread_objfile->objfile_obstack,
f->name));
SYMBOL_ACLASS_INDEX (enum_sym) = LOC_CONST;
SYMBOL_TYPE (enum_sym) = t;
sym = allocate_symbol (objfile);
SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
SYMBOL_ACLASS_INDEX (sym) = LOC_OPTIMIZED_OUT;
- SYMBOL_SET_LINKAGE_NAME
- (sym, obstack_strndup (&objfile->objfile_obstack,
- name, pp - name));
+ sym->set_linkage_name
+ (obstack_strndup (&objfile->objfile_obstack, name, pp - name));
pp += 2;
if (*(pp - 1) == 'F' || *(pp - 1) == 'f')
{
switch (string[1])
{
case 't':
- SYMBOL_SET_LINKAGE_NAME (sym, "this");
+ sym->set_linkage_name ("this");
break;
case 'v': /* $vtbl_ptr_type */
goto normal;
case 'e':
- SYMBOL_SET_LINKAGE_NAME (sym, "eh_throw");
+ sym->set_linkage_name ("eh_throw");
break;
case '_':
const char *new_name = gdbarch_static_transform_name
(gdbarch, sym->linkage_name ());
- SYMBOL_SET_LINKAGE_NAME (sym, new_name);
+ sym->set_linkage_name (new_name);
SET_SYMBOL_VALUE_ADDRESS (sym,
BMSYMBOL_VALUE_ADDRESS (msym));
}
const char *new_name = gdbarch_static_transform_name
(gdbarch, sym->linkage_name ());
- SYMBOL_SET_LINKAGE_NAME (sym, new_name);
+ sym->set_linkage_name (new_name);
SET_SYMBOL_VALUE_ADDRESS (sym, BMSYMBOL_VALUE_ADDRESS (msym));
}
}
return error_type (pp, objfile);
sym = allocate_symbol (objfile);
- SYMBOL_SET_LINKAGE_NAME (sym, name);
+ sym->set_linkage_name (name);
SYMBOL_SET_LANGUAGE (sym, get_current_subfile ()->language,
&objfile->objfile_obstack);
SYMBOL_ACLASS_INDEX (sym) = LOC_CONST;
sym = allocate_symbol (objfile);
/* Note: common_block_name already saved on objfile_obstack. */
- SYMBOL_SET_LINKAGE_NAME (sym, common_block_name);
+ sym->set_linkage_name (common_block_name);
SYMBOL_ACLASS_INDEX (sym) = LOC_BLOCK;
/* Now we copy all the symbols which have been defined since the BCOMM. */
returns the same value (same pointer) as linkage_name (). */
const char *search_name () const;
+ /* Set just the linkage name of a symbol; do not try to demangle
+ it. Used for constructs which do not have a mangled name,
+ e.g. struct tags. Unlike SYMBOL_SET_NAMES, linkage_name must
+ be terminated and either already on the objfile's obstack or
+ permanently allocated. */
+ void set_linkage_name (const char *linkage_name)
+ { name = linkage_name; }
+
/* Name of the symbol. This is a required field. Storage for the
name is allocated on the objfile_obstack for the associated
objfile. For languages like C++ that make a distinction between
enum language language,
struct obstack *obstack);
-
/* Try to determine the demangled name for a symbol, based on the
language of that symbol. If the language is set to language_auto,
it will attempt to find any demangling algorithm that works and
extern char *symbol_find_demangled_name (struct general_symbol_info *gsymbol,
const char *mangled);
-/* Set just the linkage name of a symbol; do not try to demangle
- it. Used for constructs which do not have a mangled name,
- e.g. struct tags. Unlike SYMBOL_SET_NAMES, linkage_name must
- be terminated and either already on the objfile's obstack or
- permanently allocated. */
-#define SYMBOL_SET_LINKAGE_NAME(symbol,linkage_name) \
- (symbol)->name = (linkage_name)
-
/* Set the linkage and natural names of a symbol, by demangling
the linkage name. If linkage_name may not be nullterminated,
copy_name must be set to true. */
will be patched with the type from its stab entry later on in
patch_block_stabs (), unless the file was compiled without -g. */
- SYMBOL_SET_LINKAGE_NAME (sym, SYMNAME_ALLOC (name, symname_alloced));
+ sym->set_linkage_name (SYMNAME_ALLOC (name, symname_alloced));
SYMBOL_TYPE (sym) = objfile_type (objfile)->nodebug_text_symbol;
SYMBOL_ACLASS_INDEX (sym) = LOC_BLOCK;