@@ -1105,7 +1105,8 @@
struct symbol *sym = new (&temp_parse_space) symbol ();
SYMBOL_DOMAIN (sym) = UNDEF_DOMAIN;
- SYMBOL_LINKAGE_NAME (sym) = obstack_strndup (&temp_parse_space, name, len);
+ SYMBOL_SET_LINKAGE_NAME (sym,
+ obstack_strndup (&temp_parse_space, name, len));
SYMBOL_LANGUAGE (sym) = language_ada;
write_exp_elt_opcode (par_state, OP_VAR_VALUE);
@@ -3201,8 +3201,8 @@
for (j = i - 1; j >= 0; j -= 1)
{
- if (encoded_ordered_before (SYMBOL_LINKAGE_NAME (syms[j].symbol),
- SYMBOL_LINKAGE_NAME (sym.symbol)))
+ if (encoded_ordered_before (syms[j].symbol->linkage_name (),
+ sym.symbol->linkage_name ()))
break;
syms[j + 1] = syms[j];
}
@@ -3225,7 +3225,7 @@
{
struct type *type = SYMBOL_TYPE (sym);
- fprintf_filtered (stream, "%s", SYMBOL_PRINT_NAME (sym));
+ fprintf_filtered (stream, "%s", sym->print_name ());
if (!print_signatures
|| type == NULL
|| TYPE_CODE (type) != TYPE_CODE_FUNC)
@@ -3431,7 +3431,7 @@
ada_print_type (SYMBOL_TYPE (syms[i].symbol), NULL,
gdb_stdout, -1, 0, &type_print_raw_options);
printf_filtered (_("'(%s) (enumeral)\n"),
- SYMBOL_PRINT_NAME (syms[i].symbol));
+ syms[i].symbol->print_name ());
}
else
{
@@ -3675,8 +3675,7 @@
int n_candidates;
n_candidates =
- ada_lookup_symbol_list (SYMBOL_LINKAGE_NAME
- (exp->elts[pc + 2].symbol),
+ ada_lookup_symbol_list (exp->elts[pc + 2].symbol->linkage_name (),
exp->elts[pc + 1].block, VAR_DOMAIN,
&candidates);
@@ -3718,7 +3717,7 @@
if (n_candidates == 0)
error (_("No definition found for %s"),
- SYMBOL_PRINT_NAME (exp->elts[pc + 2].symbol));
+ exp->elts[pc + 2].symbol->print_name ());
else if (n_candidates == 1)
i = 0;
else if (deprocedure_p
@@ -3726,16 +3725,16 @@
{
i = ada_resolve_function
(candidates.data (), n_candidates, NULL, 0,
- SYMBOL_LINKAGE_NAME (exp->elts[pc + 2].symbol),
+ exp->elts[pc + 2].symbol->linkage_name (),
context_type, parse_completion);
if (i < 0)
error (_("Could not find a match for %s"),
- SYMBOL_PRINT_NAME (exp->elts[pc + 2].symbol));
+ exp->elts[pc + 2].symbol->print_name ());
}
else
{
printf_filtered (_("Multiple matches for %s\n"),
- SYMBOL_PRINT_NAME (exp->elts[pc + 2].symbol));
+ exp->elts[pc + 2].symbol->print_name ());
user_select_syms (candidates.data (), n_candidates, 1);
i = 0;
}
@@ -3765,8 +3764,7 @@
int n_candidates;
n_candidates =
- ada_lookup_symbol_list (SYMBOL_LINKAGE_NAME
- (exp->elts[pc + 5].symbol),
+ ada_lookup_symbol_list (exp->elts[pc + 5].symbol->linkage_name (),
exp->elts[pc + 4].block, VAR_DOMAIN,
&candidates);
@@ -3777,11 +3775,11 @@
i = ada_resolve_function
(candidates.data (), n_candidates,
argvec, nargs,
- SYMBOL_LINKAGE_NAME (exp->elts[pc + 5].symbol),
+ exp->elts[pc + 5].symbol->linkage_name (),
context_type, parse_completion);
if (i < 0)
error (_("Could not find a match for %s"),
- SYMBOL_PRINT_NAME (exp->elts[pc + 5].symbol));
+ exp->elts[pc + 5].symbol->print_name ());
}
exp->elts[pc + 4].block = candidates[i].block;
@@ -4264,7 +4262,7 @@
case LOC_STATIC:
case LOC_COMPUTED:
case LOC_OPTIMIZED_OUT:
- info = strstr (SYMBOL_LINKAGE_NAME (sym), "___XR");
+ info = strstr (sym->linkage_name (), "___XR");
if (info == NULL)
return ADA_NOT_RENAMING;
switch (info[5])
@@ -4313,7 +4311,7 @@
{
const char *sym_name;
- sym_name = SYMBOL_LINKAGE_NAME (renaming_sym);
+ sym_name = renaming_sym->linkage_name ();
expression_up expr = parse_exp_1 (&sym_name, 0, block, 0);
return evaluate_expression (expr.get ());
}
@@ -4834,8 +4832,8 @@
{
struct type *type0 = SYMBOL_TYPE (sym0);
struct type *type1 = SYMBOL_TYPE (sym1);
- const char *name0 = SYMBOL_LINKAGE_NAME (sym0);
- const char *name1 = SYMBOL_LINKAGE_NAME (sym1);
+ const char *name0 = sym0->linkage_name ();
+ const char *name1 = sym1->linkage_name ();
int len0 = strlen (name0);
return
@@ -4850,8 +4848,8 @@
case LOC_STATIC:
{
- const char *name0 = SYMBOL_LINKAGE_NAME (sym0);
- const char *name1 = SYMBOL_LINKAGE_NAME (sym1);
+ const char *name0 = sym0->linkage_name ();
+ const char *name1 = sym1->linkage_name ();
return (strcmp (name0, name1) == 0
&& SYMBOL_VALUE_ADDRESS (sym0) == SYMBOL_VALUE_ADDRESS (sym1));
}
@@ -5112,15 +5110,15 @@
the get rid of the stub. */
if (TYPE_STUB (SYMBOL_TYPE ((*syms)[i].symbol))
- && SYMBOL_LINKAGE_NAME ((*syms)[i].symbol) != NULL)
+ && (*syms)[i].symbol->linkage_name () != NULL)
{
for (j = 0; j < syms->size (); j++)
{
if (j != i
&& !TYPE_STUB (SYMBOL_TYPE ((*syms)[j].symbol))
- && SYMBOL_LINKAGE_NAME ((*syms)[j].symbol) != NULL
- && strcmp (SYMBOL_LINKAGE_NAME ((*syms)[i].symbol),
- SYMBOL_LINKAGE_NAME ((*syms)[j].symbol)) == 0)
+ && (*syms)[j].symbol->linkage_name () != NULL
+ && strcmp ((*syms)[i].symbol->linkage_name (),
+ (*syms)[j].symbol->linkage_name ()) == 0)
remove_p = 1;
}
}
@@ -5128,16 +5126,16 @@
/* Two symbols with the same name, same class and same address
should be identical. */
- else if (SYMBOL_LINKAGE_NAME ((*syms)[i].symbol) != NULL
+ else if ((*syms)[i].symbol->linkage_name () != NULL
&& SYMBOL_CLASS ((*syms)[i].symbol) == LOC_STATIC
&& is_nondebugging_type (SYMBOL_TYPE ((*syms)[i].symbol)))
{
for (j = 0; j < syms->size (); j += 1)
{
if (i != j
- && SYMBOL_LINKAGE_NAME ((*syms)[j].symbol) != NULL
- && strcmp (SYMBOL_LINKAGE_NAME ((*syms)[i].symbol),
- SYMBOL_LINKAGE_NAME ((*syms)[j].symbol)) == 0
+ && (*syms)[j].symbol->linkage_name () != NULL
+ && strcmp ((*syms)[i].symbol->linkage_name (),
+ (*syms)[j].symbol->linkage_name ()) == 0
&& SYMBOL_CLASS ((*syms)[i].symbol)
== SYMBOL_CLASS ((*syms)[j].symbol)
&& SYMBOL_VALUE_ADDRESS ((*syms)[i].symbol)
@@ -5314,7 +5312,7 @@
if (sym == NULL || SYMBOL_CLASS (sym) == LOC_TYPEDEF)
continue;
- name = SYMBOL_LINKAGE_NAME (sym);
+ name = sym->linkage_name ();
suffix = strstr (name, "___XR");
if (suffix != NULL)
@@ -5325,7 +5323,7 @@
is_new_style_renaming = 1;
for (j = 0; j < syms->size (); j += 1)
if (i != j && (*syms)[j].symbol != NULL
- && strncmp (name, SYMBOL_LINKAGE_NAME ((*syms)[j].symbol),
+ && strncmp (name, (*syms)[j].symbol->linkage_name (),
name_len) == 0
&& block == (*syms)[j].block)
(*syms)[j].symbol = NULL;
@@ -5354,7 +5352,7 @@
if (current_function == NULL)
return syms->size ();
- current_function_name = SYMBOL_LINKAGE_NAME (current_function);
+ current_function_name = current_function->linkage_name ();
if (current_function_name == NULL)
return syms->size ();
@@ -6267,17 +6265,17 @@
{
int cmp;
- cmp = (int) '_' - (int) SYMBOL_LINKAGE_NAME (sym)[0];
+ cmp = (int) '_' - (int) sym->linkage_name ()[0];
if (cmp == 0)
{
- cmp = !startswith (SYMBOL_LINKAGE_NAME (sym), "_ada_");
+ cmp = !startswith (sym->linkage_name (), "_ada_");
if (cmp == 0)
- cmp = strncmp (name, SYMBOL_LINKAGE_NAME (sym) + 5,
+ cmp = strncmp (name, sym->linkage_name () + 5,
name_len);
}
if (cmp == 0
- && is_name_suffix (SYMBOL_LINKAGE_NAME (sym) + name_len + 5))
+ && is_name_suffix (sym->linkage_name () + name_len + 5))
{
if (SYMBOL_CLASS (sym) != LOC_UNRESOLVED)
{
@@ -6469,7 +6467,7 @@
completion_list_add_name (tracker,
SYMBOL_LANGUAGE (sym),
- SYMBOL_LINKAGE_NAME (sym),
+ sym->linkage_name (),
lookup_name, text, word);
}
}
@@ -6490,7 +6488,7 @@
completion_list_add_name (tracker,
SYMBOL_LANGUAGE (sym),
- SYMBOL_LINKAGE_NAME (sym),
+ sym->linkage_name (),
lookup_name, text, word);
}
}
@@ -6512,7 +6510,7 @@
completion_list_add_name (tracker,
SYMBOL_LANGUAGE (sym),
- SYMBOL_LINKAGE_NAME (sym),
+ sym->linkage_name (),
lookup_name, text, word);
}
}
@@ -7856,7 +7854,7 @@
static bool
ada_is_renaming_symbol (struct symbol *name_sym)
{
- const char *name = SYMBOL_LINKAGE_NAME (name_sym);
+ const char *name = name_sym->linkage_name ();
return strstr (name, "___XR") != NULL;
}
@@ -9945,7 +9943,7 @@
name = &exp->elts[choice_pos + 2].string;
break;
case OP_VAR_VALUE:
- name = SYMBOL_NATURAL_NAME (exp->elts[choice_pos + 2].symbol);
+ name = exp->elts[choice_pos + 2].symbol->natural_name ();
break;
default:
error (_("Invalid record component association."));
@@ -10610,7 +10608,7 @@
context other than a function call, in which case, it is
invalid. */
error (_("Unexpected unresolved symbol, %s, during evaluation"),
- SYMBOL_PRINT_NAME (exp->elts[pc + 2].symbol));
+ exp->elts[pc + 2].symbol->print_name ());
if (noside == EVAL_AVOID_SIDE_EFFECTS)
{
@@ -10700,7 +10698,7 @@
if (exp->elts[*pos].opcode == OP_VAR_VALUE
&& SYMBOL_DOMAIN (exp->elts[pc + 5].symbol) == UNDEF_DOMAIN)
error (_("Unexpected unresolved symbol, %s, during evaluation"),
- SYMBOL_PRINT_NAME (exp->elts[pc + 5].symbol));
+ exp->elts[pc + 5].symbol->print_name ());
else
{
for (tem = 0; tem <= nargs; tem += 1)
@@ -11923,7 +11921,7 @@
if (SYMBOL_CLASS (sym) != LOC_BLOCK)
{
error (_("Symbol \"%s\" is not a function (class = %d)"),
- SYMBOL_LINKAGE_NAME (sym), SYMBOL_CLASS (sym));
+ sym->linkage_name (), SYMBOL_CLASS (sym));
return 0;
}
@@ -11946,7 +11944,7 @@
if (SYMBOL_CLASS (sym) != LOC_BLOCK)
{
error (_("Symbol \"%s\" is not a function (class = %d)"),
- SYMBOL_LINKAGE_NAME (sym), SYMBOL_CLASS (sym));
+ sym->linkage_name (), SYMBOL_CLASS (sym));
return 0;
}
@@ -13141,13 +13139,13 @@
return 0;
for (i = 0; i < ARRAY_SIZE (standard_exc); i++)
- if (strcmp (SYMBOL_LINKAGE_NAME (sym), standard_exc[i]) == 0)
+ if (strcmp (sym->linkage_name (), standard_exc[i]) == 0)
return 0; /* A standard exception. */
/* Numeric_Error is also a standard exception, so exclude it.
See the STANDARD_EXC description for more details as to why
this exception is not listed in that array. */
- if (strcmp (SYMBOL_LINKAGE_NAME (sym), "numeric_error") == 0)
+ if (strcmp (sym->linkage_name (), "numeric_error") == 0)
return 0;
return 1;
@@ -13260,7 +13258,7 @@
default:
if (ada_is_exception_sym (sym))
{
- struct ada_exc_info info = {SYMBOL_PRINT_NAME (sym),
+ struct ada_exc_info info = {sym->print_name (),
SYMBOL_VALUE_ADDRESS (sym)};
exceptions->push_back (info);
@@ -13333,10 +13331,10 @@
ALL_BLOCK_SYMBOLS (b, iter, sym)
if (ada_is_non_standard_exception_sym (sym)
- && name_matches_regex (SYMBOL_NATURAL_NAME (sym), preg))
+ && name_matches_regex (sym->natural_name (), preg))
{
struct ada_exc_info info
- = {SYMBOL_PRINT_NAME (sym), SYMBOL_VALUE_ADDRESS (sym)};
+ = {sym->print_name (), SYMBOL_VALUE_ADDRESS (sym)};
exceptions->push_back (info);
}
@@ -13664,7 +13662,7 @@
return;
case OP_VAR_VALUE:
- fputs_filtered (SYMBOL_NATURAL_NAME (exp->elts[pc + 2].symbol), stream);
+ fputs_filtered (exp->elts[pc + 2].symbol->natural_name (), stream);
return;
case BINOP_IN_BOUNDS:
@@ -675,7 +675,7 @@
case LOC_TYPEDEF:
error (_("Cannot compute value of typedef `%s'."),
- SYMBOL_PRINT_NAME (var));
+ var->print_name ());
break;
case LOC_BLOCK:
@@ -705,10 +705,10 @@
case LOC_UNRESOLVED:
{
struct bound_minimal_symbol msym
- = lookup_minimal_symbol (SYMBOL_LINKAGE_NAME (var), NULL, NULL);
+ = lookup_minimal_symbol (var->linkage_name (), NULL, NULL);
if (!msym.minsym)
- error (_("Couldn't resolve symbol `%s'."), SYMBOL_PRINT_NAME (var));
+ error (_("Couldn't resolve symbol `%s'."), var->print_name ());
/* Push the address of the variable. */
ax_const_l (ax, BMSYMBOL_VALUE_ADDRESS (msym));
@@ -727,7 +727,7 @@
default:
error (_("Cannot find value of botched symbol `%s'."),
- SYMBOL_PRINT_NAME (var));
+ var->print_name ());
break;
}
}
@@ -1658,7 +1658,7 @@
if (value->optimized_out)
error (_("`%s' has been optimized out, cannot use"),
- SYMBOL_PRINT_NAME (sym.symbol));
+ sym.symbol->print_name ());
return 1;
}
@@ -1784,7 +1784,7 @@
if (value->optimized_out)
error (_("`%s' has been optimized out, cannot use"),
- SYMBOL_PRINT_NAME ((*pc)[2].symbol));
+ (*pc)[2].symbol->print_name ());
}
else
gen_msym_var_ref (ax, value, (*pc)[2].msymbol, (*pc)[1].objfile);
@@ -2008,10 +2008,10 @@
if (value->optimized_out)
error (_("`%s' has been optimized out, cannot use"),
- SYMBOL_PRINT_NAME ((*pc)[2].symbol));
+ (*pc)[2].symbol->print_name ());
if (TYPE_CODE (value->type) == TYPE_CODE_ERROR)
- error_unknown_type (SYMBOL_PRINT_NAME ((*pc)[2].symbol));
+ error_unknown_type ((*pc)[2].symbol->print_name ());
(*pc) += 4;
break;
@@ -2240,7 +2240,7 @@
if (value->optimized_out)
error (_("`%s' has been optimized out, cannot use"),
- SYMBOL_PRINT_NAME (sym));
+ sym->print_name ());
(*pc) += 2;
}
@@ -325,7 +325,7 @@
extern struct symbol *block_iterator_next (struct block_iterator *iterator);
/* Initialize ITERATOR to point at the first symbol in BLOCK whose
- SYMBOL_SEARCH_NAME matches NAME, and return that first symbol, or
+ search_name () matches NAME, and return that first symbol, or
NULL if there are no such symbols. */
extern struct symbol *block_iter_match_first (const struct block *block,
@@ -333,7 +333,7 @@
struct block_iterator *iterator);
/* Advance ITERATOR to point at the next symbol in BLOCK whose
- SYMBOL_SEARCH_NAME matches NAME, or NULL if there are no more such
+ search_name () matches NAME, or NULL if there are no more such
symbols. Don't call this if you've previously received NULL from
block_iterator_match_first or block_iterator_match_next on this
iteration. And don't call it unless ITERATOR was created by a
@@ -269,7 +269,7 @@
{
const struct block *b = SYMBOL_BLOCK_VALUE (f);
- cache_pc_function_name = SYMBOL_LINKAGE_NAME (f);
+ cache_pc_function_name = f->linkage_name ();
cache_pc_function_section = section;
cache_pc_function_block = b;
@@ -5818,7 +5818,7 @@
if (sym)
{
uiout->text ("in ");
- uiout->field_string ("func", SYMBOL_PRINT_NAME (sym),
+ uiout->field_string ("func", sym->print_name (),
function_name_style.style ());
uiout->text (" ");
uiout->wrap_hint (wrap_indent_at_field (uiout, "what"));
@@ -13304,7 +13304,7 @@
uiout->text ("Now in ");
if (sym)
{
- uiout->field_string ("func", SYMBOL_PRINT_NAME (sym),
+ uiout->field_string ("func", sym->print_name (),
function_name_style.style ());
uiout->text (" at ");
}
@@ -82,7 +82,7 @@
sym = bfun->sym;
if (sym != NULL)
- return SYMBOL_PRINT_NAME (sym);
+ return sym->print_name ();
if (msym != NULL)
return msym->print_name ();
@@ -206,7 +206,7 @@
const char *bfname, *fname;
/* Check the function name. */
- if (strcmp (SYMBOL_LINKAGE_NAME (fun), SYMBOL_LINKAGE_NAME (sym)) != 0)
+ if (strcmp (fun->linkage_name (), sym->linkage_name ()) != 0)
return 1;
/* Check the location of those functions, as well. */
@@ -164,7 +164,7 @@
{
for (j = list->nsyms; --j >= 0;)
{
- pp = SYMBOL_LINKAGE_NAME (list->symbol[j]);
+ pp = list->symbol[j]->linkage_name ();
if (*pp == *name && strncmp (pp, name, length) == 0
&& pp[length] == '\0')
{
@@ -319,7 +319,7 @@
{
complaint (_("block end address less than block "
"start address in %s (patched it)"),
- SYMBOL_PRINT_NAME (symbol));
+ symbol->print_name ());
}
else
{
@@ -356,7 +356,7 @@
if (symbol)
{
complaint (_("inner block not inside outer block in %s"),
- SYMBOL_PRINT_NAME (symbol));
+ symbol->print_name ());
}
else
{
@@ -3393,7 +3393,7 @@
parser_fprintf (file, "ssym<name=%s, sym=%s, field_of_this=%d>",
copy_name (value.ssym.stoken).c_str (),
(value.ssym.sym.symbol == NULL
- ? "(null)" : SYMBOL_PRINT_NAME (value.ssym.sym.symbol)),
+ ? "(null)" : value.ssym.sym.symbol->print_name ()),
value.ssym.is_a_field_of_this);
break;
@@ -208,9 +208,9 @@
type_print (type, "", stream, -1);
if (TYPE_NAME ((SYMBOL_TYPE (new_symbol))) == 0
|| strcmp (TYPE_NAME ((SYMBOL_TYPE (new_symbol))),
- SYMBOL_LINKAGE_NAME (new_symbol)) != 0
+ new_symbol->linkage_name ()) != 0
|| TYPE_CODE (SYMBOL_TYPE (new_symbol)) == TYPE_CODE_TYPEDEF)
- fprintf_filtered (stream, " %s", SYMBOL_PRINT_NAME (new_symbol));
+ fprintf_filtered (stream, " %s", new_symbol->print_name ());
fprintf_filtered (stream, ";");
}
@@ -880,15 +880,14 @@
if (first)
{
wrap_here (" ");
- fprintf_filtered (stream, _("[with %s = "),
- SYMBOL_LINKAGE_NAME (sym));
+ fprintf_filtered (stream, _("[with %s = "), sym->linkage_name ());
first = 0;
}
else
{
fputs_filtered (", ", stream);
wrap_here (" ");
- fprintf_filtered (stream, "%s = ", SYMBOL_LINKAGE_NAME (sym));
+ fprintf_filtered (stream, "%s = ", sym->linkage_name ());
}
c_print_type (SYMBOL_TYPE (sym), "", stream, -1, 0, flags);
@@ -938,7 +938,7 @@
if (sym)
printf_filtered ("%s is in %s (%s:%d).\n",
paddress (gdbarch, sal.pc),
- SYMBOL_PRINT_NAME (sym),
+ sym->print_name (),
symtab_to_filename_for_display (sal.symtab),
sal.line);
else
@@ -1270,7 +1270,7 @@
if (sym)
printf_filtered ("%s is in %s (%s:%d).\n",
paddress (gdbarch, sal.pc),
- SYMBOL_PRINT_NAME (sym),
+ sym->print_name (),
symtab_to_filename_for_display (sal.symtab), sal.line);
else
printf_filtered ("%s is at %s:%d.\n",
@@ -1758,7 +1758,7 @@
const char *sym_name = NULL;
if (sal.symbol != NULL)
- sym_name = SYMBOL_PRINT_NAME (sal.symbol);
+ sym_name = sal.symbol->print_name ();
printf_filtered (_("file: \"%s\", line number: %d, symbol: \"%s\"\n"),
symtab_to_filename_for_display (sal.symtab),
sal.line, sym_name != NULL ? sym_name : "???");
@@ -1502,15 +1502,15 @@
&& TYPE_CODE (SYMBOL_TYPE (real_sym)) == TYPE_CODE_PTR
&& TYPE_LENGTH (TYPE_TARGET_TYPE (SYMBOL_TYPE (real_sym))) != 0)
{
- const char *name = SYMBOL_LINKAGE_NAME (real_sym);
+ const char *name = real_sym->linkage_name ();
int hash = hashname (name);
struct symbol *sym, *prev;
prev = 0;
for (sym = opaque_type_chain[hash]; sym;)
{
- if (name[0] == SYMBOL_LINKAGE_NAME (sym)[0]
- && strcmp (name + 1, SYMBOL_LINKAGE_NAME (sym) + 1) == 0)
+ if (name[0] == sym->linkage_name ()[0]
+ && strcmp (name + 1, sym->linkage_name () + 1) == 0)
{
if (prev)
{
@@ -1693,7 +1693,7 @@
}
else
TYPE_NAME (SYMBOL_TYPE (sym)) =
- xstrdup (SYMBOL_LINKAGE_NAME (sym));
+ xstrdup (sym->linkage_name ());
}
/* Keep track of any type which points to empty structured
@@ -1707,7 +1707,7 @@
&& TYPE_CODE (TYPE_TARGET_TYPE (SYMBOL_TYPE (sym)))
!= TYPE_CODE_UNDEF)
{
- int i = hashname (SYMBOL_LINKAGE_NAME (sym));
+ int i = hashname (sym->linkage_name ());
SYMBOL_VALUE_CHAIN (sym) = opaque_type_chain[i];
opaque_type_chain[i] = sym;
@@ -1725,11 +1725,10 @@
names for anonymous enums, structures, and unions, like
"~0fake" or ".0fake". Thanks, but no thanks... */
if (TYPE_NAME (SYMBOL_TYPE (sym)) == 0)
- if (SYMBOL_LINKAGE_NAME (sym) != NULL
- && *SYMBOL_LINKAGE_NAME (sym) != '~'
- && *SYMBOL_LINKAGE_NAME (sym) != '.')
- TYPE_NAME (SYMBOL_TYPE (sym)) =
- xstrdup (SYMBOL_LINKAGE_NAME (sym));
+ if (sym->linkage_name () != NULL
+ && *sym->linkage_name () != '~'
+ && *sym->linkage_name () != '.')
+ TYPE_NAME (SYMBOL_TYPE (sym)) = xstrdup (sym->linkage_name ());
add_symbol_to_list (sym, get_file_symbols ());
break;
@@ -2154,7 +2153,7 @@
struct symbol *xsym = syms->symbol[j];
SYMBOL_TYPE (xsym) = type;
- TYPE_FIELD_NAME (type, n) = SYMBOL_LINKAGE_NAME (xsym);
+ TYPE_FIELD_NAME (type, n) = xsym->linkage_name ();
SET_FIELD_ENUMVAL (TYPE_FIELD (type, n), SYMBOL_VALUE (xsym));
if (SYMBOL_VALUE (xsym) < 0)
unsigned_enum = 0;
@@ -40,7 +40,7 @@
c_symbol_substitution_name (struct symbol *sym)
{
return gdb::unique_xmalloc_ptr<char>
- (concat ("__", SYMBOL_NATURAL_NAME (sym), "_ptr", (char *) NULL));
+ (concat ("__", sym->natural_name (), "_ptr", (char *) NULL));
}
/* Convert a given symbol, SYM, to the compiler's representation.
@@ -70,7 +70,7 @@
if (SYMBOL_DOMAIN (sym.symbol) == STRUCT_DOMAIN)
{
/* Binding a tag, so we don't need to build a decl. */
- context->plugin ().tagbind (SYMBOL_NATURAL_NAME (sym.symbol),
+ context->plugin ().tagbind (sym.symbol->natural_name (),
sym_type, filename, line);
}
else
@@ -105,28 +105,28 @@
return;
}
context->plugin ().build_constant
- (sym_type, SYMBOL_NATURAL_NAME (sym.symbol),
+ (sym_type, sym.symbol->natural_name (),
SYMBOL_VALUE (sym.symbol),
filename, line);
return;
case LOC_CONST_BYTES:
error (_("Unsupported LOC_CONST_BYTES for symbol \"%s\"."),
- SYMBOL_PRINT_NAME (sym.symbol));
+ sym.symbol->print_name ());
case LOC_UNDEF:
internal_error (__FILE__, __LINE__, _("LOC_UNDEF found for \"%s\"."),
- SYMBOL_PRINT_NAME (sym.symbol));
+ sym.symbol->print_name ());
case LOC_COMMON_BLOCK:
error (_("Fortran common block is unsupported for compilation "
"evaluaton of symbol \"%s\"."),
- SYMBOL_PRINT_NAME (sym.symbol));
+ sym.symbol->print_name ());
case LOC_OPTIMIZED_OUT:
error (_("Symbol \"%s\" cannot be used for compilation evaluation "
"as it is optimized out."),
- SYMBOL_PRINT_NAME (sym.symbol));
+ sym.symbol->print_name ());
case LOC_COMPUTED:
if (is_local)
@@ -135,7 +135,7 @@
warning (_("Symbol \"%s\" is thread-local and currently can only "
"be referenced from the current thread in "
"compiled code."),
- SYMBOL_PRINT_NAME (sym.symbol));
+ sym.symbol->print_name ());
/* FALLTHROUGH */
case LOC_UNRESOLVED:
/* 'symbol_name' cannot be used here as that one is used only for
@@ -152,14 +152,14 @@
if (frame == NULL)
error (_("Symbol \"%s\" cannot be used because "
"there is no selected frame"),
- SYMBOL_PRINT_NAME (sym.symbol));
+ sym.symbol->print_name ());
}
val = read_var_value (sym.symbol, sym.block, frame);
if (VALUE_LVAL (val) != lval_memory)
error (_("Symbol \"%s\" cannot be used for compilation "
"evaluation as its address has not been found."),
- SYMBOL_PRINT_NAME (sym.symbol));
+ sym.symbol->print_name ());
kind = GCC_C_SYMBOL_VARIABLE;
addr = value_address (val);
@@ -193,7 +193,7 @@
|| symbol_name == NULL)
{
decl = context->plugin ().build_decl
- (SYMBOL_NATURAL_NAME (sym.symbol),
+ (sym.symbol->natural_name (),
kind,
sym_type,
symbol_name.get (), addr,
@@ -450,7 +450,7 @@
{
const struct symbol *sym = (const struct symbol *) a;
- return htab_hash_string (SYMBOL_NATURAL_NAME (sym));
+ return htab_hash_string (sym->natural_name ());
}
/* A comparison function for hash tables that just looks at symbol
@@ -462,7 +462,7 @@
const struct symbol *syma = (const struct symbol *) a;
const struct symbol *symb = (const struct symbol *) b;
- return strcmp (SYMBOL_NATURAL_NAME (syma), SYMBOL_NATURAL_NAME (symb)) == 0;
+ return strcmp (syma->natural_name (), symb->natural_name ()) == 0;
}
/* If a symbol with the same name as SYM is already in HASHTAB, return
@@ -100,27 +100,27 @@
return;
}
instance->plugin ().build_constant
- (sym_type, SYMBOL_NATURAL_NAME (sym.symbol),
+ (sym_type, sym.symbol->natural_name (),
SYMBOL_VALUE (sym.symbol), filename, line);
return;
case LOC_CONST_BYTES:
error (_("Unsupported LOC_CONST_BYTES for symbol \"%s\"."),
- SYMBOL_PRINT_NAME (sym.symbol));
+ sym.symbol->print_name ());
case LOC_UNDEF:
internal_error (__FILE__, __LINE__, _("LOC_UNDEF found for \"%s\"."),
- SYMBOL_PRINT_NAME (sym.symbol));
+ sym.symbol->print_name ());
case LOC_COMMON_BLOCK:
error (_("Fortran common block is unsupported for compilation "
"evaluaton of symbol \"%s\"."),
- SYMBOL_PRINT_NAME (sym.symbol));
+ sym.symbol->print_name ());
case LOC_OPTIMIZED_OUT:
error (_("Symbol \"%s\" cannot be used for compilation evaluation "
"as it is optimized out."),
- SYMBOL_PRINT_NAME (sym.symbol));
+ sym.symbol->print_name ());
case LOC_COMPUTED:
if (is_local)
@@ -129,7 +129,7 @@
warning (_("Symbol \"%s\" is thread-local and currently can only "
"be referenced from the current thread in "
"compiled code."),
- SYMBOL_PRINT_NAME (sym.symbol));
+ sym.symbol->print_name ());
/* FALLTHROUGH */
case LOC_UNRESOLVED:
/* 'symbol_name' cannot be used here as that one is used only for
@@ -146,14 +146,14 @@
if (frame == nullptr)
error (_("Symbol \"%s\" cannot be used because "
"there is no selected frame"),
- SYMBOL_PRINT_NAME (sym.symbol));
+ sym.symbol->print_name ());
}
val = read_var_value (sym.symbol, sym.block, frame);
if (VALUE_LVAL (val) != lval_memory)
error (_("Symbol \"%s\" cannot be used for compilation "
"evaluation as its address has not been found."),
- SYMBOL_PRINT_NAME (sym.symbol));
+ sym.symbol->print_name ());
kind = GCC_CP_SYMBOL_VARIABLE;
addr = value_address (val);
@@ -189,7 +189,7 @@
if (!is_local)
{
compile_scope scope
- = instance->new_scope (SYMBOL_NATURAL_NAME (sym.symbol),
+ = instance->new_scope (sym.symbol->natural_name (),
SYMBOL_TYPE (sym.symbol));
if (scope.nested_type () != GCC_TYPE_NONE)
{
@@ -202,9 +202,9 @@
}
/* Get the `raw' name of the symbol. */
- if (name.empty () && SYMBOL_NATURAL_NAME (sym.symbol) != nullptr)
+ if (name.empty () && sym.symbol->natural_name () != nullptr)
name = compile_cplus_instance::decl_name
- (SYMBOL_NATURAL_NAME (sym.symbol)).get ();
+ (sym.symbol->natural_name ()).get ();
/* Define the decl. */
instance->plugin ().build_decl
@@ -112,7 +112,7 @@
for (const auto &comp: scope)
{
const char *symbol = (comp.bsymbol.symbol != nullptr
- ? SYMBOL_NATURAL_NAME (comp.bsymbol.symbol)
+ ? comp.bsymbol.symbol->natural_name ()
: "<none>");
printf_unfiltered ("\tname = %s, symbol = %s\n", comp.name.c_str (),
@@ -622,18 +622,18 @@
if (frame == NULL)
error (_("Symbol \"%s\" cannot be used because "
"there is no selected frame"),
- SYMBOL_PRINT_NAME (sym));
+ sym->print_name ());
val = read_var_value (sym, NULL, frame);
if (VALUE_LVAL (val) != lval_memory)
error (_("Symbol \"%s\" cannot be used for compilation evaluation "
"as its address has not been found."),
- SYMBOL_PRINT_NAME (sym));
+ sym->print_name ());
warning (_("Symbol \"%s\" is thread-local and currently can only "
"be referenced from the current thread in "
"compiled code."),
- SYMBOL_PRINT_NAME (sym));
+ sym->print_name ());
fprintfi_filtered (indent, stream, "%s = %s;\n",
result_name,
@@ -433,7 +433,7 @@
if (function != NULL
&& (BLOCK_SUPERBLOCK (function_block)
== BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK))
- && (strcmp_iw (SYMBOL_LINKAGE_NAME (function),
+ && (strcmp_iw (function->linkage_name (),
GCC_FE_WRAPPER_FUNCTION)
== 0))
break;
@@ -54,9 +54,9 @@
const struct symbol *const symbol,
struct objfile *const objfile)
{
- if (SYMBOL_DEMANGLED_NAME (symbol) != NULL)
+ if (symbol->demangled_name () != NULL)
{
- const char *name = SYMBOL_DEMANGLED_NAME (symbol);
+ const char *name = symbol->demangled_name ();
unsigned int previous_component;
unsigned int next_component;
@@ -488,7 +488,7 @@
/* Maybe we should store a dictionary in here instead. */
for (i = 0; i < num; ++i)
{
- if (strcmp (name, SYMBOL_NATURAL_NAME (syms[i])) == 0)
+ if (strcmp (name, syms[i]->natural_name ()) == 0)
return syms[i];
}
return NULL;
@@ -542,10 +542,10 @@
/* Search the template parameters of the function's defining
context. */
- if (SYMBOL_NATURAL_NAME (function))
+ if (function->natural_name ())
{
struct type *context;
- std::string name_copy (SYMBOL_NATURAL_NAME (function));
+ std::string name_copy (function->natural_name ());
const struct language_defn *lang = language_def (language_cplus);
struct gdbarch *arch = symbol_arch (function);
const struct block *parent = BLOCK_SUPERBLOCK (block);
@@ -1154,13 +1154,12 @@
/* skip any symbols that we've already considered. */
for (symbol *listed_sym : *overload_list)
- if (strcmp (SYMBOL_LINKAGE_NAME (sym),
- SYMBOL_LINKAGE_NAME (listed_sym)) == 0)
+ if (strcmp (sym->linkage_name (), listed_sym->linkage_name ()) == 0)
return;
/* Get the demangled name without parameters */
gdb::unique_xmalloc_ptr<char> sym_name
- = cp_remove_params (SYMBOL_NATURAL_NAME (sym));
+ = cp_remove_params (sym->natural_name ());
if (!sym_name)
return;
@@ -1230,7 +1230,7 @@
if (sym == NULL)
continue;
- set_symbol_address (ccp->of, sym, SYMBOL_LINKAGE_NAME (sym));
+ set_symbol_address (ccp->of, sym, sym->linkage_name ());
}
pst->readin = 1;
@@ -2341,7 +2341,7 @@
struct block *block,
struct obstack *obstack)
{
- if (SYMBOL_DEMANGLED_NAME (symbol) != NULL)
+ if (symbol->demangled_name () != NULL)
{
/* Try to figure out the appropriate namespace from the
demangled name. */
@@ -2351,7 +2351,7 @@
name of the class as well. This should be harmless, but
is a little unfortunate. */
- const char *name = SYMBOL_DEMANGLED_NAME (symbol);
+ const char *name = symbol->demangled_name ();
unsigned int prefix_len = cp_entire_prefix_len (name);
block_set_scope (block, obstack_strndup (obstack, name, prefix_len),
@@ -608,7 +608,7 @@
sym = sym->hash_next)
{
/* Warning: the order of arguments to compare matters! */
- if (matches_name (SYMBOL_SEARCH_NAME (sym), name, NULL))
+ if (matches_name (sym->search_name (), name, NULL))
break;
}
@@ -629,7 +629,7 @@
next != NULL;
next = next->hash_next)
{
- if (matches_name (SYMBOL_SEARCH_NAME (next), name, NULL))
+ if (matches_name (next->search_name (), name, NULL))
break;
}
@@ -652,7 +652,7 @@
language. The two may not use the same hashing algorithm. */
gdb_assert (SYMBOL_LANGUAGE (sym) == DICT_LANGUAGE (dict)->la_language);
- hash = search_name_hash (SYMBOL_LANGUAGE (sym), SYMBOL_SEARCH_NAME (sym));
+ hash = search_name_hash (SYMBOL_LANGUAGE (sym), sym->search_name ());
hash_index = hash % DICT_HASHED_NBUCKETS (dict);
sym->hash_next = buckets[hash_index];
buckets[hash_index] = sym;
@@ -847,7 +847,7 @@
{
sym = DICT_LINEAR_SYM (dict, i);
- if (matches_name (SYMBOL_SEARCH_NAME (sym), name, NULL))
+ if (matches_name (sym->search_name (), name, NULL))
{
retval = sym;
break;
@@ -142,7 +142,7 @@
extern struct symbol *mdict_iterator_next (struct mdict_iterator *miterator);
/* Initialize MITERATOR to point at the first symbol in MDICT whose
- SYMBOL_SEARCH_NAME is NAME, as tested using COMPARE (which must use
+ search_name () is NAME, as tested using COMPARE (which must use
the same conventions as strcmp_iw and be compatible with any
dictionary hashing function), and return that first symbol, or NULL
if there are no such symbols. */
@@ -153,7 +153,7 @@
struct mdict_iterator *miterator);
/* Advance MITERATOR to point at the next symbol in MDICT whose
- SYMBOL_SEARCH_NAME is NAME, as tested using COMPARE (see
+ search_name () is NAME, as tested using COMPARE (see
dict_iter_match_first), or NULL if there are no more such symbols.
Don't call this if you've previously received NULL from
mdict_iterator_match_first or mdict_iterator_match_next on this
@@ -524,7 +524,7 @@
if (*length == 0)
error (_("Could not find the frame base for \"%s\"."),
- SYMBOL_NATURAL_NAME (framefunc));
+ framefunc->natural_name ());
}
static CORE_ADDR
@@ -3635,13 +3635,13 @@
if (!b)
error (_("No block found for address for symbol \"%s\"."),
- SYMBOL_PRINT_NAME (symbol));
+ symbol->print_name ());
framefunc = block_linkage_function (b);
if (!framefunc)
error (_("No function found for block for symbol \"%s\"."),
- SYMBOL_PRINT_NAME (symbol));
+ symbol->print_name ());
func_get_frame_base_dwarf_block (framefunc, addr, &base_data, &base_size);
@@ -3655,7 +3655,7 @@
if (buf_end != base_data + base_size)
error (_("Unexpected opcode after "
"DW_OP_breg%u for symbol \"%s\"."),
- frame_reg, SYMBOL_PRINT_NAME (symbol));
+ frame_reg, symbol->print_name ());
}
else if (base_data[0] >= DW_OP_reg0 && base_data[0] <= DW_OP_reg31)
{
@@ -4229,7 +4229,7 @@
if (bad || data > end)
error (_("Corrupted DWARF2 expression for \"%s\"."),
- SYMBOL_PRINT_NAME (symbol));
+ symbol->print_name ());
}
/* Print a natural-language description of SYMBOL to STREAM. This
@@ -4282,7 +4282,7 @@
unsigned int addr_size = dwarf2_per_cu_addr_size (dlbaton->per_cu);
if (dlbaton->size == 0)
- error (_("symbol \"%s\" is optimized out"), SYMBOL_NATURAL_NAME (sym));
+ error (_("symbol \"%s\" is optimized out"), sym->natural_name ());
compile_dwarf_expr_to_c (stream, result_name,
sym, pc, gdbarch, registers_used, addr_size,
@@ -4428,7 +4428,7 @@
case DEBUG_LOC_BUFFER_OVERFLOW:
case DEBUG_LOC_INVALID_ENTRY:
error (_("Corrupted DWARF expression for symbol \"%s\"."),
- SYMBOL_PRINT_NAME (symbol));
+ symbol->print_name ());
default:
gdb_assert_not_reached ("bad debug_loc_kind");
}
@@ -4495,7 +4495,7 @@
data = dwarf2_find_location_expression (dlbaton, &size, pc);
if (size == 0)
- error (_("symbol \"%s\" is optimized out"), SYMBOL_NATURAL_NAME (sym));
+ error (_("symbol \"%s\" is optimized out"), sym->natural_name ());
compile_dwarf_expr_to_c (stream, result_name,
sym, pc, gdbarch, registers_used, addr_size,
@@ -6073,10 +6073,10 @@
information (but NAME might contain it). */
if (sym != NULL
- && strcmp_iw (SYMBOL_SEARCH_NAME (sym), name) == 0)
+ && strcmp_iw (sym->search_name (), name) == 0)
return stab;
if (with_opaque != NULL
- && strcmp_iw (SYMBOL_SEARCH_NAME (with_opaque), name) == 0)
+ && strcmp_iw (with_opaque->search_name (), name) == 0)
stab_best = stab;
/* Keep looking through other CUs. */
@@ -13776,7 +13776,7 @@
(struct symbol *) templ_func);
if (dwarf2_flag_true_p (die, DW_AT_main_subprogram, cu))
- set_objfile_main_name (objfile, SYMBOL_LINKAGE_NAME (newobj->name),
+ set_objfile_main_name (objfile, newobj->name->linkage_name (),
cu->language);
/* If there is a location expression for DW_AT_frame_base, record
@@ -16476,7 +16476,7 @@
* sizeof (struct field));
}
- FIELD_NAME (fields[num_fields]) = SYMBOL_LINKAGE_NAME (sym);
+ FIELD_NAME (fields[num_fields]) = sym->linkage_name ();
FIELD_TYPE (fields[num_fields]) = NULL;
SET_FIELD_ENUMVAL (fields[num_fields], SYMBOL_VALUE (sym));
FIELD_BITSIZE (fields[num_fields]) = 0;
@@ -21790,7 +21790,7 @@
apply. */
bound_minimal_symbol found
= (lookup_minimal_symbol_linkage
- (SYMBOL_LINKAGE_NAME (sym), objfile));
+ (sym->linkage_name (), objfile));
if (found.minsym != nullptr)
sym->maybe_copied = 1;
}
@@ -21919,7 +21919,7 @@
with this objfile, so we don't need to
duplicate it for the type. */
if (TYPE_NAME (SYMBOL_TYPE (sym)) == 0)
- TYPE_NAME (SYMBOL_TYPE (sym)) = SYMBOL_SEARCH_NAME (sym);
+ TYPE_NAME (SYMBOL_TYPE (sym)) = sym->search_name ();
}
}
}
@@ -22152,7 +22152,7 @@
struct dwarf2_locexpr_baton *baton;
dwarf2_const_value_attr (attr, SYMBOL_TYPE (sym),
- SYMBOL_PRINT_NAME (sym),
+ sym->print_name (),
&objfile->objfile_obstack, cu,
&value, &bytes, &baton);
@@ -25334,7 +25334,7 @@
else
{
dwarf2_invalid_attrib_class_complaint ("location description",
- SYMBOL_NATURAL_NAME (sym));
+ sym->natural_name ());
baton->size = 0;
}
@@ -1049,7 +1049,7 @@
else if (op == OP_VAR_VALUE)
{
symbol *sym = exp->elts[*pos + 2].symbol;
- var_func_name = SYMBOL_PRINT_NAME (sym);
+ var_func_name = sym->print_name ();
}
argvec[0] = evaluate_subexp_with_coercion (exp, pos, noside);
@@ -1300,7 +1300,7 @@
(*pos) += 3;
symbol *var = exp->elts[pc + 2].symbol;
if (TYPE_CODE (SYMBOL_TYPE (var)) == TYPE_CODE_ERROR)
- error_unknown_type (SYMBOL_PRINT_NAME (var));
+ error_unknown_type (var->print_name ());
if (noside != EVAL_SKIP)
return evaluate_var_value (noside, exp->elts[pc + 1].block, var);
else
@@ -1342,7 +1342,7 @@
if (SYMBOL_COMPUTED_OPS (sym) == NULL
|| SYMBOL_COMPUTED_OPS (sym)->read_variable_at_entry == NULL)
error (_("Symbol \"%s\" does not have any specific entry value"),
- SYMBOL_PRINT_NAME (sym));
+ sym->print_name ());
frame = get_selected_frame (NULL);
return SYMBOL_COMPUTED_OPS (sym)->read_variable_at_entry (sym, frame);
@@ -126,12 +126,12 @@
b = exp->elts[pc + 1].block;
if (b != NULL
&& BLOCK_FUNCTION (b) != NULL
- && SYMBOL_PRINT_NAME (BLOCK_FUNCTION (b)) != NULL)
+ && BLOCK_FUNCTION (b)->print_name () != NULL)
{
- fputs_filtered (SYMBOL_PRINT_NAME (BLOCK_FUNCTION (b)), stream);
+ fputs_filtered (BLOCK_FUNCTION (b)->print_name (), stream);
fputs_filtered ("::", stream);
}
- fputs_filtered (SYMBOL_PRINT_NAME (exp->elts[pc + 2].symbol), stream);
+ fputs_filtered (exp->elts[pc + 2].symbol->print_name (), stream);
}
return;
@@ -154,7 +154,7 @@
{
(*pos) += 2;
fprintf_filtered (stream, "%s@entry",
- SYMBOL_PRINT_NAME (exp->elts[pc + 1].symbol));
+ exp->elts[pc + 1].symbol->print_name ());
}
return;
@@ -899,7 +899,7 @@
fprintf_filtered (stream, ", symbol @");
gdb_print_host_address (exp->elts[elt + 1].symbol, stream);
fprintf_filtered (stream, " (%s)",
- SYMBOL_PRINT_NAME (exp->elts[elt + 1].symbol));
+ exp->elts[elt + 1].symbol->print_name ());
elt += 3;
break;
case OP_VAR_MSYM_VALUE:
@@ -915,7 +915,7 @@
fprintf_filtered (stream, "Entry value of symbol @");
gdb_print_host_address (exp->elts[elt].symbol, stream);
fprintf_filtered (stream, " (%s)",
- SYMBOL_PRINT_NAME (exp->elts[elt].symbol));
+ exp->elts[elt].symbol->print_name ());
elt += 2;
break;
case OP_LAST:
@@ -387,17 +387,17 @@
gdb_assert (SYMBOL_CLASS (sym) == LOC_COMMON_BLOCK);
- if (comname && (!SYMBOL_LINKAGE_NAME (sym)
- || strcmp (comname, SYMBOL_LINKAGE_NAME (sym)) != 0))
+ if (comname && (!sym->linkage_name ()
+ || strcmp (comname, sym->linkage_name ()) != 0))
continue;
if (*any_printed)
putchar_filtered ('\n');
else
*any_printed = 1;
- if (SYMBOL_PRINT_NAME (sym))
+ if (sym->print_name ())
printf_filtered (_("Contents of F77 COMMON block '%s':\n"),
- SYMBOL_PRINT_NAME (sym));
+ sym->print_name ());
else
printf_filtered (_("Contents of blank COMMON block:\n"));
@@ -406,7 +406,7 @@
struct value *val = NULL;
printf_filtered ("%s = ",
- SYMBOL_PRINT_NAME (common->contents[index]));
+ common->contents[index]->print_name ());
try
{
@@ -566,9 +566,9 @@
{
if (BLOCK_FUNCTION (var_block)
&& !block_inlined_p (var_block)
- && SYMBOL_PRINT_NAME (BLOCK_FUNCTION (var_block)))
+ && BLOCK_FUNCTION (var_block)->print_name ())
error (_("No frame is currently executing in block %s."),
- SYMBOL_PRINT_NAME (BLOCK_FUNCTION (var_block)));
+ BLOCK_FUNCTION (var_block)->print_name ());
else
error (_("No frame is currently executing in specified"
" block"));
@@ -601,7 +601,7 @@
if (sym_need == SYMBOL_NEEDS_FRAME)
gdb_assert (frame != NULL);
else if (sym_need == SYMBOL_NEEDS_REGISTERS && !target_has_registers)
- error (_("Cannot read `%s' without registers"), SYMBOL_PRINT_NAME (var));
+ error (_("Cannot read `%s' without registers"), var->print_name ());
if (frame != NULL)
frame = get_hosting_frame (var, var_block, frame);
@@ -668,7 +668,7 @@
addr = get_frame_args_address (frame);
if (!addr)
error (_("Unknown argument list address for `%s'."),
- SYMBOL_PRINT_NAME (var));
+ var->print_name ());
addr += SYMBOL_VALUE (var);
break;
@@ -680,7 +680,7 @@
argref = get_frame_args_address (frame);
if (!argref)
error (_("Unknown argument list address for `%s'."),
- SYMBOL_PRINT_NAME (var));
+ var->print_name ());
argref += SYMBOL_VALUE (var);
ref = value_at (lookup_pointer_type (type), argref);
addr = value_as_address (ref);
@@ -694,7 +694,7 @@
case LOC_TYPEDEF:
error (_("Cannot look up value of a typedef `%s'."),
- SYMBOL_PRINT_NAME (var));
+ var->print_name ());
break;
case LOC_BLOCK:
@@ -721,7 +721,7 @@
if (regval == NULL)
error (_("Value of register variable not available for `%s'."),
- SYMBOL_PRINT_NAME (var));
+ var->print_name ());
addr = value_as_address (regval);
}
@@ -731,7 +731,7 @@
if (regval == NULL)
error (_("Value of register variable not available for `%s'."),
- SYMBOL_PRINT_NAME (var));
+ var->print_name ());
return regval;
}
}
@@ -747,7 +747,7 @@
struct obj_section *obj_section;
memset (&lookup_data, 0, sizeof (lookup_data));
- lookup_data.name = SYMBOL_LINKAGE_NAME (var);
+ lookup_data.name = var->linkage_name ();
gdbarch_iterate_over_objfiles_in_search_order
(symbol_arch (var),
@@ -767,7 +767,7 @@
can't be NULL. */
gdb_assert (flavour_name != NULL);
error (_("Missing %s symbol \"%s\"."),
- flavour_name, SYMBOL_LINKAGE_NAME (var));
+ flavour_name, var->linkage_name ());
}
obj_section = MSYMBOL_OBJ_SECTION (lookup_data.result.objfile, msym);
/* Relocate address, unless there is no section or the variable is
@@ -793,7 +793,7 @@
default:
error (_("Cannot look up value of a botched symbol `%s'."),
- SYMBOL_PRINT_NAME (var));
+ var->print_name ());
break;
}
@@ -411,7 +411,7 @@
char *
go_symbol_package_name (const struct symbol *sym)
{
- const char *mangled_name = SYMBOL_LINKAGE_NAME (sym);
+ const char *mangled_name = sym->linkage_name ();
const char *package_name;
const char *object_name;
const char *method_type_package_name;
@@ -157,7 +157,7 @@
gdbscm_printf (port, " static");
if (BLOCK_FUNCTION (b) != NULL)
- gdbscm_printf (port, " %s", SYMBOL_PRINT_NAME (BLOCK_FUNCTION (b)));
+ gdbscm_printf (port, " %s", BLOCK_FUNCTION (b)->print_name ());
gdbscm_printf (port, " %s-%s",
hex_string (BLOCK_START (b)), hex_string (BLOCK_END (b)));
@@ -157,7 +157,7 @@
gdbscm_printf (port, "#<%s ", symbol_smob_name);
gdbscm_printf (port, "%s",
s_smob->symbol != NULL
- ? SYMBOL_PRINT_NAME (s_smob->symbol)
+ ? s_smob->symbol->print_name ()
: "<invalid>");
if (pstate->writingp)
scm_puts (">", port);
@@ -376,7 +376,7 @@
= syscm_get_valid_symbol_smob_arg_unsafe (self, SCM_ARG1, FUNC_NAME);
const struct symbol *symbol = s_smob->symbol;
- return gdbscm_scm_from_c_string (SYMBOL_NATURAL_NAME (symbol));
+ return gdbscm_scm_from_c_string (symbol->natural_name ());
}
/* (symbol-linkage-name <gdb:symbol>) -> string */
@@ -388,7 +388,7 @@
= syscm_get_valid_symbol_smob_arg_unsafe (self, SCM_ARG1, FUNC_NAME);
const struct symbol *symbol = s_smob->symbol;
- return gdbscm_scm_from_c_string (SYMBOL_LINKAGE_NAME (symbol));
+ return gdbscm_scm_from_c_string (symbol->linkage_name ());
}
/* (symbol-print-name <gdb:symbol>) -> string */
@@ -400,7 +400,7 @@
= syscm_get_valid_symbol_smob_arg_unsafe (self, SCM_ARG1, FUNC_NAME);
const struct symbol *symbol = s_smob->symbol;
- return gdbscm_scm_from_c_string (SYMBOL_PRINT_NAME (symbol));
+ return gdbscm_scm_from_c_string (symbol->print_name ());
}
/* (symbol-addr-class <gdb:symbol>) -> integer */
@@ -387,7 +387,7 @@
struct symbol *symbol = find_pc_function (funaddr);
if (symbol)
- return SYMBOL_PRINT_NAME (symbol);
+ return symbol->print_name ();
}
{
@@ -1210,7 +1210,7 @@
if (fn != NULL && sfn != fn)
{
if (!query (_("Line %d is not in `%s'. Jump anyway? "), sal.line,
- SYMBOL_PRINT_NAME (fn)))
+ fn->print_name ()))
{
error (_("Not confirmed."));
/* NOTREACHED */
@@ -1939,7 +1939,7 @@
if (sm->function != NULL && TYPE_NO_RETURN (sm->function->type)
&& !query (_("warning: Function %s does not return normally.\n"
"Try to finish anyway? "),
- SYMBOL_PRINT_NAME (sm->function)))
+ sm->function->print_name ()))
error (_("Not confirmed."));
printf_filtered (_("Run till exit from "));
}
@@ -7281,7 +7281,7 @@
CORE_ADDR handler;
struct breakpoint *bp;
- vsym = lookup_symbol_search_name (SYMBOL_SEARCH_NAME (sym),
+ vsym = lookup_symbol_search_name (sym->search_name (),
b, VAR_DOMAIN);
value = read_var_value (vsym.symbol, vsym.block, frame);
/* If the value was optimized out, revert to the old behavior. */
@@ -2066,8 +2066,7 @@
gdb_assert (!ls->labels.function_symbols->empty ()
&& (ls->labels.function_symbols->size () == 1));
block_symbol s = ls->labels.function_symbols->front ();
- explicit_loc->function_name
- = xstrdup (SYMBOL_NATURAL_NAME (s.symbol));
+ explicit_loc->function_name = xstrdup (s.symbol->natural_name ());
}
}
@@ -2195,7 +2194,7 @@
skip_prologue_sal (&intermediate_results[i]);
intermediate_results[i].symbol = sym;
add_sal_to_sals (self, &values, &intermediate_results[i],
- sym ? SYMBOL_NATURAL_NAME (sym) : NULL, 0);
+ sym ? sym->natural_name () : NULL, 0);
}
}
@@ -2250,7 +2249,7 @@
if (symbol_to_sal (&sal, state->funfirstline, sym.symbol)
&& maybe_add_address (state->addr_set, pspace, sal.pc))
add_sal_to_sals (state, &sals, &sal,
- SYMBOL_NATURAL_NAME (sym.symbol), 0);
+ sym.symbol->natural_name (), 0);
}
}
else if (ls->function_symbols != NULL || ls->minimal_symbols != NULL)
@@ -2315,7 +2314,7 @@
if (symbol_to_sal (&sal, state->funfirstline, sym.symbol)
&& maybe_add_address (state->addr_set, pspace, sal.pc))
add_sal_to_sals (state, &sals, &sal,
- SYMBOL_NATURAL_NAME (sym.symbol), 0);
+ sym.symbol->natural_name (), 0);
}
}
}
@@ -2903,7 +2902,7 @@
{
for (const auto &label : *labels)
{
- char *match = xstrdup (SYMBOL_SEARCH_NAME (label.symbol));
+ char *match = xstrdup (label.symbol->search_name ());
tracker.add_completion (gdb::unique_xmalloc_ptr<char> (match));
}
delete labels;
@@ -4001,7 +4000,7 @@
{
if (symbol_matches_domain (SYMBOL_LANGUAGE (sym),
SYMBOL_DOMAIN (sym), LABEL_DOMAIN)
- && cmp (SYMBOL_SEARCH_NAME (sym), name, name_len) == 0)
+ && cmp (sym->search_name (), name, name_len) == 0)
{
result->push_back ({sym, block});
label_funcs_ret->push_back ({fn_sym, block});
@@ -165,8 +165,8 @@
fprintf_filtered (stream, "TYPE ");
if (!TYPE_NAME (SYMBOL_TYPE (new_symbol))
|| strcmp (TYPE_NAME ((SYMBOL_TYPE (new_symbol))),
- SYMBOL_LINKAGE_NAME (new_symbol)) != 0)
- fprintf_filtered (stream, "%s = ", SYMBOL_PRINT_NAME (new_symbol));
+ new_symbol->linkage_name ()) != 0)
+ fprintf_filtered (stream, "%s = ", new_symbol->print_name ());
else
fprintf_filtered (stream, "<builtin> = ");
type_print (type, "", stream, 0);
@@ -541,7 +541,7 @@
if (regno < 0 || regno >= gdbarch_num_cooked_regs (gdbarch))
{
reg_value_complaint (regno, gdbarch_num_cooked_regs (gdbarch),
- SYMBOL_PRINT_NAME (sym));
+ sym->print_name ());
regno = gdbarch_sp_regnum (gdbarch); /* Known safe, though useless. */
}
@@ -646,7 +646,7 @@
/* It is a FORTRAN common block. At least for SGI Fortran the
address is not in the symbol; we need to fix it later in
scan_file_globals. */
- int bucket = hashname (SYMBOL_LINKAGE_NAME (s));
+ int bucket = hashname (s->linkage_name ());
SYMBOL_VALUE_CHAIN (s) = global_sym_chain[bucket];
global_sym_chain[bucket] = s;
}
@@ -1334,7 +1334,7 @@
for anything except pointers or functions. */
}
else
- TYPE_NAME (SYMBOL_TYPE (s)) = SYMBOL_LINKAGE_NAME (s);
+ TYPE_NAME (SYMBOL_TYPE (s)) = s->linkage_name ();
}
break;
@@ -4489,10 +4489,10 @@
inc = name[0];
ALL_BLOCK_SYMBOLS (block, iter, sym)
{
- if (SYMBOL_LINKAGE_NAME (sym)[0] == inc
+ if (sym->linkage_name ()[0] == inc
&& SYMBOL_DOMAIN (sym) == domain
&& SYMBOL_CLASS (sym) == theclass
- && strcmp (SYMBOL_LINKAGE_NAME (sym), name) == 0)
+ && strcmp (sym->linkage_name (), name) == 0)
return sym;
}
@@ -515,7 +515,7 @@
string_file stb;
- stb.puts (SYMBOL_PRINT_NAME (arg->sym));
+ stb.puts (arg->sym->print_name ());
if (arg->entry_kind == print_entry_values_only)
stb.puts ("@entry");
uiout->field_stream ("name", stb);
@@ -634,7 +634,7 @@
struct frame_arg arg, entryarg;
if (SYMBOL_IS_ARGUMENT (sym))
- sym2 = lookup_symbol (SYMBOL_LINKAGE_NAME (sym),
+ sym2 = lookup_symbol (sym->linkage_name (),
block, VAR_DOMAIN,
NULL).symbol;
else
@@ -537,8 +537,8 @@
{
const char *aname, *bname;
- aname = SYMBOL_PRINT_NAME (*(struct symbol **) a);
- bname = SYMBOL_PRINT_NAME (*(struct symbol **) b);
+ aname = (*(struct symbol **) a)->print_name ();
+ bname = (*(struct symbol **) b)->print_name ();
if (aname == NULL || bname == NULL)
error (_("internal: compare_selectors(1)"));
@@ -675,7 +675,7 @@
char *p = asel;
QUIT;
- name = SYMBOL_NATURAL_NAME (sym_arr[ix]);
+ name = sym_arr[ix]->natural_name ();
name = strchr (name, ' ') + 1;
if (p[0] && specialcmp(name, p) == 0)
continue; /* Seen this one already (not unique). */
@@ -706,8 +706,8 @@
{
const char *aname, *bname;
- aname = SYMBOL_PRINT_NAME (*(struct symbol **) a);
- bname = SYMBOL_PRINT_NAME (*(struct symbol **) b);
+ aname = (*(struct symbol **) a)->print_name ();
+ bname = (*(struct symbol **) b)->print_name ();
if (aname == NULL || bname == NULL)
error (_("internal: compare_classes(1)"));
@@ -809,7 +809,7 @@
char *p = aclass;
QUIT;
- name = SYMBOL_NATURAL_NAME (sym_arr[ix]);
+ name = sym_arr[ix]->natural_name ();
name += 2;
if (p[0] && specialcmp(name, p) == 0)
continue; /* Seen this one already (not unique). */
@@ -1145,7 +1145,7 @@
0).symbol;
if (sym != NULL)
- symbol_names->push_back (SYMBOL_NATURAL_NAME (sym));
+ symbol_names->push_back (sym->natural_name ());
else
{
struct bound_minimal_symbol msym
@@ -99,7 +99,7 @@
{
type = check_typedef (type);
fprintf_filtered (stream, "type ");
- fprintf_filtered (stream, "%s = ", SYMBOL_PRINT_NAME (new_symbol));
+ fprintf_filtered (stream, "%s = ", new_symbol->print_name ());
type_print (type, "", stream, 0);
fprintf_filtered (stream, ";");
}
@@ -628,9 +628,9 @@
name_location = BLOCK_ENTRY_PC (SYMBOL_BLOCK_VALUE (symbol));
if (do_demangle || asm_demangle)
- name_temp = SYMBOL_PRINT_NAME (symbol);
+ name_temp = symbol->print_name ();
else
- name_temp = SYMBOL_LINKAGE_NAME (symbol);
+ name_temp = symbol->linkage_name ();
}
if (msymbol.minsym != NULL
@@ -1472,7 +1472,7 @@
}
printf_filtered ("Symbol \"");
- fprintf_symbol_filtered (gdb_stdout, SYMBOL_PRINT_NAME (sym),
+ fprintf_symbol_filtered (gdb_stdout, sym->print_name (),
current_language->la_language, DMGL_ANSI);
printf_filtered ("\" is ");
val = SYMBOL_VALUE (sym);
@@ -1592,7 +1592,7 @@
{
struct bound_minimal_symbol msym;
- msym = lookup_bound_minimal_symbol (SYMBOL_LINKAGE_NAME (sym));
+ msym = lookup_bound_minimal_symbol (sym->linkage_name ());
if (msym.minsym == NULL)
printf_filtered ("unresolved");
else
@@ -2214,7 +2214,7 @@
{
if (!name)
- name = SYMBOL_PRINT_NAME (var);
+ name = var->print_name ();
fprintf_filtered (stream, "%s%ps = ", n_spaces (2 * indent),
styled_string (variable_name_style.style (), name));
@@ -103,7 +103,7 @@
/* Duplicate the symbol name, so the caller has consistency
in garbage collection. */
- name->reset (xstrdup (SYMBOL_PRINT_NAME (*sym)));
+ name->reset (xstrdup ((*sym)->print_name ()));
/* If a symbol is specified attempt to determine the language
from the symbol. If mode is not "auto", then the language
@@ -348,14 +348,14 @@
{
string_file stb;
- fprintf_symbol_filtered (&stb, SYMBOL_PRINT_NAME (fa->sym),
+ fprintf_symbol_filtered (&stb, fa->sym->print_name (),
SYMBOL_LANGUAGE (fa->sym),
DMGL_PARAMS | DMGL_ANSI);
if (fa->entry_kind == print_entry_values_compact)
{
stb.puts ("=");
- fprintf_symbol_filtered (&stb, SYMBOL_PRINT_NAME (fa->sym),
+ fprintf_symbol_filtered (&stb, fa->sym->print_name (),
SYMBOL_LANGUAGE (fa->sym),
DMGL_PARAMS | DMGL_ANSI);
}
@@ -60,7 +60,7 @@
SYMPY_REQUIRE_VALID (self, symbol);
- result = PyString_FromString (SYMBOL_PRINT_NAME (symbol));
+ result = PyString_FromString (symbol->print_name ());
return result;
}
@@ -101,7 +101,7 @@
SYMPY_REQUIRE_VALID (self, symbol);
- return PyString_FromString (SYMBOL_NATURAL_NAME (symbol));
+ return PyString_FromString (symbol->natural_name ());
}
static PyObject *
@@ -111,7 +111,7 @@
SYMPY_REQUIRE_VALID (self, symbol);
- return PyString_FromString (SYMBOL_LINKAGE_NAME (symbol));
+ return PyString_FromString (symbol->linkage_name ());
}
static PyObject *
@@ -791,7 +791,7 @@
symbol_name = fullname;
symbol_name += ":";
- symbol_name += SYMBOL_LINKAGE_NAME (p.symbol);
+ symbol_name += p.symbol->linkage_name ();
}
else
symbol_name = p.msymbol.minsym->linkage_name ();
@@ -1115,7 +1115,7 @@
sym = bfun->sym;
if (sym != NULL)
- return SYMBOL_PRINT_NAME (sym);
+ return sym->print_name ();
else if (msym != NULL)
return msym->print_name ();
else
@@ -1175,7 +1175,7 @@
}
if (sym != NULL)
- uiout->field_string ("function", SYMBOL_PRINT_NAME (sym),
+ uiout->field_string ("function", sym->print_name (),
function_name_style.style ());
else if (msym != NULL)
uiout->field_string ("function", msym->print_name (),
@@ -829,7 +829,7 @@
struct ui_file *stream)
{
type = check_typedef (type);
- fprintf_filtered (stream, "type %s = ", SYMBOL_PRINT_NAME (new_symbol));
+ fprintf_filtered (stream, "type %s = ", new_symbol->print_name ());
type_print (type, "", stream, 0);
fprintf_filtered (stream, ";");
}
@@ -959,7 +959,7 @@
if (sym == 0)
name = 0;
else
- name = SYMBOL_LINKAGE_NAME (sym);
+ name = sym->linkage_name ();
/* Check the main executable. */
addr = find_canonical_descriptor_in_load_object
@@ -629,7 +629,7 @@
if (regno < 0 || regno >= gdbarch_num_cooked_regs (gdbarch))
{
reg_value_complaint (regno, gdbarch_num_cooked_regs (gdbarch),
- SYMBOL_PRINT_NAME (sym));
+ sym->print_name ());
regno = gdbarch_sp_regnum (gdbarch); /* Known safe, though useless. */
}
@@ -1039,9 +1039,9 @@
Symbol references don't have valid names and wont't match up with
minimal symbols when the global_sym_chain is relocated.
We'll fixup symbol references when we fixup the defining symbol. */
- if (SYMBOL_LINKAGE_NAME (sym) && SYMBOL_LINKAGE_NAME (sym)[0] != '#')
+ if (sym->linkage_name () && sym->linkage_name ()[0] != '#')
{
- i = hashname (SYMBOL_LINKAGE_NAME (sym));
+ i = hashname (sym->linkage_name ());
SYMBOL_VALUE_CHAIN (sym) = global_sym_chain[i];
global_sym_chain[i] = sym;
}
@@ -1142,8 +1142,7 @@
the same name to represent an argument passed in a
register. GCC uses 'P' for the same case. So if we find
such a symbol pair we combine it into one 'P' symbol.
- For Sun cc we need to do this regardless of
- stabs_argument_has_addr, because the compiler puts out
+ For Sun cc we need to do this regardless of stabs_argument_has_addr, because the compiler puts out
the 'p' symbol even if it never saves the argument onto
the stack.
@@ -1168,8 +1167,8 @@
prev_sym = local_symbols->symbol[local_symbols->nsyms - 1];
if ((SYMBOL_CLASS (prev_sym) == LOC_REF_ARG
|| SYMBOL_CLASS (prev_sym) == LOC_ARG)
- && strcmp (SYMBOL_LINKAGE_NAME (prev_sym),
- SYMBOL_LINKAGE_NAME (sym)) == 0)
+ && strcmp (prev_sym->linkage_name (),
+ sym->linkage_name ()) == 0)
{
SYMBOL_ACLASS_INDEX (prev_sym) = stab_register_index;
/* Use the type from the LOC_REGISTER; that is the type
@@ -1192,18 +1191,16 @@
SYMBOL_ACLASS_INDEX (sym) = LOC_STATIC;
SET_SYMBOL_VALUE_ADDRESS (sym, valu);
if (gdbarch_static_transform_name_p (gdbarch)
- && gdbarch_static_transform_name (gdbarch,
- SYMBOL_LINKAGE_NAME (sym))
- != SYMBOL_LINKAGE_NAME (sym))
+ && gdbarch_static_transform_name (gdbarch, sym->linkage_name ())
+ != sym->linkage_name ())
{
struct bound_minimal_symbol msym;
- msym = lookup_minimal_symbol (SYMBOL_LINKAGE_NAME (sym),
- NULL, objfile);
+ msym = lookup_minimal_symbol (sym->linkage_name (), NULL, objfile);
if (msym.minsym != NULL)
{
const char *new_name = gdbarch_static_transform_name
- (gdbarch, SYMBOL_LINKAGE_NAME (sym));
+ (gdbarch, sym->linkage_name ());
SYMBOL_SET_LINKAGE_NAME (sym, new_name);
SET_SYMBOL_VALUE_ADDRESS (sym,
@@ -1262,7 +1259,7 @@
if (TYPE_NAME (SYMBOL_TYPE (sym)) == NULL)
{
if ((TYPE_CODE (SYMBOL_TYPE (sym)) == TYPE_CODE_PTR
- && strcmp (SYMBOL_LINKAGE_NAME (sym), vtbl_ptr_name))
+ && strcmp (sym->linkage_name (), vtbl_ptr_name))
|| TYPE_CODE (SYMBOL_TYPE (sym)) == TYPE_CODE_FUNC)
{
/* If we are giving a name to a type such as "pointer to
@@ -1303,11 +1300,11 @@
/* Pascal accepts names for pointer types. */
if (get_current_subfile ()->language == language_pascal)
{
- TYPE_NAME (SYMBOL_TYPE (sym)) = SYMBOL_LINKAGE_NAME (sym);
+ TYPE_NAME (SYMBOL_TYPE (sym)) = sym->linkage_name ();
}
}
else
- TYPE_NAME (SYMBOL_TYPE (sym)) = SYMBOL_LINKAGE_NAME (sym);
+ TYPE_NAME (SYMBOL_TYPE (sym)) = sym->linkage_name ();
}
add_symbol_to_list (sym, get_file_symbols ());
@@ -1323,8 +1320,7 @@
SYMBOL_DOMAIN (struct_sym) = STRUCT_DOMAIN;
if (TYPE_NAME (SYMBOL_TYPE (sym)) == 0)
TYPE_NAME (SYMBOL_TYPE (sym))
- = obconcat (&objfile->objfile_obstack,
- SYMBOL_LINKAGE_NAME (sym),
+ = obconcat (&objfile->objfile_obstack, sym->linkage_name (),
(char *) NULL);
add_symbol_to_list (struct_sym, get_file_symbols ());
}
@@ -1351,8 +1347,7 @@
SYMBOL_DOMAIN (sym) = STRUCT_DOMAIN;
if (TYPE_NAME (SYMBOL_TYPE (sym)) == 0)
TYPE_NAME (SYMBOL_TYPE (sym))
- = obconcat (&objfile->objfile_obstack,
- SYMBOL_LINKAGE_NAME (sym),
+ = obconcat (&objfile->objfile_obstack, sym->linkage_name (),
(char *) NULL);
add_symbol_to_list (sym, get_file_symbols ());
@@ -1367,8 +1362,7 @@
SYMBOL_DOMAIN (typedef_sym) = VAR_DOMAIN;
if (TYPE_NAME (SYMBOL_TYPE (sym)) == 0)
TYPE_NAME (SYMBOL_TYPE (sym))
- = obconcat (&objfile->objfile_obstack,
- SYMBOL_LINKAGE_NAME (sym),
+ = obconcat (&objfile->objfile_obstack, sym->linkage_name (),
(char *) NULL);
add_symbol_to_list (typedef_sym, get_file_symbols ());
}
@@ -1380,18 +1374,16 @@
SYMBOL_ACLASS_INDEX (sym) = LOC_STATIC;
SET_SYMBOL_VALUE_ADDRESS (sym, valu);
if (gdbarch_static_transform_name_p (gdbarch)
- && gdbarch_static_transform_name (gdbarch,
- SYMBOL_LINKAGE_NAME (sym))
- != SYMBOL_LINKAGE_NAME (sym))
+ && gdbarch_static_transform_name (gdbarch, sym->linkage_name ())
+ != sym->linkage_name ())
{
struct bound_minimal_symbol msym;
- msym = lookup_minimal_symbol (SYMBOL_LINKAGE_NAME (sym),
- NULL, objfile);
+ msym = lookup_minimal_symbol (sym->linkage_name (), NULL, objfile);
if (msym.minsym != NULL)
{
const char *new_name = gdbarch_static_transform_name
- (gdbarch, SYMBOL_LINKAGE_NAME (sym));
+ (gdbarch, sym->linkage_name ());
SYMBOL_SET_LINKAGE_NAME (sym, new_name);
SET_SYMBOL_VALUE_ADDRESS (sym, BMSYMBOL_VALUE_ADDRESS (msym));
@@ -1684,7 +1676,7 @@
if (SYMBOL_CLASS (sym) == LOC_TYPEDEF
&& SYMBOL_DOMAIN (sym) == STRUCT_DOMAIN
&& (TYPE_CODE (SYMBOL_TYPE (sym)) == code)
- && strcmp (SYMBOL_LINKAGE_NAME (sym), type_name) == 0)
+ && strcmp (sym->linkage_name (), type_name) == 0)
{
obstack_free (&objfile->objfile_obstack, type_name);
type = SYMBOL_TYPE (sym);
@@ -3692,7 +3684,7 @@
struct symbol *xsym = syms->symbol[j];
SYMBOL_TYPE (xsym) = type;
- TYPE_FIELD_NAME (type, n) = SYMBOL_LINKAGE_NAME (xsym);
+ TYPE_FIELD_NAME (type, n) = xsym->linkage_name ();
SET_FIELD_ENUMVAL (TYPE_FIELD (type, n), SYMBOL_VALUE (xsym));
TYPE_FIELD_BITSIZE (type, n) = 0;
}
@@ -4341,7 +4333,7 @@
/* Should we be putting local_symbols back to what it was?
Does it matter? */
- i = hashname (SYMBOL_LINKAGE_NAME (sym));
+ i = hashname (sym->linkage_name ());
SYMBOL_VALUE_CHAIN (sym) = global_sym_chain[i];
global_sym_chain[i] = sym;
common_block_name = NULL;
@@ -4527,8 +4519,7 @@
TYPE_CODE (*type))
&& (TYPE_INSTANCE_FLAGS (*type) ==
TYPE_INSTANCE_FLAGS (SYMBOL_TYPE (sym)))
- && strcmp (SYMBOL_LINKAGE_NAME (sym),
- type_name) == 0)
+ && strcmp (sym->linkage_name (), type_name) == 0)
replace_type (*type, SYMBOL_TYPE (sym));
}
}
@@ -4614,8 +4605,7 @@
for (sym = global_sym_chain[hash]; sym;)
{
- if (strcmp (msymbol->linkage_name (),
- SYMBOL_LINKAGE_NAME (sym)) == 0)
+ if (strcmp (msymbol->linkage_name (), sym->linkage_name ()) == 0)
{
/* Splice this symbol out of the hash chain and
assign the value we have to it. */
@@ -4689,7 +4679,7 @@
else
complaint (_("%s: common block `%s' from "
"global_sym_chain unresolved"),
- objfile_name (objfile), SYMBOL_PRINT_NAME (prev));
+ objfile_name (objfile), prev->print_name ());
}
}
memset (global_sym_chain, 0, sizeof (global_sym_chain));
@@ -427,7 +427,7 @@
annotate_arg_emitter arg_emitter;
ui_out_emit_tuple tuple_emitter (uiout, NULL);
- fprintf_symbol_filtered (&stb, SYMBOL_PRINT_NAME (arg->sym),
+ fprintf_symbol_filtered (&stb, arg->sym->print_name (),
SYMBOL_LANGUAGE (arg->sym), DMGL_PARAMS | DMGL_ANSI);
if (arg->entry_kind == print_entry_values_compact)
{
@@ -435,7 +435,7 @@
PRINT_ENTRY_VALUE_COMPACT we never use MI. */
stb.puts ("=");
- fprintf_symbol_filtered (&stb, SYMBOL_PRINT_NAME (arg->sym),
+ fprintf_symbol_filtered (&stb, arg->sym->print_name (),
SYMBOL_LANGUAGE (arg->sym),
DMGL_PARAMS | DMGL_ANSI);
}
@@ -817,11 +817,11 @@
parameter names occur on the RS/6000, for traceback
tables. FIXME, should we even print them? */
- if (*SYMBOL_LINKAGE_NAME (sym))
+ if (*sym->linkage_name ())
{
struct symbol *nsym;
- nsym = lookup_symbol_search_name (SYMBOL_SEARCH_NAME (sym),
+ nsym = lookup_symbol_search_name (sym->search_name (),
b, VAR_DOMAIN).symbol;
gdb_assert (nsym != NULL);
if (SYMBOL_CLASS (nsym) == LOC_REGISTER
@@ -1259,14 +1259,14 @@
func = get_frame_function (frame);
if (func)
{
- const char *print_name = SYMBOL_PRINT_NAME (func);
+ const char *print_name = func->print_name ();
*funlang = SYMBOL_LANGUAGE (func);
if (funcp)
*funcp = func;
if (*funlang == language_cplus)
{
- /* It seems appropriate to use SYMBOL_PRINT_NAME() here,
+ /* It seems appropriate to use print_name() here,
to display the demangled name that we already have
stored in the symbol table, but we stored a version
with DMGL_PARAMS turned on, and here we don't want to
@@ -1494,11 +1494,11 @@
gdb::unique_xmalloc_ptr<char> func_only;
if (func)
{
- funname = SYMBOL_PRINT_NAME (func);
+ funname = func->print_name ();
funlang = SYMBOL_LANGUAGE (func);
if (funlang == language_cplus)
{
- /* It seems appropriate to use SYMBOL_PRINT_NAME() here,
+ /* It seems appropriate to use print_name() here,
to display the demangled name that we already have
stored in the symbol table, but we stored a version
with DMGL_PARAMS turned on, and here we don't want to
@@ -2246,7 +2246,7 @@
break;
if (SYMBOL_DOMAIN (sym) == COMMON_BLOCK_DOMAIN)
break;
- (*cb) (SYMBOL_PRINT_NAME (sym), sym, cb_data);
+ (*cb) (sym->print_name (), sym, cb_data);
break;
default:
@@ -2276,7 +2276,7 @@
ALL_BLOCK_SYMBOLS (b, iter, sym)
{
- if (strcmp (SYMBOL_LINKAGE_NAME (sym), "default") == 0)
+ if (strcmp (sym->linkage_name (), "default") == 0)
{
if (*have_default)
continue;
@@ -2289,7 +2289,7 @@
sal = find_pc_line (SYMBOL_VALUE_ADDRESS (sym), 0);
values_printed = 1;
- fputs_filtered (SYMBOL_PRINT_NAME (sym), stream);
+ fputs_filtered (sym->print_name (), stream);
get_user_print_options (&opts);
if (opts.addressprint)
{
@@ -2351,8 +2351,7 @@
struct frame_info *frame;
if (p->preg.has_value ()
- && p->preg->exec (SYMBOL_NATURAL_NAME (sym), 0,
- NULL, 0) != 0)
+ && p->preg->exec (sym->natural_name (), 0, NULL, 0) != 0)
return;
if (p->treg.has_value ()
&& !treg_matches_sym_type_name (*p->treg, sym))
@@ -2554,9 +2553,9 @@
float). There are also LOC_ARG/LOC_REGISTER pairs which
are not combined in symbol-reading. */
- sym2 = lookup_symbol_search_name (SYMBOL_SEARCH_NAME (sym),
+ sym2 = lookup_symbol_search_name (sym->search_name (),
b, VAR_DOMAIN).symbol;
- (*cb) (SYMBOL_PRINT_NAME (sym), sym2, cb_data);
+ (*cb) (sym->print_name (), sym2, cb_data);
}
}
}
@@ -2856,7 +2855,7 @@
if (TYPE_NO_RETURN (thisfun->type))
warning (_("Function does not return normally to caller."));
confirmed = query (_("%sMake %s return now? "), query_prefix,
- SYMBOL_PRINT_NAME (thisfun));
+ thisfun->print_name ());
}
if (!confirmed)
error (_("Not confirmed"));
@@ -339,11 +339,11 @@
if (BLOCK_FUNCTION (b))
{
fprintf_filtered (outfile, ", function %s",
- SYMBOL_LINKAGE_NAME (BLOCK_FUNCTION (b)));
- if (SYMBOL_DEMANGLED_NAME (BLOCK_FUNCTION (b)) != NULL)
+ BLOCK_FUNCTION (b)->linkage_name ());
+ if (BLOCK_FUNCTION (b)->demangled_name () != NULL)
{
fprintf_filtered (outfile, ", %s",
- SYMBOL_DEMANGLED_NAME (BLOCK_FUNCTION (b)));
+ BLOCK_FUNCTION (b)->demangled_name ());
}
}
fprintf_filtered (outfile, "\n");
@@ -523,7 +523,7 @@
print_spaces (depth, outfile);
if (SYMBOL_DOMAIN (symbol) == LABEL_DOMAIN)
{
- fprintf_filtered (outfile, "label %s at ", SYMBOL_PRINT_NAME (symbol));
+ fprintf_filtered (outfile, "label %s at ", symbol->print_name ());
fputs_filtered (paddress (gdbarch, SYMBOL_VALUE_ADDRESS (symbol)),
outfile);
if (section)
@@ -548,7 +548,7 @@
? "enum"
: (TYPE_CODE (SYMBOL_TYPE (symbol)) == TYPE_CODE_STRUCT
? "struct" : "union")),
- SYMBOL_LINKAGE_NAME (symbol));
+ symbol->linkage_name ());
LA_PRINT_TYPE (SYMBOL_TYPE (symbol), "", outfile, 1, depth,
&type_print_raw_options);
}
@@ -561,7 +561,7 @@
if (SYMBOL_TYPE (symbol))
{
/* Print details of types, except for enums where it's clutter. */
- LA_PRINT_TYPE (SYMBOL_TYPE (symbol), SYMBOL_PRINT_NAME (symbol),
+ LA_PRINT_TYPE (SYMBOL_TYPE (symbol), symbol->print_name (),
outfile,
TYPE_CODE (SYMBOL_TYPE (symbol)) != TYPE_CODE_ENUM,
depth,
@@ -569,7 +569,7 @@
fprintf_filtered (outfile, "; ");
}
else
- fprintf_filtered (outfile, "%s ", SYMBOL_PRINT_NAME (symbol));
+ fprintf_filtered (outfile, "%s ", symbol->print_name ());
switch (SYMBOL_CLASS (symbol))
{
@@ -1141,7 +1141,7 @@
}
else
{
- slot_name = SYMBOL_SEARCH_NAME (slot->value.found.symbol);
+ slot_name = slot->value.found.symbol->search_name ();
slot_domain = SYMBOL_DOMAIN (slot->value.found.symbol);
}
@@ -1158,7 +1158,7 @@
/* It's important that we use the same comparison that was done
the first time through. If the slot records a found symbol,
then this means using the symbol name comparison function of
- the symbol's language with SYMBOL_SEARCH_NAME. See
+ the symbol's language with symbol->search_name (). See
dictionary.c. It also means using symbol_matches_domain for
found symbols. See block.c.
@@ -1507,7 +1507,7 @@
printf_filtered (" [%4u] = %s, %s %s\n", i,
host_address_to_string (context),
- SYMBOL_PRINT_NAME (found),
+ found->print_name (),
domain_name (SYMBOL_DOMAIN (found)));
break;
}
@@ -1940,7 +1940,7 @@
if (symbol_lookup_debug > 1)
{
fprintf_unfiltered (gdb_stdlog, " = %s (%s, block %s)\n",
- SYMBOL_PRINT_NAME (sym),
+ sym->print_name (),
host_address_to_string (sym),
host_address_to_string (block));
}
@@ -3126,7 +3126,7 @@
* but the "break" still works, and the warning is annoying.
* So I commented out the warning. RT */
/* warning ("In stub for %s; unable to find real function/line info",
- SYMBOL_LINKAGE_NAME (msymbol)); */
+ msymbol->linkage_name ()); */
;
/* fall through */
else if (BMSYMBOL_VALUE_ADDRESS (mfunsym)
@@ -3134,7 +3134,7 @@
/* Avoid infinite recursion */
/* See above comment about why warning is commented out. */
/* warning ("In stub for %s; unable to find real function/line info",
- SYMBOL_LINKAGE_NAME (msymbol)); */
+ msymbol->linkage_name ()); */
;
/* fall through */
else
@@ -3705,7 +3705,7 @@
objfile = symbol_objfile (sym);
pc = BLOCK_ENTRY_PC (SYMBOL_BLOCK_VALUE (sym));
section = SYMBOL_OBJ_SECTION (objfile, sym);
- name = SYMBOL_LINKAGE_NAME (sym);
+ name = sym->linkage_name ();
}
else
{
@@ -4374,8 +4374,7 @@
if (sym_a.block != sym_b.block)
return sym_a.block - sym_b.block;
- return strcmp (SYMBOL_PRINT_NAME (sym_a.symbol),
- SYMBOL_PRINT_NAME (sym_b.symbol));
+ return strcmp (sym_a.symbol->print_name (), sym_b.symbol->print_name ());
}
/* Returns true if the type_name of symbol_type of SYM matches TREG.
@@ -4392,7 +4391,7 @@
{
fprintf_unfiltered (gdb_stdlog,
"treg_matches_sym_type_name\n sym %s\n",
- SYMBOL_NATURAL_NAME (sym));
+ sym->natural_name ());
}
sym_type = SYMBOL_TYPE (sym);
@@ -4629,7 +4628,7 @@
&& file_matches (symtab_to_fullname (real_symtab),
files, nfiles, 0)))
&& ((!preg.has_value ()
- || preg->exec (SYMBOL_NATURAL_NAME (sym), 0,
+ || preg->exec (sym->natural_name (), 0,
NULL, 0) == 0)
&& ((kind == VARIABLES_DOMAIN
&& SYMBOL_CLASS (sym) != LOC_TYPEDEF
@@ -4777,7 +4776,7 @@
{
type_print (SYMBOL_TYPE (sym),
(SYMBOL_CLASS (sym) == LOC_TYPEDEF
- ? "" : SYMBOL_PRINT_NAME (sym)),
+ ? "" : sym->print_name ()),
gdb_stdout, 0);
printf_filtered (";\n");
@@ -4786,7 +4785,7 @@
point we might want a language specific method to print the module
symbol so that we can customise the output more. */
else if (kind == MODULES_DOMAIN)
- printf_filtered ("%s\n", SYMBOL_PRINT_NAME (sym));
+ printf_filtered ("%s\n", sym->print_name ());
}
/* This help function for symtab_symbol_info() prints information
@@ -5118,7 +5117,7 @@
const char *fullname = symtab_to_fullname (symtab);
string = string_printf ("%s:'%s'", fullname,
- SYMBOL_LINKAGE_NAME (p.symbol));
+ p.symbol->linkage_name ());
break_command (&string[0], from_tty);
print_symbol_info (FUNCTIONS_DOMAIN, p.symbol, p.block, NULL);
}
@@ -5199,7 +5198,7 @@
const char *text, const char *word)
{
completion_list_add_name (tracker, SYMBOL_LANGUAGE (sym),
- SYMBOL_NATURAL_NAME (sym),
+ sym->natural_name (),
lookup_name, text, word);
}
@@ -5391,7 +5390,7 @@
if (SYMBOL_CLASS (sym) != LOC_BLOCK)
return {};
- lookup_name_info lookup_name (SYMBOL_SEARCH_NAME (sym),
+ lookup_name_info lookup_name (sym->search_name (),
symbol_name_match_type::SEARCH_NAME);
struct objfile *objfile = symbol_objfile (sym);
@@ -6281,7 +6280,7 @@
gdb_assert (sym->maybe_copied);
gdb_assert (SYMBOL_CLASS (sym) == LOC_STATIC);
- const char *linkage_name = SYMBOL_LINKAGE_NAME (sym);
+ const char *linkage_name = sym->linkage_name ();
for (objfile *objfile : current_program_space->objfiles ())
{
@@ -6362,7 +6361,7 @@
/* This is a module. */
gdb_assert (p.symbol != nullptr);
- std::string prefix = SYMBOL_PRINT_NAME (p.symbol);
+ std::string prefix = p.symbol->print_name ();
prefix += "::";
for (const symbol_search &q : symbols)
@@ -6370,7 +6369,8 @@
if (q.symbol == nullptr)
continue;
- if (strncmp (SYMBOL_PRINT_NAME (q.symbol), prefix.c_str (),
+ /* TODO: should this use startswith()? */
+ if (strncmp (q.symbol->print_name (), prefix.c_str (),
prefix.size ()) != 0)
continue;
@@ -6513,8 +6513,7 @@
if (last_module_symbol != p.symbol)
{
printf_filtered ("\n");
- printf_filtered (_("Module \"%s\":\n"),
- SYMBOL_PRINT_NAME (p.symbol));
+ printf_filtered (_("Module \"%s\":\n"), p.symbol->print_name ());
last_module_symbol = p.symbol;
last_filename = "";
}
@@ -66,7 +66,7 @@
/* Search name matching. This is like FULL, but the search name did
not come from the user; instead it is already a search name
- retrieved from a SYMBOL_SEARCH_NAME/search_name () call.
+ retrieved from a search_name () call.
For Ada, this avoids re-encoding an already-encoded search name
(which would potentially incorrectly lowercase letters in the
linkage/search name that should remain uppercase). For C++, it
@@ -551,43 +551,6 @@
gdb::string_view linkage_name, bool copy_name,
struct objfile_per_bfd_storage *per_bfd);
-/* Now come lots of name accessor macros. Short version as to when to
- use which: Use SYMBOL_NATURAL_NAME to refer to the name of the
- symbol in the original source code. Use SYMBOL_LINKAGE_NAME if you
- want to know what the linker thinks the symbol's name is. Use
- SYMBOL_PRINT_NAME for output. Use SYMBOL_DEMANGLED_NAME if you
- specifically need to know whether SYMBOL_NATURAL_NAME and
- SYMBOL_LINKAGE_NAME are different. */
-
-#define SYMBOL_NATURAL_NAME(symbol) \
- ((symbol)->natural_name ())
-
-/* Return SYMBOL's name from the point of view of the linker. In
- languages like C++ where symbols may be mangled for ease of
- manipulation by the linker, this is the mangled name; otherwise,
- it's the same as SYMBOL_NATURAL_NAME. */
-
-#define SYMBOL_LINKAGE_NAME(symbol) (symbol)->name
-
-#define SYMBOL_DEMANGLED_NAME(symbol) \
- ((symbol)->demangled_name ())
-
-/* Macro that returns a version of the name of a symbol that is
- suitable for output. In C++ this is the "demangled" form of the
- name if demangle is on and the "mangled" form of the name if
- demangle is off. In other languages this is just the symbol name.
- The result should never be NULL. Don't use this for internal
- purposes (e.g. storing in a hashtable): it's only suitable for output.
-
- N.B. symbol may be anything inheriting from general_symbol_info,
- e.g., struct symbol or struct minimal_symbol. */
-
-#define SYMBOL_PRINT_NAME(symbol) \
- (demangle ? SYMBOL_NATURAL_NAME (symbol) : SYMBOL_LINKAGE_NAME (symbol))
-
-#define SYMBOL_SEARCH_NAME(symbol) \
- ((symbol)->search_name ())
-
/* Return true if NAME matches the "search" name of SYMBOL, according
to the symbol's language. */
#define SYMBOL_MATCHES_SEARCH_NAME(symbol, name) \
@@ -1645,8 +1608,7 @@
DOMAIN, visible from lexical block BLOCK if non-NULL or from
global/static blocks if BLOCK is NULL. The passed-in search name
should not come from the user; instead it should already be a
- search name as retrieved from a
- SYMBOL_SEARCH_NAME/search_name () call. See definition of
+ search name as retrieved from a search_name () call. See definition of
symbol_name_match_type::SEARCH_NAME. Returns the struct symbol
pointer, or NULL if no symbol is found. The symbol's section is
fixed up if necessary. */
@@ -236,11 +236,11 @@
/* Save func name as "$trace_func", a debugger variable visible to
users. */
if (traceframe_fun == NULL
- || SYMBOL_LINKAGE_NAME (traceframe_fun) == NULL)
+ || traceframe_fun->linkage_name () == NULL)
clear_internalvar (lookup_internalvar ("trace_func"));
else
set_internalvar_string (lookup_internalvar ("trace_func"),
- SYMBOL_LINKAGE_NAME (traceframe_fun));
+ traceframe_fun->linkage_name ());
/* Save file name as "$trace_file", a debugger variable visible to
users. */
@@ -693,7 +693,7 @@
{
error (_("constant `%s' (value %s) "
"will not be collected."),
- SYMBOL_PRINT_NAME (exp->elts[2].symbol),
+ exp->elts[2].symbol->print_name (),
plongest (SYMBOL_VALUE (exp->elts[2].symbol)));
}
else if (SYMBOL_CLASS (exp->elts[2].symbol)
@@ -701,7 +701,7 @@
{
error (_("`%s' is optimized away "
"and cannot be collected."),
- SYMBOL_PRINT_NAME (exp->elts[2].symbol));
+ exp->elts[2].symbol->print_name ());
}
}
@@ -926,19 +926,18 @@
{
default:
printf_filtered ("%s: don't know symbol class %d\n",
- SYMBOL_PRINT_NAME (sym),
- SYMBOL_CLASS (sym));
+ sym->print_name (), SYMBOL_CLASS (sym));
break;
case LOC_CONST:
printf_filtered ("constant %s (value %s) will not be collected.\n",
- SYMBOL_PRINT_NAME (sym), plongest (SYMBOL_VALUE (sym)));
+ sym->print_name (), plongest (SYMBOL_VALUE (sym)));
break;
case LOC_STATIC:
offset = SYMBOL_VALUE_ADDRESS (sym);
if (info_verbose)
{
printf_filtered ("LOC_STATIC %s: collect %ld bytes at %s.\n",
- SYMBOL_PRINT_NAME (sym), len,
+ sym->print_name (), len,
paddress (gdbarch, offset));
}
/* A struct may be a C++ class with static fields, go to general
@@ -951,8 +950,7 @@
case LOC_REGISTER:
reg = SYMBOL_REGISTER_OPS (sym)->register_number (sym, gdbarch);
if (info_verbose)
- printf_filtered ("LOC_REG[parm] %s: ",
- SYMBOL_PRINT_NAME (sym));
+ printf_filtered ("LOC_REG[parm] %s: ", sym->print_name ());
add_local_register (gdbarch, reg, scope);
/* Check for doubles stored in two registers. */
/* FIXME: how about larger types stored in 3 or more regs? */
@@ -962,8 +960,7 @@
break;
case LOC_REF_ARG:
printf_filtered ("Sorry, don't know how to do LOC_REF_ARG yet.\n");
- printf_filtered (" (will not collect %s)\n",
- SYMBOL_PRINT_NAME (sym));
+ printf_filtered (" (will not collect %s)\n", sym->print_name ());
break;
case LOC_ARG:
reg = frame_regno;
@@ -971,8 +968,7 @@
if (info_verbose)
{
printf_filtered ("LOC_LOCAL %s: Collect %ld bytes at offset %s"
- " from frame ptr reg %d\n",
- SYMBOL_PRINT_NAME (sym), len,
+ " from frame ptr reg %d\n", sym->print_name (), len,
paddress (gdbarch, offset), reg);
}
add_memrange (gdbarch, reg, offset, len, scope);
@@ -983,8 +979,7 @@
if (info_verbose)
{
printf_filtered ("LOC_REGPARM_ADDR %s: Collect %ld bytes at offset %s"
- " from reg %d\n",
- SYMBOL_PRINT_NAME (sym), len,
+ " from reg %d\n", sym->print_name (), len,
paddress (gdbarch, offset), reg);
}
add_memrange (gdbarch, reg, offset, len, scope);
@@ -995,8 +990,7 @@
if (info_verbose)
{
printf_filtered ("LOC_LOCAL %s: Collect %ld bytes at offset %s"
- " from frame ptr reg %d\n",
- SYMBOL_PRINT_NAME (sym), len,
+ " from frame ptr reg %d\n", sym->print_name (), len,
paddress (gdbarch, offset), reg);
}
add_memrange (gdbarch, reg, offset, len, scope);
@@ -1008,7 +1002,7 @@
case LOC_OPTIMIZED_OUT:
printf_filtered ("%s has been optimized out of existence.\n",
- SYMBOL_PRINT_NAME (sym));
+ sym->print_name ());
break;
case LOC_COMPUTED:
@@ -1028,7 +1022,7 @@
if (!aexpr)
{
printf_filtered ("%s has been optimized out of existence.\n",
- SYMBOL_PRINT_NAME (sym));
+ sym->print_name ());
return;
}
@@ -1424,7 +1418,7 @@
case OP_VAR_VALUE:
{
struct symbol *sym = exp->elts[2].symbol;
- const char *name = SYMBOL_NATURAL_NAME (sym);
+ const char *name = sym->natural_name ();
collect->collect_symbol (exp->elts[2].symbol,
target_gdbarch (),
@@ -2526,7 +2520,7 @@
printf_filtered ("Scope for %s:\n", save_args);
count++;
- symname = SYMBOL_PRINT_NAME (sym);
+ symname = sym->print_name ();
if (symname == NULL || *symname == '\0')
continue; /* Probably botched, certainly useless. */
@@ -2616,7 +2610,7 @@
paddress (gdbarch, BLOCK_ENTRY_PC (SYMBOL_BLOCK_VALUE (sym))));
break;
case LOC_UNRESOLVED:
- msym = lookup_minimal_symbol (SYMBOL_LINKAGE_NAME (sym),
+ msym = lookup_minimal_symbol (sym->linkage_name (),
NULL, NULL);
if (msym.minsym == NULL)
printf_filtered ("Unresolved Static");
@@ -3689,7 +3683,7 @@
if (sym)
{
uiout->text ("in ");
- uiout->field_string ("func", SYMBOL_PRINT_NAME (sym),
+ uiout->field_string ("func", sym->print_name (),
function_name_style.style ());
uiout->wrap_hint (wrap_indent);
uiout->text (" at ");
@@ -239,7 +239,7 @@
continue;
tf = XOBNEW (&m_storage, struct decl_field);
- tf->name = SYMBOL_LINKAGE_NAME (TYPE_TEMPLATE_ARGUMENT (t, i));
+ tf->name = TYPE_TEMPLATE_ARGUMENT (t, i)->linkage_name ();
tf->type = SYMBOL_TYPE (TYPE_TEMPLATE_ARGUMENT (t, i));
slot = htab_find_slot (m_table, tf, INSERT);
@@ -1330,13 +1330,13 @@
error (_("Address requested for identifier "
"\"%s\" which is in register $%s"),
- SYMBOL_PRINT_NAME (var), regname);
+ var->print_name (), regname);
break;
}
default:
error (_("Can't take address of \"%s\" which isn't an lvalue."),
- SYMBOL_PRINT_NAME (var));
+ var->print_name ());
break;
}
@@ -2644,7 +2644,7 @@
if (fsym)
{
- qualified_name = SYMBOL_NATURAL_NAME (fsym);
+ qualified_name = fsym->natural_name ();
/* If we have a function with a C++ name, try to extract just
the function part. Do not try this for non-functions (e.g.
@@ -3061,7 +3061,7 @@
fprintf_filtered (gdb_stderr,
"Overloaded function instance "
"%s # of parms %d\n",
- SYMBOL_DEMANGLED_NAME (functions[ix]),
+ functions[ix]->demangled_name (),
(int) parm_types.size ());
for (jj = 0; jj < args.size () - static_offset; jj++)
fprintf_filtered (gdb_stderr,