Replace SYMBOL_*_NAME accessors with member functions

Similar to the MSYMBOL version of this patch, improves readability
and will eventually allow making name private.

gdb/ChangeLog:

2019-11-22  Christian Biesinger  <cbiesinger@google.com>

	* ada-exp.y: Update.
	* ada-lang.c (sort_choices): Update.
	(ada_print_symbol_signature): Update.
	(resolve_subexp): Update.
	(ada_parse_renaming): Update.
	(ada_read_renaming_var_value): Update.
	(lesseq_defined_than): Update.
	(remove_extra_symbols): Update.
	(remove_irrelevant_renamings): Update.
	(ada_add_block_symbols): Update.
	(ada_collect_symbol_completion_matches): Update.
	(ada_is_renaming_symbol): Update.
	(aggregate_assign_from_choices): Update.
	(ada_evaluate_subexp): Update.
	(ada_has_this_exception_support): Update.
	(ada_is_non_standard_exception_sym): Update.
	(ada_add_exceptions_from_frame): Update.
	(ada_add_global_exceptions): Update.
	(ada_print_subexp): Update.
	* ax-gdb.c (gen_var_ref): Update.
	(gen_maybe_namespace_elt): Update.
	(gen_expr_for_cast): Update.
	(gen_expr): Update.
	* block.h: Update.
	* blockframe.c (find_pc_partial_function): Update.
	* breakpoint.c (print_breakpoint_location): Update.
	(update_static_tracepoint): Update.
	* btrace.c (ftrace_print_function_name): Update.
	(ftrace_function_switched): Update.
	* buildsym.c (find_symbol_in_list): Update.
	* c-exp.y: Update.
	* c-typeprint.c (c_print_typedef): Update.
	(c_type_print_template_args): Update.
	* cli/cli-cmds.c (edit_command): Update.
	(list_command): Update.
	(print_sal_location): Update.
	* coffread.c (patch_opaque_types): Update.
	(process_coff_symbol): Update.
	(coff_read_enum_type): Update.
	* compile/compile-c-symbols.c (c_symbol_substitution_name): Update.
	(convert_one_symbol): Update.
	(hash_symname): Update.
	(eq_symname): Update.
	* compile/compile-cplus-symbols.c (convert_one_symbol): Update.
	* compile/compile-cplus-types.c (debug_print_scope): Update.
	* compile/compile-loc2c.c (do_compile_dwarf_expr_to_c): Update.
	* compile/compile-object-load.c (get_out_value_type): Update.
	* cp-namespace.c (cp_scan_for_anonymous_namespaces): Update.
	(search_symbol_list): Update.
	(cp_lookup_symbol_imports_or_template): Update.
	* cp-support.c (overload_list_add_symbol): Update.
	* ctfread.c (psymtab_to_symtab): Update.
	* dbxread.c (cp_set_block_scope): Update.
	* dictionary.c (iter_match_first_hashed): Update.
	(iter_match_next_hashed): Update.
	(insert_symbol_hashed): Update.
	(iter_match_next_linear): Update.
	* dictionary.h: Update.
	* dwarf2loc.c (func_get_frame_base_dwarf_block): Update.
	(locexpr_describe_location_piece): Update.
	(locexpr_describe_location_1): Update.
	(locexpr_generate_c_location): Update.
	(loclist_describe_location): Update.
	(loclist_generate_c_location): Update.
	* dwarf2read.c (dw2_debug_names_lookup_symbol): Update.
	(read_func_scope): Update.
	(process_enumeration_scope): Update.
	(new_symbol): Update.
	(dwarf2_const_value): Update.
	(dwarf2_symbol_mark_computed): Update.
	* eval.c (evaluate_funcall): Update.
	(evaluate_subexp_standard): Update.
	* expprint.c (print_subexp_standard): Update.
	(dump_subexp_body_standard): Update.
	* f-valprint.c (info_common_command_for_block): Update.
	* findvar.c (get_hosting_frame): Update.
	(default_read_var_value): Update.
	* go-lang.c (go_symbol_package_name): Update.
	* guile/scm-block.c (bkscm_print_block_smob): Update.
	* guile/scm-symbol.c (syscm_print_symbol_smob): Update.
	(gdbscm_symbol_name): Update.
	(gdbscm_symbol_linkage_name): Update.
	(gdbscm_symbol_print_name): Update.
	* infcall.c (get_function_name): Update.
	* infcmd.c (jump_command): Update.
	(finish_command): Update.
	* infrun.c (insert_exception_resume_breakpoint): Update.
	* linespec.c (canonicalize_linespec): Update.
	(create_sals_line_offset): Update.
	(convert_linespec_to_sals): Update.
	(complete_label): Update.
	(find_label_symbols_in_block): Update.
	* m2-typeprint.c (m2_print_typedef): Update.
	* mdebugread.c (mdebug_reg_to_regnum): Update.
	(parse_symbol): Update.
	(mylookup_symbol): Update.
	* mi/mi-cmd-stack.c (list_arg_or_local): Update.
	(list_args_or_locals): Update.
	* objc-lang.c (compare_selectors): Update.
	(info_selectors_command): Update.
	(compare_classes): Update.
	(info_classes_command): Update.
	(find_imps): Update.
	* p-typeprint.c (pascal_print_typedef): Update.
	* printcmd.c (build_address_symbolic): Update.
	(info_address_command): Update.
	(print_variable_and_value): Update.
	* python/py-framefilter.c (extract_sym): Update.
	(py_print_single_arg): Update.
	* python/py-symbol.c (sympy_str): Update.
	(sympy_get_name): Update.
	(sympy_get_linkage_name): Update.
	* python/python.c (gdbpy_rbreak): Update.
	* record-btrace.c (btrace_get_bfun_name): Update.
	(btrace_call_history): Update.
	* rust-lang.c (rust_print_typedef): Update.
	* solib-frv.c (frv_fdpic_find_canonical_descriptor): Update.
	* stabsread.c (stab_reg_to_regnum): Update.
	(define_symbol): Update.
	(read_enum_type): Update.
	(common_block_end): Update.
	(cleanup_undefined_types_1): Update.
	(scan_file_globals): Update.
	* stack.c (print_frame_arg): Update.
	(print_frame_args): Update.
	(find_frame_funname): Update.
	(info_frame_command_core): Update.
	(iterate_over_block_locals): Update.
	(print_block_frame_labels): Update.
	(do_print_variable_and_value): Update.
	(iterate_over_block_arg_vars): Update.
	(return_command): Update.
	* symmisc.c (dump_symtab_1): Update.
	(print_symbol): Update.
	* symtab.c (eq_symbol_entry): Update.
	(symbol_cache_dump): Update.
	(lookup_language_this): Update.
	(find_pc_sect_line): Update.
	(skip_prologue_sal): Update.
	(symbol_search::compare_search_syms): Update.
	(treg_matches_sym_type_name): Update.
	(search_symbols): Update.
	(print_symbol_info): Update.
	(rbreak_command): Update.
	(completion_list_add_symbol): Update.
	(find_gnu_ifunc): Update.
	(get_symbol_address): Update.
	(search_module_symbols): Update.
	(info_module_subcommand): Update.
	* symtab.h (SYMBOL_NATURAL_NAME): Remove.
	(SYMBOL_LINKAGE_NAME): Remove.
	(SYMBOL_DEMANGLED_NAME): Remove.
	(SYMBOL_PRINT_NAME): Remove.
	(SYMBOL_SEARCH_NAME): Remove.
	* tracepoint.c (set_traceframe_context): Update.
	(validate_actionline): Update.
	(collection_list::collect_symbol): Update.
	(encode_actions_1): Update.
	(info_scope_command): Update.
	(print_one_static_tracepoint_marker): Update.
	* typeprint.c (typedef_hash_table::add_template_parameters): Update.
	* valops.c (address_of_variable): Update.
	(find_overload_match): Update.
	(find_oload_champ): Update.

Change-Id: I76bdc8b44eea6876bf03af9d351f8e90cc0154b2
This commit is contained in:
Christian Biesinger 2019-11-22 12:05:14 -06:00
parent c9d95fa3d0
commit 987012b89b
57 changed files with 481 additions and 376 deletions

View file

@ -1,3 +1,170 @@
2019-11-22 Christian Biesinger <cbiesinger@google.com>
* ada-exp.y: Update.
* ada-lang.c (sort_choices): Update.
(ada_print_symbol_signature): Update.
(resolve_subexp): Update.
(ada_parse_renaming): Update.
(ada_read_renaming_var_value): Update.
(lesseq_defined_than): Update.
(remove_extra_symbols): Update.
(remove_irrelevant_renamings): Update.
(ada_add_block_symbols): Update.
(ada_collect_symbol_completion_matches): Update.
(ada_is_renaming_symbol): Update.
(aggregate_assign_from_choices): Update.
(ada_evaluate_subexp): Update.
(ada_has_this_exception_support): Update.
(ada_is_non_standard_exception_sym): Update.
(ada_add_exceptions_from_frame): Update.
(ada_add_global_exceptions): Update.
(ada_print_subexp): Update.
* ax-gdb.c (gen_var_ref): Update.
(gen_maybe_namespace_elt): Update.
(gen_expr_for_cast): Update.
(gen_expr): Update.
* block.h: Update.
* blockframe.c (find_pc_partial_function): Update.
* breakpoint.c (print_breakpoint_location): Update.
(update_static_tracepoint): Update.
* btrace.c (ftrace_print_function_name): Update.
(ftrace_function_switched): Update.
* buildsym.c (find_symbol_in_list): Update.
* c-exp.y: Update.
* c-typeprint.c (c_print_typedef): Update.
(c_type_print_template_args): Update.
* cli/cli-cmds.c (edit_command): Update.
(list_command): Update.
(print_sal_location): Update.
* coffread.c (patch_opaque_types): Update.
(process_coff_symbol): Update.
(coff_read_enum_type): Update.
* compile/compile-c-symbols.c (c_symbol_substitution_name): Update.
(convert_one_symbol): Update.
(hash_symname): Update.
(eq_symname): Update.
* compile/compile-cplus-symbols.c (convert_one_symbol): Update.
* compile/compile-cplus-types.c (debug_print_scope): Update.
* compile/compile-loc2c.c (do_compile_dwarf_expr_to_c): Update.
* compile/compile-object-load.c (get_out_value_type): Update.
* cp-namespace.c (cp_scan_for_anonymous_namespaces): Update.
(search_symbol_list): Update.
(cp_lookup_symbol_imports_or_template): Update.
* cp-support.c (overload_list_add_symbol): Update.
* ctfread.c (psymtab_to_symtab): Update.
* dbxread.c (cp_set_block_scope): Update.
* dictionary.c (iter_match_first_hashed): Update.
(iter_match_next_hashed): Update.
(insert_symbol_hashed): Update.
(iter_match_next_linear): Update.
* dictionary.h: Update.
* dwarf2loc.c (func_get_frame_base_dwarf_block): Update.
(locexpr_describe_location_piece): Update.
(locexpr_describe_location_1): Update.
(locexpr_generate_c_location): Update.
(loclist_describe_location): Update.
(loclist_generate_c_location): Update.
* dwarf2read.c (dw2_debug_names_lookup_symbol): Update.
(read_func_scope): Update.
(process_enumeration_scope): Update.
(new_symbol): Update.
(dwarf2_const_value): Update.
(dwarf2_symbol_mark_computed): Update.
* eval.c (evaluate_funcall): Update.
(evaluate_subexp_standard): Update.
* expprint.c (print_subexp_standard): Update.
(dump_subexp_body_standard): Update.
* f-valprint.c (info_common_command_for_block): Update.
* findvar.c (get_hosting_frame): Update.
(default_read_var_value): Update.
* go-lang.c (go_symbol_package_name): Update.
* guile/scm-block.c (bkscm_print_block_smob): Update.
* guile/scm-symbol.c (syscm_print_symbol_smob): Update.
(gdbscm_symbol_name): Update.
(gdbscm_symbol_linkage_name): Update.
(gdbscm_symbol_print_name): Update.
* infcall.c (get_function_name): Update.
* infcmd.c (jump_command): Update.
(finish_command): Update.
* infrun.c (insert_exception_resume_breakpoint): Update.
* linespec.c (canonicalize_linespec): Update.
(create_sals_line_offset): Update.
(convert_linespec_to_sals): Update.
(complete_label): Update.
(find_label_symbols_in_block): Update.
* m2-typeprint.c (m2_print_typedef): Update.
* mdebugread.c (mdebug_reg_to_regnum): Update.
(parse_symbol): Update.
(mylookup_symbol): Update.
* mi/mi-cmd-stack.c (list_arg_or_local): Update.
(list_args_or_locals): Update.
* objc-lang.c (compare_selectors): Update.
(info_selectors_command): Update.
(compare_classes): Update.
(info_classes_command): Update.
(find_imps): Update.
* p-typeprint.c (pascal_print_typedef): Update.
* printcmd.c (build_address_symbolic): Update.
(info_address_command): Update.
(print_variable_and_value): Update.
* python/py-framefilter.c (extract_sym): Update.
(py_print_single_arg): Update.
* python/py-symbol.c (sympy_str): Update.
(sympy_get_name): Update.
(sympy_get_linkage_name): Update.
* python/python.c (gdbpy_rbreak): Update.
* record-btrace.c (btrace_get_bfun_name): Update.
(btrace_call_history): Update.
* rust-lang.c (rust_print_typedef): Update.
* solib-frv.c (frv_fdpic_find_canonical_descriptor): Update.
* stabsread.c (stab_reg_to_regnum): Update.
(define_symbol): Update.
(read_enum_type): Update.
(common_block_end): Update.
(cleanup_undefined_types_1): Update.
(scan_file_globals): Update.
* stack.c (print_frame_arg): Update.
(print_frame_args): Update.
(find_frame_funname): Update.
(info_frame_command_core): Update.
(iterate_over_block_locals): Update.
(print_block_frame_labels): Update.
(do_print_variable_and_value): Update.
(iterate_over_block_arg_vars): Update.
(return_command): Update.
* symmisc.c (dump_symtab_1): Update.
(print_symbol): Update.
* symtab.c (eq_symbol_entry): Update.
(symbol_cache_dump): Update.
(lookup_language_this): Update.
(find_pc_sect_line): Update.
(skip_prologue_sal): Update.
(symbol_search::compare_search_syms): Update.
(treg_matches_sym_type_name): Update.
(search_symbols): Update.
(print_symbol_info): Update.
(rbreak_command): Update.
(completion_list_add_symbol): Update.
(find_gnu_ifunc): Update.
(get_symbol_address): Update.
(search_module_symbols): Update.
(info_module_subcommand): Update.
* symtab.h (SYMBOL_NATURAL_NAME): Remove.
(SYMBOL_LINKAGE_NAME): Remove.
(SYMBOL_DEMANGLED_NAME): Remove.
(SYMBOL_PRINT_NAME): Remove.
(SYMBOL_SEARCH_NAME): Remove.
* tracepoint.c (set_traceframe_context): Update.
(validate_actionline): Update.
(collection_list::collect_symbol): Update.
(encode_actions_1): Update.
(info_scope_command): Update.
(print_one_static_tracepoint_marker): Update.
* typeprint.c (typedef_hash_table::add_template_parameters): Update.
* valops.c (address_of_variable): Update.
(find_overload_match): Update.
(find_oload_champ): Update.
2019-11-22 Christian Biesinger <cbiesinger@google.com> 2019-11-22 Christian Biesinger <cbiesinger@google.com>
* ada-lang.c (ada_lookup_simple_minsym): Update. * ada-lang.c (ada_lookup_simple_minsym): Update.

View file

@ -1105,7 +1105,8 @@ write_ambiguous_var (struct parser_state *par_state,
struct symbol *sym = new (&temp_parse_space) symbol (); struct symbol *sym = new (&temp_parse_space) symbol ();
SYMBOL_DOMAIN (sym) = UNDEF_DOMAIN; 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; SYMBOL_LANGUAGE (sym) = language_ada;
write_exp_elt_opcode (par_state, OP_VAR_VALUE); write_exp_elt_opcode (par_state, OP_VAR_VALUE);

View file

@ -3201,8 +3201,8 @@ sort_choices (struct block_symbol syms[], int nsyms)
for (j = i - 1; j >= 0; j -= 1) for (j = i - 1; j >= 0; j -= 1)
{ {
if (encoded_ordered_before (SYMBOL_LINKAGE_NAME (syms[j].symbol), if (encoded_ordered_before (syms[j].symbol->linkage_name (),
SYMBOL_LINKAGE_NAME (sym.symbol))) sym.symbol->linkage_name ()))
break; break;
syms[j + 1] = syms[j]; syms[j + 1] = syms[j];
} }
@ -3225,7 +3225,7 @@ ada_print_symbol_signature (struct ui_file *stream, struct symbol *sym,
{ {
struct type *type = SYMBOL_TYPE (sym); struct type *type = SYMBOL_TYPE (sym);
fprintf_filtered (stream, "%s", SYMBOL_PRINT_NAME (sym)); fprintf_filtered (stream, "%s", sym->print_name ());
if (!print_signatures if (!print_signatures
|| type == NULL || type == NULL
|| TYPE_CODE (type) != TYPE_CODE_FUNC) || TYPE_CODE (type) != TYPE_CODE_FUNC)
@ -3431,7 +3431,7 @@ See set/show multiple-symbol."));
ada_print_type (SYMBOL_TYPE (syms[i].symbol), NULL, ada_print_type (SYMBOL_TYPE (syms[i].symbol), NULL,
gdb_stdout, -1, 0, &type_print_raw_options); gdb_stdout, -1, 0, &type_print_raw_options);
printf_filtered (_("'(%s) (enumeral)\n"), printf_filtered (_("'(%s) (enumeral)\n"),
SYMBOL_PRINT_NAME (syms[i].symbol)); syms[i].symbol->print_name ());
} }
else else
{ {
@ -3675,8 +3675,7 @@ resolve_subexp (expression_up *expp, int *pos, int deprocedure_p,
int n_candidates; int n_candidates;
n_candidates = n_candidates =
ada_lookup_symbol_list (SYMBOL_LINKAGE_NAME ada_lookup_symbol_list (exp->elts[pc + 2].symbol->linkage_name (),
(exp->elts[pc + 2].symbol),
exp->elts[pc + 1].block, VAR_DOMAIN, exp->elts[pc + 1].block, VAR_DOMAIN,
&candidates); &candidates);
@ -3718,7 +3717,7 @@ resolve_subexp (expression_up *expp, int *pos, int deprocedure_p,
if (n_candidates == 0) if (n_candidates == 0)
error (_("No definition found for %s"), 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) else if (n_candidates == 1)
i = 0; i = 0;
else if (deprocedure_p else if (deprocedure_p
@ -3726,16 +3725,16 @@ resolve_subexp (expression_up *expp, int *pos, int deprocedure_p,
{ {
i = ada_resolve_function i = ada_resolve_function
(candidates.data (), n_candidates, NULL, 0, (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); context_type, parse_completion);
if (i < 0) if (i < 0)
error (_("Could not find a match for %s"), error (_("Could not find a match for %s"),
SYMBOL_PRINT_NAME (exp->elts[pc + 2].symbol)); exp->elts[pc + 2].symbol->print_name ());
} }
else else
{ {
printf_filtered (_("Multiple matches for %s\n"), 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); user_select_syms (candidates.data (), n_candidates, 1);
i = 0; i = 0;
} }
@ -3765,8 +3764,7 @@ resolve_subexp (expression_up *expp, int *pos, int deprocedure_p,
int n_candidates; int n_candidates;
n_candidates = n_candidates =
ada_lookup_symbol_list (SYMBOL_LINKAGE_NAME ada_lookup_symbol_list (exp->elts[pc + 5].symbol->linkage_name (),
(exp->elts[pc + 5].symbol),
exp->elts[pc + 4].block, VAR_DOMAIN, exp->elts[pc + 4].block, VAR_DOMAIN,
&candidates); &candidates);
@ -3777,11 +3775,11 @@ resolve_subexp (expression_up *expp, int *pos, int deprocedure_p,
i = ada_resolve_function i = ada_resolve_function
(candidates.data (), n_candidates, (candidates.data (), n_candidates,
argvec, nargs, argvec, nargs,
SYMBOL_LINKAGE_NAME (exp->elts[pc + 5].symbol), exp->elts[pc + 5].symbol->linkage_name (),
context_type, parse_completion); context_type, parse_completion);
if (i < 0) if (i < 0)
error (_("Could not find a match for %s"), 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; exp->elts[pc + 4].block = candidates[i].block;
@ -4264,7 +4262,7 @@ ada_parse_renaming (struct symbol *sym,
case LOC_STATIC: case LOC_STATIC:
case LOC_COMPUTED: case LOC_COMPUTED:
case LOC_OPTIMIZED_OUT: case LOC_OPTIMIZED_OUT:
info = strstr (SYMBOL_LINKAGE_NAME (sym), "___XR"); info = strstr (sym->linkage_name (), "___XR");
if (info == NULL) if (info == NULL)
return ADA_NOT_RENAMING; return ADA_NOT_RENAMING;
switch (info[5]) switch (info[5])
@ -4313,7 +4311,7 @@ ada_read_renaming_var_value (struct symbol *renaming_sym,
{ {
const char *sym_name; 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); expression_up expr = parse_exp_1 (&sym_name, 0, block, 0);
return evaluate_expression (expr.get ()); return evaluate_expression (expr.get ());
} }
@ -4834,8 +4832,8 @@ lesseq_defined_than (struct symbol *sym0, struct symbol *sym1)
{ {
struct type *type0 = SYMBOL_TYPE (sym0); struct type *type0 = SYMBOL_TYPE (sym0);
struct type *type1 = SYMBOL_TYPE (sym1); struct type *type1 = SYMBOL_TYPE (sym1);
const char *name0 = SYMBOL_LINKAGE_NAME (sym0); const char *name0 = sym0->linkage_name ();
const char *name1 = SYMBOL_LINKAGE_NAME (sym1); const char *name1 = sym1->linkage_name ();
int len0 = strlen (name0); int len0 = strlen (name0);
return return
@ -4850,8 +4848,8 @@ lesseq_defined_than (struct symbol *sym0, struct symbol *sym1)
case LOC_STATIC: case LOC_STATIC:
{ {
const char *name0 = SYMBOL_LINKAGE_NAME (sym0); const char *name0 = sym0->linkage_name ();
const char *name1 = SYMBOL_LINKAGE_NAME (sym1); const char *name1 = sym1->linkage_name ();
return (strcmp (name0, name1) == 0 return (strcmp (name0, name1) == 0
&& SYMBOL_VALUE_ADDRESS (sym0) == SYMBOL_VALUE_ADDRESS (sym1)); && SYMBOL_VALUE_ADDRESS (sym0) == SYMBOL_VALUE_ADDRESS (sym1));
} }
@ -5112,15 +5110,15 @@ remove_extra_symbols (std::vector<struct block_symbol> *syms)
the get rid of the stub. */ the get rid of the stub. */
if (TYPE_STUB (SYMBOL_TYPE ((*syms)[i].symbol)) 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++) for (j = 0; j < syms->size (); j++)
{ {
if (j != i if (j != i
&& !TYPE_STUB (SYMBOL_TYPE ((*syms)[j].symbol)) && !TYPE_STUB (SYMBOL_TYPE ((*syms)[j].symbol))
&& SYMBOL_LINKAGE_NAME ((*syms)[j].symbol) != NULL && (*syms)[j].symbol->linkage_name () != NULL
&& strcmp (SYMBOL_LINKAGE_NAME ((*syms)[i].symbol), && strcmp ((*syms)[i].symbol->linkage_name (),
SYMBOL_LINKAGE_NAME ((*syms)[j].symbol)) == 0) (*syms)[j].symbol->linkage_name ()) == 0)
remove_p = 1; remove_p = 1;
} }
} }
@ -5128,16 +5126,16 @@ remove_extra_symbols (std::vector<struct block_symbol> *syms)
/* Two symbols with the same name, same class and same address /* Two symbols with the same name, same class and same address
should be identical. */ 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 && SYMBOL_CLASS ((*syms)[i].symbol) == LOC_STATIC
&& is_nondebugging_type (SYMBOL_TYPE ((*syms)[i].symbol))) && is_nondebugging_type (SYMBOL_TYPE ((*syms)[i].symbol)))
{ {
for (j = 0; j < syms->size (); j += 1) for (j = 0; j < syms->size (); j += 1)
{ {
if (i != j if (i != j
&& SYMBOL_LINKAGE_NAME ((*syms)[j].symbol) != NULL && (*syms)[j].symbol->linkage_name () != NULL
&& strcmp (SYMBOL_LINKAGE_NAME ((*syms)[i].symbol), && strcmp ((*syms)[i].symbol->linkage_name (),
SYMBOL_LINKAGE_NAME ((*syms)[j].symbol)) == 0 (*syms)[j].symbol->linkage_name ()) == 0
&& SYMBOL_CLASS ((*syms)[i].symbol) && SYMBOL_CLASS ((*syms)[i].symbol)
== SYMBOL_CLASS ((*syms)[j].symbol) == SYMBOL_CLASS ((*syms)[j].symbol)
&& SYMBOL_VALUE_ADDRESS ((*syms)[i].symbol) && SYMBOL_VALUE_ADDRESS ((*syms)[i].symbol)
@ -5314,7 +5312,7 @@ remove_irrelevant_renamings (std::vector<struct block_symbol> *syms,
if (sym == NULL || SYMBOL_CLASS (sym) == LOC_TYPEDEF) if (sym == NULL || SYMBOL_CLASS (sym) == LOC_TYPEDEF)
continue; continue;
name = SYMBOL_LINKAGE_NAME (sym); name = sym->linkage_name ();
suffix = strstr (name, "___XR"); suffix = strstr (name, "___XR");
if (suffix != NULL) if (suffix != NULL)
@ -5325,7 +5323,7 @@ remove_irrelevant_renamings (std::vector<struct block_symbol> *syms,
is_new_style_renaming = 1; is_new_style_renaming = 1;
for (j = 0; j < syms->size (); j += 1) for (j = 0; j < syms->size (); j += 1)
if (i != j && (*syms)[j].symbol != NULL 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 name_len) == 0
&& block == (*syms)[j].block) && block == (*syms)[j].block)
(*syms)[j].symbol = NULL; (*syms)[j].symbol = NULL;
@ -5354,7 +5352,7 @@ remove_irrelevant_renamings (std::vector<struct block_symbol> *syms,
if (current_function == NULL) if (current_function == NULL)
return syms->size (); return syms->size ();
current_function_name = SYMBOL_LINKAGE_NAME (current_function); current_function_name = current_function->linkage_name ();
if (current_function_name == NULL) if (current_function_name == NULL)
return syms->size (); return syms->size ();
@ -6267,17 +6265,17 @@ ada_add_block_symbols (struct obstack *obstackp,
{ {
int cmp; int cmp;
cmp = (int) '_' - (int) SYMBOL_LINKAGE_NAME (sym)[0]; cmp = (int) '_' - (int) sym->linkage_name ()[0];
if (cmp == 0) if (cmp == 0)
{ {
cmp = !startswith (SYMBOL_LINKAGE_NAME (sym), "_ada_"); cmp = !startswith (sym->linkage_name (), "_ada_");
if (cmp == 0) if (cmp == 0)
cmp = strncmp (name, SYMBOL_LINKAGE_NAME (sym) + 5, cmp = strncmp (name, sym->linkage_name () + 5,
name_len); name_len);
} }
if (cmp == 0 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) if (SYMBOL_CLASS (sym) != LOC_UNRESOLVED)
{ {
@ -6469,7 +6467,7 @@ ada_collect_symbol_completion_matches (completion_tracker &tracker,
completion_list_add_name (tracker, completion_list_add_name (tracker,
SYMBOL_LANGUAGE (sym), SYMBOL_LANGUAGE (sym),
SYMBOL_LINKAGE_NAME (sym), sym->linkage_name (),
lookup_name, text, word); lookup_name, text, word);
} }
} }
@ -6490,7 +6488,7 @@ ada_collect_symbol_completion_matches (completion_tracker &tracker,
completion_list_add_name (tracker, completion_list_add_name (tracker,
SYMBOL_LANGUAGE (sym), SYMBOL_LANGUAGE (sym),
SYMBOL_LINKAGE_NAME (sym), sym->linkage_name (),
lookup_name, text, word); lookup_name, text, word);
} }
} }
@ -6512,7 +6510,7 @@ ada_collect_symbol_completion_matches (completion_tracker &tracker,
completion_list_add_name (tracker, completion_list_add_name (tracker,
SYMBOL_LANGUAGE (sym), SYMBOL_LANGUAGE (sym),
SYMBOL_LINKAGE_NAME (sym), sym->linkage_name (),
lookup_name, text, word); lookup_name, text, word);
} }
} }
@ -7856,7 +7854,7 @@ ada_find_any_type (const char *name)
static bool static bool
ada_is_renaming_symbol (struct symbol *name_sym) 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; return strstr (name, "___XR") != NULL;
} }
@ -9945,7 +9943,7 @@ aggregate_assign_from_choices (struct value *container,
name = &exp->elts[choice_pos + 2].string; name = &exp->elts[choice_pos + 2].string;
break; break;
case OP_VAR_VALUE: case OP_VAR_VALUE:
name = SYMBOL_NATURAL_NAME (exp->elts[choice_pos + 2].symbol); name = exp->elts[choice_pos + 2].symbol->natural_name ();
break; break;
default: default:
error (_("Invalid record component association.")); error (_("Invalid record component association."));
@ -10610,7 +10608,7 @@ ada_evaluate_subexp (struct type *expect_type, struct expression *exp,
context other than a function call, in which case, it is context other than a function call, in which case, it is
invalid. */ invalid. */
error (_("Unexpected unresolved symbol, %s, during evaluation"), 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) if (noside == EVAL_AVOID_SIDE_EFFECTS)
{ {
@ -10700,7 +10698,7 @@ ada_evaluate_subexp (struct type *expect_type, struct expression *exp,
if (exp->elts[*pos].opcode == OP_VAR_VALUE if (exp->elts[*pos].opcode == OP_VAR_VALUE
&& SYMBOL_DOMAIN (exp->elts[pc + 5].symbol) == UNDEF_DOMAIN) && SYMBOL_DOMAIN (exp->elts[pc + 5].symbol) == UNDEF_DOMAIN)
error (_("Unexpected unresolved symbol, %s, during evaluation"), error (_("Unexpected unresolved symbol, %s, during evaluation"),
SYMBOL_PRINT_NAME (exp->elts[pc + 5].symbol)); exp->elts[pc + 5].symbol->print_name ());
else else
{ {
for (tem = 0; tem <= nargs; tem += 1) for (tem = 0; tem <= nargs; tem += 1)
@ -11923,7 +11921,7 @@ ada_has_this_exception_support (const struct exception_support_info *einfo)
if (SYMBOL_CLASS (sym) != LOC_BLOCK) if (SYMBOL_CLASS (sym) != LOC_BLOCK)
{ {
error (_("Symbol \"%s\" is not a function (class = %d)"), error (_("Symbol \"%s\" is not a function (class = %d)"),
SYMBOL_LINKAGE_NAME (sym), SYMBOL_CLASS (sym)); sym->linkage_name (), SYMBOL_CLASS (sym));
return 0; return 0;
} }
@ -11946,7 +11944,7 @@ ada_has_this_exception_support (const struct exception_support_info *einfo)
if (SYMBOL_CLASS (sym) != LOC_BLOCK) if (SYMBOL_CLASS (sym) != LOC_BLOCK)
{ {
error (_("Symbol \"%s\" is not a function (class = %d)"), error (_("Symbol \"%s\" is not a function (class = %d)"),
SYMBOL_LINKAGE_NAME (sym), SYMBOL_CLASS (sym)); sym->linkage_name (), SYMBOL_CLASS (sym));
return 0; return 0;
} }
@ -13141,13 +13139,13 @@ ada_is_non_standard_exception_sym (struct symbol *sym)
return 0; return 0;
for (i = 0; i < ARRAY_SIZE (standard_exc); i++) 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. */ return 0; /* A standard exception. */
/* Numeric_Error is also a standard exception, so exclude it. /* Numeric_Error is also a standard exception, so exclude it.
See the STANDARD_EXC description for more details as to why See the STANDARD_EXC description for more details as to why
this exception is not listed in that array. */ 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 0;
return 1; return 1;
@ -13260,7 +13258,7 @@ ada_add_exceptions_from_frame (compiled_regex *preg,
default: default:
if (ada_is_exception_sym (sym)) 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)}; SYMBOL_VALUE_ADDRESS (sym)};
exceptions->push_back (info); exceptions->push_back (info);
@ -13333,10 +13331,10 @@ ada_add_global_exceptions (compiled_regex *preg,
ALL_BLOCK_SYMBOLS (b, iter, sym) ALL_BLOCK_SYMBOLS (b, iter, sym)
if (ada_is_non_standard_exception_sym (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 struct ada_exc_info info
= {SYMBOL_PRINT_NAME (sym), SYMBOL_VALUE_ADDRESS (sym)}; = {sym->print_name (), SYMBOL_VALUE_ADDRESS (sym)};
exceptions->push_back (info); exceptions->push_back (info);
} }
@ -13664,7 +13662,7 @@ ada_print_subexp (struct expression *exp, int *pos,
return; return;
case OP_VAR_VALUE: 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; return;
case BINOP_IN_BOUNDS: case BINOP_IN_BOUNDS:

View file

@ -675,7 +675,7 @@ gen_var_ref (struct agent_expr *ax, struct axs_value *value, struct symbol *var)
case LOC_TYPEDEF: case LOC_TYPEDEF:
error (_("Cannot compute value of typedef `%s'."), error (_("Cannot compute value of typedef `%s'."),
SYMBOL_PRINT_NAME (var)); var->print_name ());
break; break;
case LOC_BLOCK: case LOC_BLOCK:
@ -705,10 +705,10 @@ gen_var_ref (struct agent_expr *ax, struct axs_value *value, struct symbol *var)
case LOC_UNRESOLVED: case LOC_UNRESOLVED:
{ {
struct bound_minimal_symbol msym 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) 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. */ /* Push the address of the variable. */
ax_const_l (ax, BMSYMBOL_VALUE_ADDRESS (msym)); ax_const_l (ax, BMSYMBOL_VALUE_ADDRESS (msym));
@ -727,7 +727,7 @@ gen_var_ref (struct agent_expr *ax, struct axs_value *value, struct symbol *var)
default: default:
error (_("Cannot find value of botched symbol `%s'."), error (_("Cannot find value of botched symbol `%s'."),
SYMBOL_PRINT_NAME (var)); var->print_name ());
break; break;
} }
} }
@ -1658,7 +1658,7 @@ gen_maybe_namespace_elt (struct agent_expr *ax, struct axs_value *value,
if (value->optimized_out) if (value->optimized_out)
error (_("`%s' has been optimized out, cannot use"), error (_("`%s' has been optimized out, cannot use"),
SYMBOL_PRINT_NAME (sym.symbol)); sym.symbol->print_name ());
return 1; return 1;
} }
@ -1784,7 +1784,7 @@ gen_expr_for_cast (struct expression *exp, union exp_element **pc,
if (value->optimized_out) if (value->optimized_out)
error (_("`%s' has been optimized out, cannot use"), error (_("`%s' has been optimized out, cannot use"),
SYMBOL_PRINT_NAME ((*pc)[2].symbol)); (*pc)[2].symbol->print_name ());
} }
else else
gen_msym_var_ref (ax, value, (*pc)[2].msymbol, (*pc)[1].objfile); gen_msym_var_ref (ax, value, (*pc)[2].msymbol, (*pc)[1].objfile);
@ -2008,10 +2008,10 @@ gen_expr (struct expression *exp, union exp_element **pc,
if (value->optimized_out) if (value->optimized_out)
error (_("`%s' has been optimized out, cannot use"), 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) 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; (*pc) += 4;
break; break;
@ -2240,7 +2240,7 @@ gen_expr (struct expression *exp, union exp_element **pc,
if (value->optimized_out) if (value->optimized_out)
error (_("`%s' has been optimized out, cannot use"), error (_("`%s' has been optimized out, cannot use"),
SYMBOL_PRINT_NAME (sym)); sym->print_name ());
(*pc) += 2; (*pc) += 2;
} }

View file

@ -325,7 +325,7 @@ extern struct symbol *block_iterator_first (const struct block *block,
extern struct symbol *block_iterator_next (struct block_iterator *iterator); extern struct symbol *block_iterator_next (struct block_iterator *iterator);
/* Initialize ITERATOR to point at the first symbol in BLOCK whose /* 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. */ NULL if there are no such symbols. */
extern struct symbol *block_iter_match_first (const struct block *block, extern struct symbol *block_iter_match_first (const struct block *block,
@ -333,7 +333,7 @@ extern struct symbol *block_iter_match_first (const struct block *block,
struct block_iterator *iterator); struct block_iterator *iterator);
/* Advance ITERATOR to point at the next symbol in BLOCK whose /* 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 symbols. Don't call this if you've previously received NULL from
block_iterator_match_first or block_iterator_match_next on this block_iterator_match_first or block_iterator_match_next on this
iteration. And don't call it unless ITERATOR was created by a iteration. And don't call it unless ITERATOR was created by a

View file

@ -269,7 +269,7 @@ find_pc_partial_function (CORE_ADDR pc, const char **name, CORE_ADDR *address,
{ {
const struct block *b = SYMBOL_BLOCK_VALUE (f); 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_section = section;
cache_pc_function_block = b; cache_pc_function_block = b;

View file

@ -5818,7 +5818,7 @@ print_breakpoint_location (struct breakpoint *b,
if (sym) if (sym)
{ {
uiout->text ("in "); uiout->text ("in ");
uiout->field_string ("func", SYMBOL_PRINT_NAME (sym), uiout->field_string ("func", sym->print_name (),
function_name_style.style ()); function_name_style.style ());
uiout->text (" "); uiout->text (" ");
uiout->wrap_hint (wrap_indent_at_field (uiout, "what")); uiout->wrap_hint (wrap_indent_at_field (uiout, "what"));
@ -13304,7 +13304,7 @@ update_static_tracepoint (struct breakpoint *b, struct symtab_and_line sal)
uiout->text ("Now in "); uiout->text ("Now in ");
if (sym) if (sym)
{ {
uiout->field_string ("func", SYMBOL_PRINT_NAME (sym), uiout->field_string ("func", sym->print_name (),
function_name_style.style ()); function_name_style.style ());
uiout->text (" at "); uiout->text (" at ");
} }

View file

@ -82,7 +82,7 @@ ftrace_print_function_name (const struct btrace_function *bfun)
sym = bfun->sym; sym = bfun->sym;
if (sym != NULL) if (sym != NULL)
return SYMBOL_PRINT_NAME (sym); return sym->print_name ();
if (msym != NULL) if (msym != NULL)
return msym->print_name (); return msym->print_name ();
@ -206,7 +206,7 @@ ftrace_function_switched (const struct btrace_function *bfun,
const char *bfname, *fname; const char *bfname, *fname;
/* Check the function name. */ /* 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; return 1;
/* Check the location of those functions, as well. */ /* Check the location of those functions, as well. */

View file

@ -164,7 +164,7 @@ find_symbol_in_list (struct pending *list, char *name, int length)
{ {
for (j = list->nsyms; --j >= 0;) 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 if (*pp == *name && strncmp (pp, name, length) == 0
&& pp[length] == '\0') && pp[length] == '\0')
{ {
@ -319,7 +319,7 @@ buildsym_compunit::finish_block_internal
{ {
complaint (_("block end address less than block " complaint (_("block end address less than block "
"start address in %s (patched it)"), "start address in %s (patched it)"),
SYMBOL_PRINT_NAME (symbol)); symbol->print_name ());
} }
else else
{ {
@ -356,7 +356,7 @@ buildsym_compunit::finish_block_internal
if (symbol) if (symbol)
{ {
complaint (_("inner block not inside outer block in %s"), complaint (_("inner block not inside outer block in %s"),
SYMBOL_PRINT_NAME (symbol)); symbol->print_name ());
} }
else else
{ {

View file

@ -3393,7 +3393,7 @@ c_print_token (FILE *file, int type, YYSTYPE value)
parser_fprintf (file, "ssym<name=%s, sym=%s, field_of_this=%d>", parser_fprintf (file, "ssym<name=%s, sym=%s, field_of_this=%d>",
copy_name (value.ssym.stoken).c_str (), copy_name (value.ssym.stoken).c_str (),
(value.ssym.sym.symbol == NULL (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); value.ssym.is_a_field_of_this);
break; break;

View file

@ -208,9 +208,9 @@ c_print_typedef (struct type *type,
type_print (type, "", stream, -1); type_print (type, "", stream, -1);
if (TYPE_NAME ((SYMBOL_TYPE (new_symbol))) == 0 if (TYPE_NAME ((SYMBOL_TYPE (new_symbol))) == 0
|| strcmp (TYPE_NAME ((SYMBOL_TYPE (new_symbol))), || 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) || 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, ";"); fprintf_filtered (stream, ";");
} }
@ -880,15 +880,14 @@ c_type_print_template_args (const struct type_print_options *flags,
if (first) if (first)
{ {
wrap_here (" "); wrap_here (" ");
fprintf_filtered (stream, _("[with %s = "), fprintf_filtered (stream, _("[with %s = "), sym->linkage_name ());
SYMBOL_LINKAGE_NAME (sym));
first = 0; first = 0;
} }
else else
{ {
fputs_filtered (", ", stream); fputs_filtered (", ", stream);
wrap_here (" "); 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); c_print_type (SYMBOL_TYPE (sym), "", stream, -1, 0, flags);

View file

@ -938,7 +938,7 @@ edit_command (const char *arg, int from_tty)
if (sym) if (sym)
printf_filtered ("%s is in %s (%s:%d).\n", printf_filtered ("%s is in %s (%s:%d).\n",
paddress (gdbarch, sal.pc), paddress (gdbarch, sal.pc),
SYMBOL_PRINT_NAME (sym), sym->print_name (),
symtab_to_filename_for_display (sal.symtab), symtab_to_filename_for_display (sal.symtab),
sal.line); sal.line);
else else
@ -1270,7 +1270,7 @@ list_command (const char *arg, int from_tty)
if (sym) if (sym)
printf_filtered ("%s is in %s (%s:%d).\n", printf_filtered ("%s is in %s (%s:%d).\n",
paddress (gdbarch, sal.pc), paddress (gdbarch, sal.pc),
SYMBOL_PRINT_NAME (sym), sym->print_name (),
symtab_to_filename_for_display (sal.symtab), sal.line); symtab_to_filename_for_display (sal.symtab), sal.line);
else else
printf_filtered ("%s is at %s:%d.\n", printf_filtered ("%s is at %s:%d.\n",
@ -1758,7 +1758,7 @@ print_sal_location (const symtab_and_line &sal)
const char *sym_name = NULL; const char *sym_name = NULL;
if (sal.symbol != 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"), printf_filtered (_("file: \"%s\", line number: %d, symbol: \"%s\"\n"),
symtab_to_filename_for_display (sal.symtab), symtab_to_filename_for_display (sal.symtab),
sal.line, sym_name != NULL ? sym_name : "???"); sal.line, sym_name != NULL ? sym_name : "???");

View file

@ -1502,15 +1502,15 @@ patch_opaque_types (struct symtab *s)
&& TYPE_CODE (SYMBOL_TYPE (real_sym)) == TYPE_CODE_PTR && TYPE_CODE (SYMBOL_TYPE (real_sym)) == TYPE_CODE_PTR
&& TYPE_LENGTH (TYPE_TARGET_TYPE (SYMBOL_TYPE (real_sym))) != 0) && 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); int hash = hashname (name);
struct symbol *sym, *prev; struct symbol *sym, *prev;
prev = 0; prev = 0;
for (sym = opaque_type_chain[hash]; sym;) for (sym = opaque_type_chain[hash]; sym;)
{ {
if (name[0] == SYMBOL_LINKAGE_NAME (sym)[0] if (name[0] == sym->linkage_name ()[0]
&& strcmp (name + 1, SYMBOL_LINKAGE_NAME (sym) + 1) == 0) && strcmp (name + 1, sym->linkage_name () + 1) == 0)
{ {
if (prev) if (prev)
{ {
@ -1693,7 +1693,7 @@ process_coff_symbol (struct coff_symbol *cs,
} }
else else
TYPE_NAME (SYMBOL_TYPE (sym)) = TYPE_NAME (SYMBOL_TYPE (sym)) =
xstrdup (SYMBOL_LINKAGE_NAME (sym)); xstrdup (sym->linkage_name ());
} }
/* Keep track of any type which points to empty structured /* Keep track of any type which points to empty structured
@ -1707,7 +1707,7 @@ process_coff_symbol (struct coff_symbol *cs,
&& TYPE_CODE (TYPE_TARGET_TYPE (SYMBOL_TYPE (sym))) && TYPE_CODE (TYPE_TARGET_TYPE (SYMBOL_TYPE (sym)))
!= TYPE_CODE_UNDEF) != TYPE_CODE_UNDEF)
{ {
int i = hashname (SYMBOL_LINKAGE_NAME (sym)); int i = hashname (sym->linkage_name ());
SYMBOL_VALUE_CHAIN (sym) = opaque_type_chain[i]; SYMBOL_VALUE_CHAIN (sym) = opaque_type_chain[i];
opaque_type_chain[i] = sym; opaque_type_chain[i] = sym;
@ -1725,11 +1725,10 @@ process_coff_symbol (struct coff_symbol *cs,
names for anonymous enums, structures, and unions, like names for anonymous enums, structures, and unions, like
"~0fake" or ".0fake". Thanks, but no thanks... */ "~0fake" or ".0fake". Thanks, but no thanks... */
if (TYPE_NAME (SYMBOL_TYPE (sym)) == 0) if (TYPE_NAME (SYMBOL_TYPE (sym)) == 0)
if (SYMBOL_LINKAGE_NAME (sym) != NULL if (sym->linkage_name () != NULL
&& *SYMBOL_LINKAGE_NAME (sym) != '~' && *sym->linkage_name () != '~'
&& *SYMBOL_LINKAGE_NAME (sym) != '.') && *sym->linkage_name () != '.')
TYPE_NAME (SYMBOL_TYPE (sym)) = TYPE_NAME (SYMBOL_TYPE (sym)) = xstrdup (sym->linkage_name ());
xstrdup (SYMBOL_LINKAGE_NAME (sym));
add_symbol_to_list (sym, get_file_symbols ()); add_symbol_to_list (sym, get_file_symbols ());
break; break;
@ -2154,7 +2153,7 @@ coff_read_enum_type (int index, int length, int lastsym,
struct symbol *xsym = syms->symbol[j]; struct symbol *xsym = syms->symbol[j];
SYMBOL_TYPE (xsym) = type; 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)); SET_FIELD_ENUMVAL (TYPE_FIELD (type, n), SYMBOL_VALUE (xsym));
if (SYMBOL_VALUE (xsym) < 0) if (SYMBOL_VALUE (xsym) < 0)
unsigned_enum = 0; unsigned_enum = 0;

View file

@ -40,7 +40,7 @@ gdb::unique_xmalloc_ptr<char>
c_symbol_substitution_name (struct symbol *sym) c_symbol_substitution_name (struct symbol *sym)
{ {
return gdb::unique_xmalloc_ptr<char> 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. /* Convert a given symbol, SYM, to the compiler's representation.
@ -70,7 +70,7 @@ convert_one_symbol (compile_c_instance *context,
if (SYMBOL_DOMAIN (sym.symbol) == STRUCT_DOMAIN) if (SYMBOL_DOMAIN (sym.symbol) == STRUCT_DOMAIN)
{ {
/* Binding a tag, so we don't need to build a decl. */ /* 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); sym_type, filename, line);
} }
else else
@ -105,28 +105,28 @@ convert_one_symbol (compile_c_instance *context,
return; return;
} }
context->plugin ().build_constant context->plugin ().build_constant
(sym_type, SYMBOL_NATURAL_NAME (sym.symbol), (sym_type, sym.symbol->natural_name (),
SYMBOL_VALUE (sym.symbol), SYMBOL_VALUE (sym.symbol),
filename, line); filename, line);
return; return;
case LOC_CONST_BYTES: case LOC_CONST_BYTES:
error (_("Unsupported LOC_CONST_BYTES for symbol \"%s\"."), error (_("Unsupported LOC_CONST_BYTES for symbol \"%s\"."),
SYMBOL_PRINT_NAME (sym.symbol)); sym.symbol->print_name ());
case LOC_UNDEF: case LOC_UNDEF:
internal_error (__FILE__, __LINE__, _("LOC_UNDEF found for \"%s\"."), internal_error (__FILE__, __LINE__, _("LOC_UNDEF found for \"%s\"."),
SYMBOL_PRINT_NAME (sym.symbol)); sym.symbol->print_name ());
case LOC_COMMON_BLOCK: case LOC_COMMON_BLOCK:
error (_("Fortran common block is unsupported for compilation " error (_("Fortran common block is unsupported for compilation "
"evaluaton of symbol \"%s\"."), "evaluaton of symbol \"%s\"."),
SYMBOL_PRINT_NAME (sym.symbol)); sym.symbol->print_name ());
case LOC_OPTIMIZED_OUT: case LOC_OPTIMIZED_OUT:
error (_("Symbol \"%s\" cannot be used for compilation evaluation " error (_("Symbol \"%s\" cannot be used for compilation evaluation "
"as it is optimized out."), "as it is optimized out."),
SYMBOL_PRINT_NAME (sym.symbol)); sym.symbol->print_name ());
case LOC_COMPUTED: case LOC_COMPUTED:
if (is_local) if (is_local)
@ -135,7 +135,7 @@ convert_one_symbol (compile_c_instance *context,
warning (_("Symbol \"%s\" is thread-local and currently can only " warning (_("Symbol \"%s\" is thread-local and currently can only "
"be referenced from the current thread in " "be referenced from the current thread in "
"compiled code."), "compiled code."),
SYMBOL_PRINT_NAME (sym.symbol)); sym.symbol->print_name ());
/* FALLTHROUGH */ /* FALLTHROUGH */
case LOC_UNRESOLVED: case LOC_UNRESOLVED:
/* 'symbol_name' cannot be used here as that one is used only for /* 'symbol_name' cannot be used here as that one is used only for
@ -152,14 +152,14 @@ convert_one_symbol (compile_c_instance *context,
if (frame == NULL) if (frame == NULL)
error (_("Symbol \"%s\" cannot be used because " error (_("Symbol \"%s\" cannot be used because "
"there is no selected frame"), "there is no selected frame"),
SYMBOL_PRINT_NAME (sym.symbol)); sym.symbol->print_name ());
} }
val = read_var_value (sym.symbol, sym.block, frame); val = read_var_value (sym.symbol, sym.block, frame);
if (VALUE_LVAL (val) != lval_memory) if (VALUE_LVAL (val) != lval_memory)
error (_("Symbol \"%s\" cannot be used for compilation " error (_("Symbol \"%s\" cannot be used for compilation "
"evaluation as its address has not been found."), "evaluation as its address has not been found."),
SYMBOL_PRINT_NAME (sym.symbol)); sym.symbol->print_name ());
kind = GCC_C_SYMBOL_VARIABLE; kind = GCC_C_SYMBOL_VARIABLE;
addr = value_address (val); addr = value_address (val);
@ -193,7 +193,7 @@ convert_one_symbol (compile_c_instance *context,
|| symbol_name == NULL) || symbol_name == NULL)
{ {
decl = context->plugin ().build_decl decl = context->plugin ().build_decl
(SYMBOL_NATURAL_NAME (sym.symbol), (sym.symbol->natural_name (),
kind, kind,
sym_type, sym_type,
symbol_name.get (), addr, symbol_name.get (), addr,
@ -450,7 +450,7 @@ hash_symname (const void *a)
{ {
const struct symbol *sym = (const struct symbol *) a; 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 /* A comparison function for hash tables that just looks at symbol
@ -462,7 +462,7 @@ eq_symname (const void *a, const void *b)
const struct symbol *syma = (const struct symbol *) a; const struct symbol *syma = (const struct symbol *) a;
const struct symbol *symb = (const struct symbol *) b; 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 /* If a symbol with the same name as SYM is already in HASHTAB, return

View file

@ -100,27 +100,27 @@ convert_one_symbol (compile_cplus_instance *instance,
return; return;
} }
instance->plugin ().build_constant instance->plugin ().build_constant
(sym_type, SYMBOL_NATURAL_NAME (sym.symbol), (sym_type, sym.symbol->natural_name (),
SYMBOL_VALUE (sym.symbol), filename, line); SYMBOL_VALUE (sym.symbol), filename, line);
return; return;
case LOC_CONST_BYTES: case LOC_CONST_BYTES:
error (_("Unsupported LOC_CONST_BYTES for symbol \"%s\"."), error (_("Unsupported LOC_CONST_BYTES for symbol \"%s\"."),
SYMBOL_PRINT_NAME (sym.symbol)); sym.symbol->print_name ());
case LOC_UNDEF: case LOC_UNDEF:
internal_error (__FILE__, __LINE__, _("LOC_UNDEF found for \"%s\"."), internal_error (__FILE__, __LINE__, _("LOC_UNDEF found for \"%s\"."),
SYMBOL_PRINT_NAME (sym.symbol)); sym.symbol->print_name ());
case LOC_COMMON_BLOCK: case LOC_COMMON_BLOCK:
error (_("Fortran common block is unsupported for compilation " error (_("Fortran common block is unsupported for compilation "
"evaluaton of symbol \"%s\"."), "evaluaton of symbol \"%s\"."),
SYMBOL_PRINT_NAME (sym.symbol)); sym.symbol->print_name ());
case LOC_OPTIMIZED_OUT: case LOC_OPTIMIZED_OUT:
error (_("Symbol \"%s\" cannot be used for compilation evaluation " error (_("Symbol \"%s\" cannot be used for compilation evaluation "
"as it is optimized out."), "as it is optimized out."),
SYMBOL_PRINT_NAME (sym.symbol)); sym.symbol->print_name ());
case LOC_COMPUTED: case LOC_COMPUTED:
if (is_local) if (is_local)
@ -129,7 +129,7 @@ convert_one_symbol (compile_cplus_instance *instance,
warning (_("Symbol \"%s\" is thread-local and currently can only " warning (_("Symbol \"%s\" is thread-local and currently can only "
"be referenced from the current thread in " "be referenced from the current thread in "
"compiled code."), "compiled code."),
SYMBOL_PRINT_NAME (sym.symbol)); sym.symbol->print_name ());
/* FALLTHROUGH */ /* FALLTHROUGH */
case LOC_UNRESOLVED: case LOC_UNRESOLVED:
/* 'symbol_name' cannot be used here as that one is used only for /* 'symbol_name' cannot be used here as that one is used only for
@ -146,14 +146,14 @@ convert_one_symbol (compile_cplus_instance *instance,
if (frame == nullptr) if (frame == nullptr)
error (_("Symbol \"%s\" cannot be used because " error (_("Symbol \"%s\" cannot be used because "
"there is no selected frame"), "there is no selected frame"),
SYMBOL_PRINT_NAME (sym.symbol)); sym.symbol->print_name ());
} }
val = read_var_value (sym.symbol, sym.block, frame); val = read_var_value (sym.symbol, sym.block, frame);
if (VALUE_LVAL (val) != lval_memory) if (VALUE_LVAL (val) != lval_memory)
error (_("Symbol \"%s\" cannot be used for compilation " error (_("Symbol \"%s\" cannot be used for compilation "
"evaluation as its address has not been found."), "evaluation as its address has not been found."),
SYMBOL_PRINT_NAME (sym.symbol)); sym.symbol->print_name ());
kind = GCC_CP_SYMBOL_VARIABLE; kind = GCC_CP_SYMBOL_VARIABLE;
addr = value_address (val); addr = value_address (val);
@ -189,7 +189,7 @@ convert_one_symbol (compile_cplus_instance *instance,
if (!is_local) if (!is_local)
{ {
compile_scope scope compile_scope scope
= instance->new_scope (SYMBOL_NATURAL_NAME (sym.symbol), = instance->new_scope (sym.symbol->natural_name (),
SYMBOL_TYPE (sym.symbol)); SYMBOL_TYPE (sym.symbol));
if (scope.nested_type () != GCC_TYPE_NONE) if (scope.nested_type () != GCC_TYPE_NONE)
{ {
@ -202,9 +202,9 @@ convert_one_symbol (compile_cplus_instance *instance,
} }
/* Get the `raw' name of the symbol. */ /* 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 name = compile_cplus_instance::decl_name
(SYMBOL_NATURAL_NAME (sym.symbol)).get (); (sym.symbol->natural_name ()).get ();
/* Define the decl. */ /* Define the decl. */
instance->plugin ().build_decl instance->plugin ().build_decl

View file

@ -112,7 +112,7 @@ debug_print_scope (const compile_scope &scope)
for (const auto &comp: scope) for (const auto &comp: scope)
{ {
const char *symbol = (comp.bsymbol.symbol != nullptr const char *symbol = (comp.bsymbol.symbol != nullptr
? SYMBOL_NATURAL_NAME (comp.bsymbol.symbol) ? comp.bsymbol.symbol->natural_name ()
: "<none>"); : "<none>");
printf_unfiltered ("\tname = %s, symbol = %s\n", comp.name.c_str (), printf_unfiltered ("\tname = %s, symbol = %s\n", comp.name.c_str (),

View file

@ -622,18 +622,18 @@ do_compile_dwarf_expr_to_c (int indent, string_file *stream,
if (frame == NULL) if (frame == NULL)
error (_("Symbol \"%s\" cannot be used because " error (_("Symbol \"%s\" cannot be used because "
"there is no selected frame"), "there is no selected frame"),
SYMBOL_PRINT_NAME (sym)); sym->print_name ());
val = read_var_value (sym, NULL, frame); val = read_var_value (sym, NULL, frame);
if (VALUE_LVAL (val) != lval_memory) if (VALUE_LVAL (val) != lval_memory)
error (_("Symbol \"%s\" cannot be used for compilation evaluation " error (_("Symbol \"%s\" cannot be used for compilation evaluation "
"as its address has not been found."), "as its address has not been found."),
SYMBOL_PRINT_NAME (sym)); sym->print_name ());
warning (_("Symbol \"%s\" is thread-local and currently can only " warning (_("Symbol \"%s\" is thread-local and currently can only "
"be referenced from the current thread in " "be referenced from the current thread in "
"compiled code."), "compiled code."),
SYMBOL_PRINT_NAME (sym)); sym->print_name ());
fprintfi_filtered (indent, stream, "%s = %s;\n", fprintfi_filtered (indent, stream, "%s = %s;\n",
result_name, result_name,

View file

@ -433,7 +433,7 @@ get_out_value_type (struct symbol *func_sym, struct objfile *objfile,
if (function != NULL if (function != NULL
&& (BLOCK_SUPERBLOCK (function_block) && (BLOCK_SUPERBLOCK (function_block)
== BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK)) == BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK))
&& (strcmp_iw (SYMBOL_LINKAGE_NAME (function), && (strcmp_iw (function->linkage_name (),
GCC_FE_WRAPPER_FUNCTION) GCC_FE_WRAPPER_FUNCTION)
== 0)) == 0))
break; break;

View file

@ -54,9 +54,9 @@ cp_scan_for_anonymous_namespaces (struct buildsym_compunit *compunit,
const struct symbol *const symbol, const struct symbol *const symbol,
struct objfile *const objfile) 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 previous_component;
unsigned int next_component; unsigned int next_component;
@ -488,7 +488,7 @@ search_symbol_list (const char *name, int num,
/* Maybe we should store a dictionary in here instead. */ /* Maybe we should store a dictionary in here instead. */
for (i = 0; i < num; ++i) 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 syms[i];
} }
return NULL; return NULL;
@ -542,10 +542,10 @@ cp_lookup_symbol_imports_or_template (const char *scope,
/* Search the template parameters of the function's defining /* Search the template parameters of the function's defining
context. */ context. */
if (SYMBOL_NATURAL_NAME (function)) if (function->natural_name ())
{ {
struct type *context; 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); const struct language_defn *lang = language_def (language_cplus);
struct gdbarch *arch = symbol_arch (function); struct gdbarch *arch = symbol_arch (function);
const struct block *parent = BLOCK_SUPERBLOCK (block); const struct block *parent = BLOCK_SUPERBLOCK (block);

View file

@ -1154,13 +1154,12 @@ overload_list_add_symbol (struct symbol *sym,
/* skip any symbols that we've already considered. */ /* skip any symbols that we've already considered. */
for (symbol *listed_sym : *overload_list) for (symbol *listed_sym : *overload_list)
if (strcmp (SYMBOL_LINKAGE_NAME (sym), if (strcmp (sym->linkage_name (), listed_sym->linkage_name ()) == 0)
SYMBOL_LINKAGE_NAME (listed_sym)) == 0)
return; return;
/* Get the demangled name without parameters */ /* Get the demangled name without parameters */
gdb::unique_xmalloc_ptr<char> sym_name gdb::unique_xmalloc_ptr<char> sym_name
= cp_remove_params (SYMBOL_NATURAL_NAME (sym)); = cp_remove_params (sym->natural_name ());
if (!sym_name) if (!sym_name)
return; return;

View file

@ -1230,7 +1230,7 @@ psymtab_to_symtab (struct partial_symtab *pst)
if (sym == NULL) if (sym == NULL)
continue; continue;
set_symbol_address (ccp->of, sym, SYMBOL_LINKAGE_NAME (sym)); set_symbol_address (ccp->of, sym, sym->linkage_name ());
} }
pst->readin = 1; pst->readin = 1;

View file

@ -2341,7 +2341,7 @@ cp_set_block_scope (const struct symbol *symbol,
struct block *block, struct block *block,
struct obstack *obstack) struct obstack *obstack)
{ {
if (SYMBOL_DEMANGLED_NAME (symbol) != NULL) if (symbol->demangled_name () != NULL)
{ {
/* Try to figure out the appropriate namespace from the /* Try to figure out the appropriate namespace from the
demangled name. */ demangled name. */
@ -2351,7 +2351,7 @@ cp_set_block_scope (const struct symbol *symbol,
name of the class as well. This should be harmless, but name of the class as well. This should be harmless, but
is a little unfortunate. */ 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); unsigned int prefix_len = cp_entire_prefix_len (name);
block_set_scope (block, obstack_strndup (obstack, name, prefix_len), block_set_scope (block, obstack_strndup (obstack, name, prefix_len),

View file

@ -608,7 +608,7 @@ iter_match_first_hashed (const struct dictionary *dict,
sym = sym->hash_next) sym = sym->hash_next)
{ {
/* Warning: the order of arguments to compare matters! */ /* 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; break;
} }
@ -629,7 +629,7 @@ iter_match_next_hashed (const lookup_name_info &name,
next != NULL; next != NULL;
next = next->hash_next) next = next->hash_next)
{ {
if (matches_name (SYMBOL_SEARCH_NAME (next), name, NULL)) if (matches_name (next->search_name (), name, NULL))
break; break;
} }
@ -652,7 +652,7 @@ insert_symbol_hashed (struct dictionary *dict,
language. The two may not use the same hashing algorithm. */ language. The two may not use the same hashing algorithm. */
gdb_assert (SYMBOL_LANGUAGE (sym) == DICT_LANGUAGE (dict)->la_language); 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); hash_index = hash % DICT_HASHED_NBUCKETS (dict);
sym->hash_next = buckets[hash_index]; sym->hash_next = buckets[hash_index];
buckets[hash_index] = sym; buckets[hash_index] = sym;
@ -847,7 +847,7 @@ iter_match_next_linear (const lookup_name_info &name,
{ {
sym = DICT_LINEAR_SYM (dict, i); 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; retval = sym;
break; break;

View file

@ -142,7 +142,7 @@ extern struct symbol *
extern struct symbol *mdict_iterator_next (struct mdict_iterator *miterator); extern struct symbol *mdict_iterator_next (struct mdict_iterator *miterator);
/* Initialize MITERATOR to point at the first symbol in MDICT whose /* 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 the same conventions as strcmp_iw and be compatible with any
dictionary hashing function), and return that first symbol, or NULL dictionary hashing function), and return that first symbol, or NULL
if there are no such symbols. */ if there are no such symbols. */
@ -153,7 +153,7 @@ extern struct symbol *
struct mdict_iterator *miterator); struct mdict_iterator *miterator);
/* Advance MITERATOR to point at the next symbol in MDICT whose /* 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. dict_iter_match_first), or NULL if there are no more such symbols.
Don't call this if you've previously received NULL from Don't call this if you've previously received NULL from
mdict_iterator_match_first or mdict_iterator_match_next on this mdict_iterator_match_first or mdict_iterator_match_next on this

View file

@ -524,7 +524,7 @@ func_get_frame_base_dwarf_block (struct symbol *framefunc, CORE_ADDR pc,
if (*length == 0) if (*length == 0)
error (_("Could not find the frame base for \"%s\"."), error (_("Could not find the frame base for \"%s\"."),
SYMBOL_NATURAL_NAME (framefunc)); framefunc->natural_name ());
} }
static CORE_ADDR static CORE_ADDR
@ -3635,13 +3635,13 @@ locexpr_describe_location_piece (struct symbol *symbol, struct ui_file *stream,
if (!b) if (!b)
error (_("No block found for address for symbol \"%s\"."), error (_("No block found for address for symbol \"%s\"."),
SYMBOL_PRINT_NAME (symbol)); symbol->print_name ());
framefunc = block_linkage_function (b); framefunc = block_linkage_function (b);
if (!framefunc) if (!framefunc)
error (_("No function found for block for symbol \"%s\"."), 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); func_get_frame_base_dwarf_block (framefunc, addr, &base_data, &base_size);
@ -3655,7 +3655,7 @@ locexpr_describe_location_piece (struct symbol *symbol, struct ui_file *stream,
if (buf_end != base_data + base_size) if (buf_end != base_data + base_size)
error (_("Unexpected opcode after " error (_("Unexpected opcode after "
"DW_OP_breg%u for symbol \"%s\"."), "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) else if (base_data[0] >= DW_OP_reg0 && base_data[0] <= DW_OP_reg31)
{ {
@ -4229,7 +4229,7 @@ locexpr_describe_location_1 (struct symbol *symbol, CORE_ADDR addr,
if (bad || data > end) if (bad || data > end)
error (_("Corrupted DWARF2 expression for \"%s\"."), error (_("Corrupted DWARF2 expression for \"%s\"."),
SYMBOL_PRINT_NAME (symbol)); symbol->print_name ());
} }
/* Print a natural-language description of SYMBOL to STREAM. This /* Print a natural-language description of SYMBOL to STREAM. This
@ -4282,7 +4282,7 @@ locexpr_generate_c_location (struct symbol *sym, string_file *stream,
unsigned int addr_size = dwarf2_per_cu_addr_size (dlbaton->per_cu); unsigned int addr_size = dwarf2_per_cu_addr_size (dlbaton->per_cu);
if (dlbaton->size == 0) 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, compile_dwarf_expr_to_c (stream, result_name,
sym, pc, gdbarch, registers_used, addr_size, sym, pc, gdbarch, registers_used, addr_size,
@ -4428,7 +4428,7 @@ loclist_describe_location (struct symbol *symbol, CORE_ADDR addr,
case DEBUG_LOC_BUFFER_OVERFLOW: case DEBUG_LOC_BUFFER_OVERFLOW:
case DEBUG_LOC_INVALID_ENTRY: case DEBUG_LOC_INVALID_ENTRY:
error (_("Corrupted DWARF expression for symbol \"%s\"."), error (_("Corrupted DWARF expression for symbol \"%s\"."),
SYMBOL_PRINT_NAME (symbol)); symbol->print_name ());
default: default:
gdb_assert_not_reached ("bad debug_loc_kind"); gdb_assert_not_reached ("bad debug_loc_kind");
} }
@ -4495,7 +4495,7 @@ loclist_generate_c_location (struct symbol *sym, string_file *stream,
data = dwarf2_find_location_expression (dlbaton, &size, pc); data = dwarf2_find_location_expression (dlbaton, &size, pc);
if (size == 0) 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, compile_dwarf_expr_to_c (stream, result_name,
sym, pc, gdbarch, registers_used, addr_size, sym, pc, gdbarch, registers_used, addr_size,

View file

@ -6073,10 +6073,10 @@ dw2_debug_names_lookup_symbol (struct objfile *objfile, block_enum block_index,
information (but NAME might contain it). */ information (but NAME might contain it). */
if (sym != NULL if (sym != NULL
&& strcmp_iw (SYMBOL_SEARCH_NAME (sym), name) == 0) && strcmp_iw (sym->search_name (), name) == 0)
return stab; return stab;
if (with_opaque != NULL if (with_opaque != NULL
&& strcmp_iw (SYMBOL_SEARCH_NAME (with_opaque), name) == 0) && strcmp_iw (with_opaque->search_name (), name) == 0)
stab_best = stab; stab_best = stab;
/* Keep looking through other CUs. */ /* Keep looking through other CUs. */
@ -13776,7 +13776,7 @@ read_func_scope (struct die_info *die, struct dwarf2_cu *cu)
(struct symbol *) templ_func); (struct symbol *) templ_func);
if (dwarf2_flag_true_p (die, DW_AT_main_subprogram, cu)) 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); cu->language);
/* If there is a location expression for DW_AT_frame_base, record /* If there is a location expression for DW_AT_frame_base, record
@ -16476,7 +16476,7 @@ process_enumeration_scope (struct die_info *die, struct dwarf2_cu *cu)
* sizeof (struct field)); * 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; FIELD_TYPE (fields[num_fields]) = NULL;
SET_FIELD_ENUMVAL (fields[num_fields], SYMBOL_VALUE (sym)); SET_FIELD_ENUMVAL (fields[num_fields], SYMBOL_VALUE (sym));
FIELD_BITSIZE (fields[num_fields]) = 0; FIELD_BITSIZE (fields[num_fields]) = 0;
@ -21800,7 +21800,7 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu,
apply. */ apply. */
bound_minimal_symbol found bound_minimal_symbol found
= (lookup_minimal_symbol_linkage = (lookup_minimal_symbol_linkage
(SYMBOL_LINKAGE_NAME (sym), objfile)); (sym->linkage_name (), objfile));
if (found.minsym != nullptr) if (found.minsym != nullptr)
sym->maybe_copied = 1; sym->maybe_copied = 1;
} }
@ -21929,7 +21929,7 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu,
with this objfile, so we don't need to with this objfile, so we don't need to
duplicate it for the type. */ duplicate it for the type. */
if (TYPE_NAME (SYMBOL_TYPE (sym)) == 0) if (TYPE_NAME (SYMBOL_TYPE (sym)) == 0)
TYPE_NAME (SYMBOL_TYPE (sym)) = SYMBOL_SEARCH_NAME (sym); TYPE_NAME (SYMBOL_TYPE (sym)) = sym->search_name ();
} }
} }
} }
@ -22162,7 +22162,7 @@ dwarf2_const_value (const struct attribute *attr, struct symbol *sym,
struct dwarf2_locexpr_baton *baton; struct dwarf2_locexpr_baton *baton;
dwarf2_const_value_attr (attr, SYMBOL_TYPE (sym), dwarf2_const_value_attr (attr, SYMBOL_TYPE (sym),
SYMBOL_PRINT_NAME (sym), sym->print_name (),
&objfile->objfile_obstack, cu, &objfile->objfile_obstack, cu,
&value, &bytes, &baton); &value, &bytes, &baton);
@ -25344,7 +25344,7 @@ dwarf2_symbol_mark_computed (const struct attribute *attr, struct symbol *sym,
else else
{ {
dwarf2_invalid_attrib_class_complaint ("location description", dwarf2_invalid_attrib_class_complaint ("location description",
SYMBOL_NATURAL_NAME (sym)); sym->natural_name ());
baton->size = 0; baton->size = 0;
} }

View file

@ -1049,7 +1049,7 @@ evaluate_funcall (type *expect_type, expression *exp, int *pos,
else if (op == OP_VAR_VALUE) else if (op == OP_VAR_VALUE)
{ {
symbol *sym = exp->elts[*pos + 2].symbol; 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); argvec[0] = evaluate_subexp_with_coercion (exp, pos, noside);
@ -1300,7 +1300,7 @@ evaluate_subexp_standard (struct type *expect_type,
(*pos) += 3; (*pos) += 3;
symbol *var = exp->elts[pc + 2].symbol; symbol *var = exp->elts[pc + 2].symbol;
if (TYPE_CODE (SYMBOL_TYPE (var)) == TYPE_CODE_ERROR) 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) if (noside != EVAL_SKIP)
return evaluate_var_value (noside, exp->elts[pc + 1].block, var); return evaluate_var_value (noside, exp->elts[pc + 1].block, var);
else else
@ -1342,7 +1342,7 @@ evaluate_subexp_standard (struct type *expect_type,
if (SYMBOL_COMPUTED_OPS (sym) == NULL if (SYMBOL_COMPUTED_OPS (sym) == NULL
|| SYMBOL_COMPUTED_OPS (sym)->read_variable_at_entry == NULL) || SYMBOL_COMPUTED_OPS (sym)->read_variable_at_entry == NULL)
error (_("Symbol \"%s\" does not have any specific entry value"), error (_("Symbol \"%s\" does not have any specific entry value"),
SYMBOL_PRINT_NAME (sym)); sym->print_name ());
frame = get_selected_frame (NULL); frame = get_selected_frame (NULL);
return SYMBOL_COMPUTED_OPS (sym)->read_variable_at_entry (sym, frame); return SYMBOL_COMPUTED_OPS (sym)->read_variable_at_entry (sym, frame);

View file

@ -126,12 +126,12 @@ print_subexp_standard (struct expression *exp, int *pos,
b = exp->elts[pc + 1].block; b = exp->elts[pc + 1].block;
if (b != NULL if (b != NULL
&& BLOCK_FUNCTION (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 ("::", stream);
} }
fputs_filtered (SYMBOL_PRINT_NAME (exp->elts[pc + 2].symbol), stream); fputs_filtered (exp->elts[pc + 2].symbol->print_name (), stream);
} }
return; return;
@ -154,7 +154,7 @@ print_subexp_standard (struct expression *exp, int *pos,
{ {
(*pos) += 2; (*pos) += 2;
fprintf_filtered (stream, "%s@entry", fprintf_filtered (stream, "%s@entry",
SYMBOL_PRINT_NAME (exp->elts[pc + 1].symbol)); exp->elts[pc + 1].symbol->print_name ());
} }
return; return;
@ -899,7 +899,7 @@ dump_subexp_body_standard (struct expression *exp,
fprintf_filtered (stream, ", symbol @"); fprintf_filtered (stream, ", symbol @");
gdb_print_host_address (exp->elts[elt + 1].symbol, stream); gdb_print_host_address (exp->elts[elt + 1].symbol, stream);
fprintf_filtered (stream, " (%s)", fprintf_filtered (stream, " (%s)",
SYMBOL_PRINT_NAME (exp->elts[elt + 1].symbol)); exp->elts[elt + 1].symbol->print_name ());
elt += 3; elt += 3;
break; break;
case OP_VAR_MSYM_VALUE: case OP_VAR_MSYM_VALUE:
@ -915,7 +915,7 @@ dump_subexp_body_standard (struct expression *exp,
fprintf_filtered (stream, "Entry value of symbol @"); fprintf_filtered (stream, "Entry value of symbol @");
gdb_print_host_address (exp->elts[elt].symbol, stream); gdb_print_host_address (exp->elts[elt].symbol, stream);
fprintf_filtered (stream, " (%s)", fprintf_filtered (stream, " (%s)",
SYMBOL_PRINT_NAME (exp->elts[elt].symbol)); exp->elts[elt].symbol->print_name ());
elt += 2; elt += 2;
break; break;
case OP_LAST: case OP_LAST:

View file

@ -387,17 +387,17 @@ info_common_command_for_block (const struct block *block, const char *comname,
gdb_assert (SYMBOL_CLASS (sym) == LOC_COMMON_BLOCK); gdb_assert (SYMBOL_CLASS (sym) == LOC_COMMON_BLOCK);
if (comname && (!SYMBOL_LINKAGE_NAME (sym) if (comname && (!sym->linkage_name ()
|| strcmp (comname, SYMBOL_LINKAGE_NAME (sym)) != 0)) || strcmp (comname, sym->linkage_name ()) != 0))
continue; continue;
if (*any_printed) if (*any_printed)
putchar_filtered ('\n'); putchar_filtered ('\n');
else else
*any_printed = 1; *any_printed = 1;
if (SYMBOL_PRINT_NAME (sym)) if (sym->print_name ())
printf_filtered (_("Contents of F77 COMMON block '%s':\n"), printf_filtered (_("Contents of F77 COMMON block '%s':\n"),
SYMBOL_PRINT_NAME (sym)); sym->print_name ());
else else
printf_filtered (_("Contents of blank COMMON block:\n")); printf_filtered (_("Contents of blank COMMON block:\n"));
@ -406,7 +406,7 @@ info_common_command_for_block (const struct block *block, const char *comname,
struct value *val = NULL; struct value *val = NULL;
printf_filtered ("%s = ", printf_filtered ("%s = ",
SYMBOL_PRINT_NAME (common->contents[index])); common->contents[index]->print_name ());
try try
{ {

View file

@ -566,9 +566,9 @@ get_hosting_frame (struct symbol *var, const struct block *var_block,
{ {
if (BLOCK_FUNCTION (var_block) if (BLOCK_FUNCTION (var_block)
&& !block_inlined_p (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."), error (_("No frame is currently executing in block %s."),
SYMBOL_PRINT_NAME (BLOCK_FUNCTION (var_block))); BLOCK_FUNCTION (var_block)->print_name ());
else else
error (_("No frame is currently executing in specified" error (_("No frame is currently executing in specified"
" block")); " block"));
@ -601,7 +601,7 @@ default_read_var_value (struct symbol *var, const struct block *var_block,
if (sym_need == SYMBOL_NEEDS_FRAME) if (sym_need == SYMBOL_NEEDS_FRAME)
gdb_assert (frame != NULL); gdb_assert (frame != NULL);
else if (sym_need == SYMBOL_NEEDS_REGISTERS && !target_has_registers) 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) if (frame != NULL)
frame = get_hosting_frame (var, var_block, frame); frame = get_hosting_frame (var, var_block, frame);
@ -668,7 +668,7 @@ default_read_var_value (struct symbol *var, const struct block *var_block,
addr = get_frame_args_address (frame); addr = get_frame_args_address (frame);
if (!addr) if (!addr)
error (_("Unknown argument list address for `%s'."), error (_("Unknown argument list address for `%s'."),
SYMBOL_PRINT_NAME (var)); var->print_name ());
addr += SYMBOL_VALUE (var); addr += SYMBOL_VALUE (var);
break; break;
@ -680,7 +680,7 @@ default_read_var_value (struct symbol *var, const struct block *var_block,
argref = get_frame_args_address (frame); argref = get_frame_args_address (frame);
if (!argref) if (!argref)
error (_("Unknown argument list address for `%s'."), error (_("Unknown argument list address for `%s'."),
SYMBOL_PRINT_NAME (var)); var->print_name ());
argref += SYMBOL_VALUE (var); argref += SYMBOL_VALUE (var);
ref = value_at (lookup_pointer_type (type), argref); ref = value_at (lookup_pointer_type (type), argref);
addr = value_as_address (ref); addr = value_as_address (ref);
@ -694,7 +694,7 @@ default_read_var_value (struct symbol *var, const struct block *var_block,
case LOC_TYPEDEF: case LOC_TYPEDEF:
error (_("Cannot look up value of a typedef `%s'."), error (_("Cannot look up value of a typedef `%s'."),
SYMBOL_PRINT_NAME (var)); var->print_name ());
break; break;
case LOC_BLOCK: case LOC_BLOCK:
@ -721,7 +721,7 @@ default_read_var_value (struct symbol *var, const struct block *var_block,
if (regval == NULL) if (regval == NULL)
error (_("Value of register variable not available for `%s'."), error (_("Value of register variable not available for `%s'."),
SYMBOL_PRINT_NAME (var)); var->print_name ());
addr = value_as_address (regval); addr = value_as_address (regval);
} }
@ -731,7 +731,7 @@ default_read_var_value (struct symbol *var, const struct block *var_block,
if (regval == NULL) if (regval == NULL)
error (_("Value of register variable not available for `%s'."), error (_("Value of register variable not available for `%s'."),
SYMBOL_PRINT_NAME (var)); var->print_name ());
return regval; return regval;
} }
} }
@ -747,7 +747,7 @@ default_read_var_value (struct symbol *var, const struct block *var_block,
struct obj_section *obj_section; struct obj_section *obj_section;
memset (&lookup_data, 0, sizeof (lookup_data)); 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 gdbarch_iterate_over_objfiles_in_search_order
(symbol_arch (var), (symbol_arch (var),
@ -767,7 +767,7 @@ default_read_var_value (struct symbol *var, const struct block *var_block,
can't be NULL. */ can't be NULL. */
gdb_assert (flavour_name != NULL); gdb_assert (flavour_name != NULL);
error (_("Missing %s symbol \"%s\"."), 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); obj_section = MSYMBOL_OBJ_SECTION (lookup_data.result.objfile, msym);
/* Relocate address, unless there is no section or the variable is /* Relocate address, unless there is no section or the variable is
@ -793,7 +793,7 @@ default_read_var_value (struct symbol *var, const struct block *var_block,
default: default:
error (_("Cannot look up value of a botched symbol `%s'."), error (_("Cannot look up value of a botched symbol `%s'."),
SYMBOL_PRINT_NAME (var)); var->print_name ());
break; break;
} }

View file

@ -411,7 +411,7 @@ go_sniff_from_mangled_name (const char *mangled, char **demangled)
char * char *
go_symbol_package_name (const struct symbol *sym) 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 *package_name;
const char *object_name; const char *object_name;
const char *method_type_package_name; const char *method_type_package_name;

View file

@ -157,7 +157,7 @@ bkscm_print_block_smob (SCM self, SCM port, scm_print_state *pstate)
gdbscm_printf (port, " static"); gdbscm_printf (port, " static");
if (BLOCK_FUNCTION (b) != NULL) 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", gdbscm_printf (port, " %s-%s",
hex_string (BLOCK_START (b)), hex_string (BLOCK_END (b))); hex_string (BLOCK_START (b)), hex_string (BLOCK_END (b)));

View file

@ -157,7 +157,7 @@ syscm_print_symbol_smob (SCM self, SCM port, scm_print_state *pstate)
gdbscm_printf (port, "#<%s ", symbol_smob_name); gdbscm_printf (port, "#<%s ", symbol_smob_name);
gdbscm_printf (port, "%s", gdbscm_printf (port, "%s",
s_smob->symbol != NULL s_smob->symbol != NULL
? SYMBOL_PRINT_NAME (s_smob->symbol) ? s_smob->symbol->print_name ()
: "<invalid>"); : "<invalid>");
if (pstate->writingp) if (pstate->writingp)
scm_puts (">", port); scm_puts (">", port);
@ -376,7 +376,7 @@ gdbscm_symbol_name (SCM self)
= syscm_get_valid_symbol_smob_arg_unsafe (self, SCM_ARG1, FUNC_NAME); = syscm_get_valid_symbol_smob_arg_unsafe (self, SCM_ARG1, FUNC_NAME);
const struct symbol *symbol = s_smob->symbol; 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 */ /* (symbol-linkage-name <gdb:symbol>) -> string */
@ -388,7 +388,7 @@ gdbscm_symbol_linkage_name (SCM self)
= syscm_get_valid_symbol_smob_arg_unsafe (self, SCM_ARG1, FUNC_NAME); = syscm_get_valid_symbol_smob_arg_unsafe (self, SCM_ARG1, FUNC_NAME);
const struct symbol *symbol = s_smob->symbol; 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 */ /* (symbol-print-name <gdb:symbol>) -> string */
@ -400,7 +400,7 @@ gdbscm_symbol_print_name (SCM self)
= syscm_get_valid_symbol_smob_arg_unsafe (self, SCM_ARG1, FUNC_NAME); = syscm_get_valid_symbol_smob_arg_unsafe (self, SCM_ARG1, FUNC_NAME);
const struct symbol *symbol = s_smob->symbol; 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 */ /* (symbol-addr-class <gdb:symbol>) -> integer */

View file

@ -387,7 +387,7 @@ get_function_name (CORE_ADDR funaddr, char *buf, int buf_size)
struct symbol *symbol = find_pc_function (funaddr); struct symbol *symbol = find_pc_function (funaddr);
if (symbol) if (symbol)
return SYMBOL_PRINT_NAME (symbol); return symbol->print_name ();
} }
{ {

View file

@ -1210,7 +1210,7 @@ jump_command (const char *arg, int from_tty)
if (fn != NULL && sfn != fn) if (fn != NULL && sfn != fn)
{ {
if (!query (_("Line %d is not in `%s'. Jump anyway? "), sal.line, if (!query (_("Line %d is not in `%s'. Jump anyway? "), sal.line,
SYMBOL_PRINT_NAME (fn))) fn->print_name ()))
{ {
error (_("Not confirmed.")); error (_("Not confirmed."));
/* NOTREACHED */ /* NOTREACHED */
@ -1939,7 +1939,7 @@ finish_command (const char *arg, int from_tty)
if (sm->function != NULL && TYPE_NO_RETURN (sm->function->type) if (sm->function != NULL && TYPE_NO_RETURN (sm->function->type)
&& !query (_("warning: Function %s does not return normally.\n" && !query (_("warning: Function %s does not return normally.\n"
"Try to finish anyway? "), "Try to finish anyway? "),
SYMBOL_PRINT_NAME (sm->function))) sm->function->print_name ()))
error (_("Not confirmed.")); error (_("Not confirmed."));
printf_filtered (_("Run till exit from ")); printf_filtered (_("Run till exit from "));
} }

View file

@ -7281,7 +7281,7 @@ insert_exception_resume_breakpoint (struct thread_info *tp,
CORE_ADDR handler; CORE_ADDR handler;
struct breakpoint *bp; struct breakpoint *bp;
vsym = lookup_symbol_search_name (SYMBOL_SEARCH_NAME (sym), vsym = lookup_symbol_search_name (sym->search_name (),
b, VAR_DOMAIN); b, VAR_DOMAIN);
value = read_var_value (vsym.symbol, vsym.block, frame); value = read_var_value (vsym.symbol, vsym.block, frame);
/* If the value was optimized out, revert to the old behavior. */ /* If the value was optimized out, revert to the old behavior. */

View file

@ -2066,8 +2066,7 @@ canonicalize_linespec (struct linespec_state *state, const linespec_p ls)
gdb_assert (!ls->labels.function_symbols->empty () gdb_assert (!ls->labels.function_symbols->empty ()
&& (ls->labels.function_symbols->size () == 1)); && (ls->labels.function_symbols->size () == 1));
block_symbol s = ls->labels.function_symbols->front (); block_symbol s = ls->labels.function_symbols->front ();
explicit_loc->function_name explicit_loc->function_name = xstrdup (s.symbol->natural_name ());
= xstrdup (SYMBOL_NATURAL_NAME (s.symbol));
} }
} }
@ -2195,7 +2194,7 @@ create_sals_line_offset (struct linespec_state *self,
skip_prologue_sal (&intermediate_results[i]); skip_prologue_sal (&intermediate_results[i]);
intermediate_results[i].symbol = sym; intermediate_results[i].symbol = sym;
add_sal_to_sals (self, &values, &intermediate_results[i], 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 @@ convert_linespec_to_sals (struct linespec_state *state, linespec_p ls)
if (symbol_to_sal (&sal, state->funfirstline, sym.symbol) if (symbol_to_sal (&sal, state->funfirstline, sym.symbol)
&& maybe_add_address (state->addr_set, pspace, sal.pc)) && maybe_add_address (state->addr_set, pspace, sal.pc))
add_sal_to_sals (state, &sals, &sal, 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) else if (ls->function_symbols != NULL || ls->minimal_symbols != NULL)
@ -2315,7 +2314,7 @@ convert_linespec_to_sals (struct linespec_state *state, linespec_p ls)
if (symbol_to_sal (&sal, state->funfirstline, sym.symbol) if (symbol_to_sal (&sal, state->funfirstline, sym.symbol)
&& maybe_add_address (state->addr_set, pspace, sal.pc)) && maybe_add_address (state->addr_set, pspace, sal.pc))
add_sal_to_sals (state, &sals, &sal, add_sal_to_sals (state, &sals, &sal,
SYMBOL_NATURAL_NAME (sym.symbol), 0); sym.symbol->natural_name (), 0);
} }
} }
} }
@ -2903,7 +2902,7 @@ complete_label (completion_tracker &tracker,
{ {
for (const auto &label : *labels) 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)); tracker.add_completion (gdb::unique_xmalloc_ptr<char> (match));
} }
delete labels; delete labels;
@ -4001,7 +4000,7 @@ find_label_symbols_in_block (const struct block *block,
{ {
if (symbol_matches_domain (SYMBOL_LANGUAGE (sym), if (symbol_matches_domain (SYMBOL_LANGUAGE (sym),
SYMBOL_DOMAIN (sym), LABEL_DOMAIN) 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}); result->push_back ({sym, block});
label_funcs_ret->push_back ({fn_sym, block}); label_funcs_ret->push_back ({fn_sym, block});

View file

@ -165,8 +165,8 @@ m2_print_typedef (struct type *type, struct symbol *new_symbol,
fprintf_filtered (stream, "TYPE "); fprintf_filtered (stream, "TYPE ");
if (!TYPE_NAME (SYMBOL_TYPE (new_symbol)) if (!TYPE_NAME (SYMBOL_TYPE (new_symbol))
|| strcmp (TYPE_NAME ((SYMBOL_TYPE (new_symbol))), || strcmp (TYPE_NAME ((SYMBOL_TYPE (new_symbol))),
SYMBOL_LINKAGE_NAME (new_symbol)) != 0) new_symbol->linkage_name ()) != 0)
fprintf_filtered (stream, "%s = ", SYMBOL_PRINT_NAME (new_symbol)); fprintf_filtered (stream, "%s = ", new_symbol->print_name ());
else else
fprintf_filtered (stream, "<builtin> = "); fprintf_filtered (stream, "<builtin> = ");
type_print (type, "", stream, 0); type_print (type, "", stream, 0);

View file

@ -541,7 +541,7 @@ mdebug_reg_to_regnum (struct symbol *sym, struct gdbarch *gdbarch)
if (regno < 0 || regno >= gdbarch_num_cooked_regs (gdbarch)) if (regno < 0 || regno >= gdbarch_num_cooked_regs (gdbarch))
{ {
reg_value_complaint (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. */ regno = gdbarch_sp_regnum (gdbarch); /* Known safe, though useless. */
} }
@ -646,7 +646,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend,
/* It is a FORTRAN common block. At least for SGI Fortran the /* 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 address is not in the symbol; we need to fix it later in
scan_file_globals. */ scan_file_globals. */
int bucket = hashname (SYMBOL_LINKAGE_NAME (s)); int bucket = hashname (s->linkage_name ());
SYMBOL_VALUE_CHAIN (s) = global_sym_chain[bucket]; SYMBOL_VALUE_CHAIN (s) = global_sym_chain[bucket];
global_sym_chain[bucket] = s; global_sym_chain[bucket] = s;
} }
@ -1334,7 +1334,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend,
for anything except pointers or functions. */ for anything except pointers or functions. */
} }
else else
TYPE_NAME (SYMBOL_TYPE (s)) = SYMBOL_LINKAGE_NAME (s); TYPE_NAME (SYMBOL_TYPE (s)) = s->linkage_name ();
} }
break; break;
@ -4489,10 +4489,10 @@ mylookup_symbol (const char *name, const struct block *block,
inc = name[0]; inc = name[0];
ALL_BLOCK_SYMBOLS (block, iter, sym) ALL_BLOCK_SYMBOLS (block, iter, sym)
{ {
if (SYMBOL_LINKAGE_NAME (sym)[0] == inc if (sym->linkage_name ()[0] == inc
&& SYMBOL_DOMAIN (sym) == domain && SYMBOL_DOMAIN (sym) == domain
&& SYMBOL_CLASS (sym) == theclass && SYMBOL_CLASS (sym) == theclass
&& strcmp (SYMBOL_LINKAGE_NAME (sym), name) == 0) && strcmp (sym->linkage_name (), name) == 0)
return sym; return sym;
} }

View file

@ -515,7 +515,7 @@ list_arg_or_local (const struct frame_arg *arg, enum what_to_list what,
string_file stb; string_file stb;
stb.puts (SYMBOL_PRINT_NAME (arg->sym)); stb.puts (arg->sym->print_name ());
if (arg->entry_kind == print_entry_values_only) if (arg->entry_kind == print_entry_values_only)
stb.puts ("@entry"); stb.puts ("@entry");
uiout->field_stream ("name", stb); uiout->field_stream ("name", stb);
@ -634,7 +634,7 @@ list_args_or_locals (const frame_print_options &fp_opts,
struct frame_arg arg, entryarg; struct frame_arg arg, entryarg;
if (SYMBOL_IS_ARGUMENT (sym)) if (SYMBOL_IS_ARGUMENT (sym))
sym2 = lookup_symbol (SYMBOL_LINKAGE_NAME (sym), sym2 = lookup_symbol (sym->linkage_name (),
block, VAR_DOMAIN, block, VAR_DOMAIN,
NULL).symbol; NULL).symbol;
else else

View file

@ -537,8 +537,8 @@ compare_selectors (const void *a, const void *b)
{ {
const char *aname, *bname; const char *aname, *bname;
aname = SYMBOL_PRINT_NAME (*(struct symbol **) a); aname = (*(struct symbol **) a)->print_name ();
bname = SYMBOL_PRINT_NAME (*(struct symbol **) b); bname = (*(struct symbol **) b)->print_name ();
if (aname == NULL || bname == NULL) if (aname == NULL || bname == NULL)
error (_("internal: compare_selectors(1)")); error (_("internal: compare_selectors(1)"));
@ -675,7 +675,7 @@ info_selectors_command (const char *regexp, int from_tty)
char *p = asel; char *p = asel;
QUIT; QUIT;
name = SYMBOL_NATURAL_NAME (sym_arr[ix]); name = sym_arr[ix]->natural_name ();
name = strchr (name, ' ') + 1; name = strchr (name, ' ') + 1;
if (p[0] && specialcmp(name, p) == 0) if (p[0] && specialcmp(name, p) == 0)
continue; /* Seen this one already (not unique). */ continue; /* Seen this one already (not unique). */
@ -706,8 +706,8 @@ compare_classes (const void *a, const void *b)
{ {
const char *aname, *bname; const char *aname, *bname;
aname = SYMBOL_PRINT_NAME (*(struct symbol **) a); aname = (*(struct symbol **) a)->print_name ();
bname = SYMBOL_PRINT_NAME (*(struct symbol **) b); bname = (*(struct symbol **) b)->print_name ();
if (aname == NULL || bname == NULL) if (aname == NULL || bname == NULL)
error (_("internal: compare_classes(1)")); error (_("internal: compare_classes(1)"));
@ -809,7 +809,7 @@ info_classes_command (const char *regexp, int from_tty)
char *p = aclass; char *p = aclass;
QUIT; QUIT;
name = SYMBOL_NATURAL_NAME (sym_arr[ix]); name = sym_arr[ix]->natural_name ();
name += 2; name += 2;
if (p[0] && specialcmp(name, p) == 0) if (p[0] && specialcmp(name, p) == 0)
continue; /* Seen this one already (not unique). */ continue; /* Seen this one already (not unique). */
@ -1145,7 +1145,7 @@ find_imps (const char *method, std::vector<const char *> *symbol_names)
0).symbol; 0).symbol;
if (sym != NULL) if (sym != NULL)
symbol_names->push_back (SYMBOL_NATURAL_NAME (sym)); symbol_names->push_back (sym->natural_name ());
else else
{ {
struct bound_minimal_symbol msym struct bound_minimal_symbol msym

View file

@ -99,7 +99,7 @@ pascal_print_typedef (struct type *type, struct symbol *new_symbol,
{ {
type = check_typedef (type); type = check_typedef (type);
fprintf_filtered (stream, "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); type_print (type, "", stream, 0);
fprintf_filtered (stream, ";"); fprintf_filtered (stream, ";");
} }

View file

@ -628,9 +628,9 @@ build_address_symbolic (struct gdbarch *gdbarch,
name_location = BLOCK_ENTRY_PC (SYMBOL_BLOCK_VALUE (symbol)); name_location = BLOCK_ENTRY_PC (SYMBOL_BLOCK_VALUE (symbol));
if (do_demangle || asm_demangle) if (do_demangle || asm_demangle)
name_temp = SYMBOL_PRINT_NAME (symbol); name_temp = symbol->print_name ();
else else
name_temp = SYMBOL_LINKAGE_NAME (symbol); name_temp = symbol->linkage_name ();
} }
if (msymbol.minsym != NULL if (msymbol.minsym != NULL
@ -1472,7 +1472,7 @@ info_address_command (const char *exp, int from_tty)
} }
printf_filtered ("Symbol \""); 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); current_language->la_language, DMGL_ANSI);
printf_filtered ("\" is "); printf_filtered ("\" is ");
val = SYMBOL_VALUE (sym); val = SYMBOL_VALUE (sym);
@ -1592,7 +1592,7 @@ info_address_command (const char *exp, int from_tty)
{ {
struct bound_minimal_symbol msym; 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) if (msym.minsym == NULL)
printf_filtered ("unresolved"); printf_filtered ("unresolved");
else else
@ -2214,7 +2214,7 @@ print_variable_and_value (const char *name, struct symbol *var,
{ {
if (!name) if (!name)
name = SYMBOL_PRINT_NAME (var); name = var->print_name ();
fprintf_filtered (stream, "%s%ps = ", n_spaces (2 * indent), fprintf_filtered (stream, "%s%ps = ", n_spaces (2 * indent),
styled_string (variable_name_style.style (), name)); styled_string (variable_name_style.style (), name));

View file

@ -103,7 +103,7 @@ extract_sym (PyObject *obj, gdb::unique_xmalloc_ptr<char> *name,
/* Duplicate the symbol name, so the caller has consistency /* Duplicate the symbol name, so the caller has consistency
in garbage collection. */ 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 /* If a symbol is specified attempt to determine the language
from the symbol. If mode is not "auto", then the language from the symbol. If mode is not "auto", then the language
@ -348,14 +348,14 @@ py_print_single_arg (struct ui_out *out,
{ {
string_file stb; string_file stb;
fprintf_symbol_filtered (&stb, SYMBOL_PRINT_NAME (fa->sym), fprintf_symbol_filtered (&stb, fa->sym->print_name (),
SYMBOL_LANGUAGE (fa->sym), SYMBOL_LANGUAGE (fa->sym),
DMGL_PARAMS | DMGL_ANSI); DMGL_PARAMS | DMGL_ANSI);
if (fa->entry_kind == print_entry_values_compact) if (fa->entry_kind == print_entry_values_compact)
{ {
stb.puts ("="); stb.puts ("=");
fprintf_symbol_filtered (&stb, SYMBOL_PRINT_NAME (fa->sym), fprintf_symbol_filtered (&stb, fa->sym->print_name (),
SYMBOL_LANGUAGE (fa->sym), SYMBOL_LANGUAGE (fa->sym),
DMGL_PARAMS | DMGL_ANSI); DMGL_PARAMS | DMGL_ANSI);
} }

View file

@ -60,7 +60,7 @@ sympy_str (PyObject *self)
SYMPY_REQUIRE_VALID (self, symbol); SYMPY_REQUIRE_VALID (self, symbol);
result = PyString_FromString (SYMBOL_PRINT_NAME (symbol)); result = PyString_FromString (symbol->print_name ());
return result; return result;
} }
@ -101,7 +101,7 @@ sympy_get_name (PyObject *self, void *closure)
SYMPY_REQUIRE_VALID (self, symbol); SYMPY_REQUIRE_VALID (self, symbol);
return PyString_FromString (SYMBOL_NATURAL_NAME (symbol)); return PyString_FromString (symbol->natural_name ());
} }
static PyObject * static PyObject *
@ -111,7 +111,7 @@ sympy_get_linkage_name (PyObject *self, void *closure)
SYMPY_REQUIRE_VALID (self, symbol); SYMPY_REQUIRE_VALID (self, symbol);
return PyString_FromString (SYMBOL_LINKAGE_NAME (symbol)); return PyString_FromString (symbol->linkage_name ());
} }
static PyObject * static PyObject *

View file

@ -791,7 +791,7 @@ gdbpy_rbreak (PyObject *self, PyObject *args, PyObject *kw)
symbol_name = fullname; symbol_name = fullname;
symbol_name += ":"; symbol_name += ":";
symbol_name += SYMBOL_LINKAGE_NAME (p.symbol); symbol_name += p.symbol->linkage_name ();
} }
else else
symbol_name = p.msymbol.minsym->linkage_name (); symbol_name = p.msymbol.minsym->linkage_name ();

View file

@ -1115,7 +1115,7 @@ btrace_get_bfun_name (const struct btrace_function *bfun)
sym = bfun->sym; sym = bfun->sym;
if (sym != NULL) if (sym != NULL)
return SYMBOL_PRINT_NAME (sym); return sym->print_name ();
else if (msym != NULL) else if (msym != NULL)
return msym->print_name (); return msym->print_name ();
else else
@ -1175,7 +1175,7 @@ btrace_call_history (struct ui_out *uiout,
} }
if (sym != NULL) if (sym != NULL)
uiout->field_string ("function", SYMBOL_PRINT_NAME (sym), uiout->field_string ("function", sym->print_name (),
function_name_style.style ()); function_name_style.style ());
else if (msym != NULL) else if (msym != NULL)
uiout->field_string ("function", msym->print_name (), uiout->field_string ("function", msym->print_name (),

View file

@ -829,7 +829,7 @@ rust_print_typedef (struct type *type,
struct ui_file *stream) struct ui_file *stream)
{ {
type = check_typedef (type); 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); type_print (type, "", stream, 0);
fprintf_filtered (stream, ";"); fprintf_filtered (stream, ";");
} }

View file

@ -959,7 +959,7 @@ frv_fdpic_find_canonical_descriptor (CORE_ADDR entry_point)
if (sym == 0) if (sym == 0)
name = 0; name = 0;
else else
name = SYMBOL_LINKAGE_NAME (sym); name = sym->linkage_name ();
/* Check the main executable. */ /* Check the main executable. */
addr = find_canonical_descriptor_in_load_object addr = find_canonical_descriptor_in_load_object

View file

@ -629,7 +629,7 @@ stab_reg_to_regnum (struct symbol *sym, struct gdbarch *gdbarch)
if (regno < 0 || regno >= gdbarch_num_cooked_regs (gdbarch)) if (regno < 0 || regno >= gdbarch_num_cooked_regs (gdbarch))
{ {
reg_value_complaint (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. */ regno = gdbarch_sp_regnum (gdbarch); /* Known safe, though useless. */
} }
@ -1039,9 +1039,9 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type,
Symbol references don't have valid names and wont't match up with Symbol references don't have valid names and wont't match up with
minimal symbols when the global_sym_chain is relocated. minimal symbols when the global_sym_chain is relocated.
We'll fixup symbol references when we fixup the defining symbol. */ 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]; SYMBOL_VALUE_CHAIN (sym) = global_sym_chain[i];
global_sym_chain[i] = sym; global_sym_chain[i] = sym;
} }
@ -1142,8 +1142,7 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type,
the same name to represent an argument passed in a the same name to represent an argument passed in a
register. GCC uses 'P' for the same case. So if we find register. GCC uses 'P' for the same case. So if we find
such a symbol pair we combine it into one 'P' symbol. such a symbol pair we combine it into one 'P' symbol.
For Sun cc we need to do this regardless of For Sun cc we need to do this regardless of stabs_argument_has_addr, because the compiler puts out
stabs_argument_has_addr, because the compiler puts out
the 'p' symbol even if it never saves the argument onto the 'p' symbol even if it never saves the argument onto
the stack. the stack.
@ -1168,8 +1167,8 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type,
prev_sym = local_symbols->symbol[local_symbols->nsyms - 1]; prev_sym = local_symbols->symbol[local_symbols->nsyms - 1];
if ((SYMBOL_CLASS (prev_sym) == LOC_REF_ARG if ((SYMBOL_CLASS (prev_sym) == LOC_REF_ARG
|| SYMBOL_CLASS (prev_sym) == LOC_ARG) || SYMBOL_CLASS (prev_sym) == LOC_ARG)
&& strcmp (SYMBOL_LINKAGE_NAME (prev_sym), && strcmp (prev_sym->linkage_name (),
SYMBOL_LINKAGE_NAME (sym)) == 0) sym->linkage_name ()) == 0)
{ {
SYMBOL_ACLASS_INDEX (prev_sym) = stab_register_index; SYMBOL_ACLASS_INDEX (prev_sym) = stab_register_index;
/* Use the type from the LOC_REGISTER; that is the type /* Use the type from the LOC_REGISTER; that is the type
@ -1192,18 +1191,16 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type,
SYMBOL_ACLASS_INDEX (sym) = LOC_STATIC; SYMBOL_ACLASS_INDEX (sym) = LOC_STATIC;
SET_SYMBOL_VALUE_ADDRESS (sym, valu); SET_SYMBOL_VALUE_ADDRESS (sym, valu);
if (gdbarch_static_transform_name_p (gdbarch) if (gdbarch_static_transform_name_p (gdbarch)
&& gdbarch_static_transform_name (gdbarch, && gdbarch_static_transform_name (gdbarch, sym->linkage_name ())
SYMBOL_LINKAGE_NAME (sym)) != sym->linkage_name ())
!= SYMBOL_LINKAGE_NAME (sym))
{ {
struct bound_minimal_symbol msym; struct bound_minimal_symbol msym;
msym = lookup_minimal_symbol (SYMBOL_LINKAGE_NAME (sym), msym = lookup_minimal_symbol (sym->linkage_name (), NULL, objfile);
NULL, objfile);
if (msym.minsym != NULL) if (msym.minsym != NULL)
{ {
const char *new_name = gdbarch_static_transform_name const char *new_name = gdbarch_static_transform_name
(gdbarch, SYMBOL_LINKAGE_NAME (sym)); (gdbarch, sym->linkage_name ());
SYMBOL_SET_LINKAGE_NAME (sym, new_name); SYMBOL_SET_LINKAGE_NAME (sym, new_name);
SET_SYMBOL_VALUE_ADDRESS (sym, SET_SYMBOL_VALUE_ADDRESS (sym,
@ -1262,7 +1259,7 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type,
if (TYPE_NAME (SYMBOL_TYPE (sym)) == NULL) if (TYPE_NAME (SYMBOL_TYPE (sym)) == NULL)
{ {
if ((TYPE_CODE (SYMBOL_TYPE (sym)) == TYPE_CODE_PTR 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) || TYPE_CODE (SYMBOL_TYPE (sym)) == TYPE_CODE_FUNC)
{ {
/* If we are giving a name to a type such as "pointer to /* If we are giving a name to a type such as "pointer to
@ -1303,11 +1300,11 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type,
/* Pascal accepts names for pointer types. */ /* Pascal accepts names for pointer types. */
if (get_current_subfile ()->language == language_pascal) 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 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 ()); add_symbol_to_list (sym, get_file_symbols ());
@ -1323,8 +1320,7 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type,
SYMBOL_DOMAIN (struct_sym) = STRUCT_DOMAIN; SYMBOL_DOMAIN (struct_sym) = STRUCT_DOMAIN;
if (TYPE_NAME (SYMBOL_TYPE (sym)) == 0) if (TYPE_NAME (SYMBOL_TYPE (sym)) == 0)
TYPE_NAME (SYMBOL_TYPE (sym)) TYPE_NAME (SYMBOL_TYPE (sym))
= obconcat (&objfile->objfile_obstack, = obconcat (&objfile->objfile_obstack, sym->linkage_name (),
SYMBOL_LINKAGE_NAME (sym),
(char *) NULL); (char *) NULL);
add_symbol_to_list (struct_sym, get_file_symbols ()); add_symbol_to_list (struct_sym, get_file_symbols ());
} }
@ -1351,8 +1347,7 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type,
SYMBOL_DOMAIN (sym) = STRUCT_DOMAIN; SYMBOL_DOMAIN (sym) = STRUCT_DOMAIN;
if (TYPE_NAME (SYMBOL_TYPE (sym)) == 0) if (TYPE_NAME (SYMBOL_TYPE (sym)) == 0)
TYPE_NAME (SYMBOL_TYPE (sym)) TYPE_NAME (SYMBOL_TYPE (sym))
= obconcat (&objfile->objfile_obstack, = obconcat (&objfile->objfile_obstack, sym->linkage_name (),
SYMBOL_LINKAGE_NAME (sym),
(char *) NULL); (char *) NULL);
add_symbol_to_list (sym, get_file_symbols ()); add_symbol_to_list (sym, get_file_symbols ());
@ -1367,8 +1362,7 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type,
SYMBOL_DOMAIN (typedef_sym) = VAR_DOMAIN; SYMBOL_DOMAIN (typedef_sym) = VAR_DOMAIN;
if (TYPE_NAME (SYMBOL_TYPE (sym)) == 0) if (TYPE_NAME (SYMBOL_TYPE (sym)) == 0)
TYPE_NAME (SYMBOL_TYPE (sym)) TYPE_NAME (SYMBOL_TYPE (sym))
= obconcat (&objfile->objfile_obstack, = obconcat (&objfile->objfile_obstack, sym->linkage_name (),
SYMBOL_LINKAGE_NAME (sym),
(char *) NULL); (char *) NULL);
add_symbol_to_list (typedef_sym, get_file_symbols ()); add_symbol_to_list (typedef_sym, get_file_symbols ());
} }
@ -1380,18 +1374,16 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type,
SYMBOL_ACLASS_INDEX (sym) = LOC_STATIC; SYMBOL_ACLASS_INDEX (sym) = LOC_STATIC;
SET_SYMBOL_VALUE_ADDRESS (sym, valu); SET_SYMBOL_VALUE_ADDRESS (sym, valu);
if (gdbarch_static_transform_name_p (gdbarch) if (gdbarch_static_transform_name_p (gdbarch)
&& gdbarch_static_transform_name (gdbarch, && gdbarch_static_transform_name (gdbarch, sym->linkage_name ())
SYMBOL_LINKAGE_NAME (sym)) != sym->linkage_name ())
!= SYMBOL_LINKAGE_NAME (sym))
{ {
struct bound_minimal_symbol msym; struct bound_minimal_symbol msym;
msym = lookup_minimal_symbol (SYMBOL_LINKAGE_NAME (sym), msym = lookup_minimal_symbol (sym->linkage_name (), NULL, objfile);
NULL, objfile);
if (msym.minsym != NULL) if (msym.minsym != NULL)
{ {
const char *new_name = gdbarch_static_transform_name const char *new_name = gdbarch_static_transform_name
(gdbarch, SYMBOL_LINKAGE_NAME (sym)); (gdbarch, sym->linkage_name ());
SYMBOL_SET_LINKAGE_NAME (sym, new_name); SYMBOL_SET_LINKAGE_NAME (sym, new_name);
SET_SYMBOL_VALUE_ADDRESS (sym, BMSYMBOL_VALUE_ADDRESS (msym)); SET_SYMBOL_VALUE_ADDRESS (sym, BMSYMBOL_VALUE_ADDRESS (msym));
@ -1684,7 +1676,7 @@ again:
if (SYMBOL_CLASS (sym) == LOC_TYPEDEF if (SYMBOL_CLASS (sym) == LOC_TYPEDEF
&& SYMBOL_DOMAIN (sym) == STRUCT_DOMAIN && SYMBOL_DOMAIN (sym) == STRUCT_DOMAIN
&& (TYPE_CODE (SYMBOL_TYPE (sym)) == code) && (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); obstack_free (&objfile->objfile_obstack, type_name);
type = SYMBOL_TYPE (sym); type = SYMBOL_TYPE (sym);
@ -3692,7 +3684,7 @@ read_enum_type (const char **pp, struct type *type,
struct symbol *xsym = syms->symbol[j]; struct symbol *xsym = syms->symbol[j];
SYMBOL_TYPE (xsym) = type; 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)); SET_FIELD_ENUMVAL (TYPE_FIELD (type, n), SYMBOL_VALUE (xsym));
TYPE_FIELD_BITSIZE (type, n) = 0; TYPE_FIELD_BITSIZE (type, n) = 0;
} }
@ -4341,7 +4333,7 @@ common_block_end (struct objfile *objfile)
/* Should we be putting local_symbols back to what it was? /* Should we be putting local_symbols back to what it was?
Does it matter? */ Does it matter? */
i = hashname (SYMBOL_LINKAGE_NAME (sym)); i = hashname (sym->linkage_name ());
SYMBOL_VALUE_CHAIN (sym) = global_sym_chain[i]; SYMBOL_VALUE_CHAIN (sym) = global_sym_chain[i];
global_sym_chain[i] = sym; global_sym_chain[i] = sym;
common_block_name = NULL; common_block_name = NULL;
@ -4527,8 +4519,7 @@ cleanup_undefined_types_1 (void)
TYPE_CODE (*type)) TYPE_CODE (*type))
&& (TYPE_INSTANCE_FLAGS (*type) == && (TYPE_INSTANCE_FLAGS (*type) ==
TYPE_INSTANCE_FLAGS (SYMBOL_TYPE (sym))) TYPE_INSTANCE_FLAGS (SYMBOL_TYPE (sym)))
&& strcmp (SYMBOL_LINKAGE_NAME (sym), && strcmp (sym->linkage_name (), type_name) == 0)
type_name) == 0)
replace_type (*type, SYMBOL_TYPE (sym)); replace_type (*type, SYMBOL_TYPE (sym));
} }
} }
@ -4614,8 +4605,7 @@ scan_file_globals (struct objfile *objfile)
for (sym = global_sym_chain[hash]; sym;) for (sym = global_sym_chain[hash]; sym;)
{ {
if (strcmp (msymbol->linkage_name (), if (strcmp (msymbol->linkage_name (), sym->linkage_name ()) == 0)
SYMBOL_LINKAGE_NAME (sym)) == 0)
{ {
/* Splice this symbol out of the hash chain and /* Splice this symbol out of the hash chain and
assign the value we have to it. */ assign the value we have to it. */
@ -4689,7 +4679,7 @@ scan_file_globals (struct objfile *objfile)
else else
complaint (_("%s: common block `%s' from " complaint (_("%s: common block `%s' from "
"global_sym_chain unresolved"), "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)); memset (global_sym_chain, 0, sizeof (global_sym_chain));

View file

@ -427,7 +427,7 @@ print_frame_arg (const frame_print_options &fp_opts,
annotate_arg_emitter arg_emitter; annotate_arg_emitter arg_emitter;
ui_out_emit_tuple tuple_emitter (uiout, NULL); 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); SYMBOL_LANGUAGE (arg->sym), DMGL_PARAMS | DMGL_ANSI);
if (arg->entry_kind == print_entry_values_compact) if (arg->entry_kind == print_entry_values_compact)
{ {
@ -435,7 +435,7 @@ print_frame_arg (const frame_print_options &fp_opts,
PRINT_ENTRY_VALUE_COMPACT we never use MI. */ PRINT_ENTRY_VALUE_COMPACT we never use MI. */
stb.puts ("="); stb.puts ("=");
fprintf_symbol_filtered (&stb, SYMBOL_PRINT_NAME (arg->sym), fprintf_symbol_filtered (&stb, arg->sym->print_name (),
SYMBOL_LANGUAGE (arg->sym), SYMBOL_LANGUAGE (arg->sym),
DMGL_PARAMS | DMGL_ANSI); DMGL_PARAMS | DMGL_ANSI);
} }
@ -817,11 +817,11 @@ print_frame_args (const frame_print_options &fp_opts,
parameter names occur on the RS/6000, for traceback parameter names occur on the RS/6000, for traceback
tables. FIXME, should we even print them? */ tables. FIXME, should we even print them? */
if (*SYMBOL_LINKAGE_NAME (sym)) if (*sym->linkage_name ())
{ {
struct symbol *nsym; struct symbol *nsym;
nsym = lookup_symbol_search_name (SYMBOL_SEARCH_NAME (sym), nsym = lookup_symbol_search_name (sym->search_name (),
b, VAR_DOMAIN).symbol; b, VAR_DOMAIN).symbol;
gdb_assert (nsym != NULL); gdb_assert (nsym != NULL);
if (SYMBOL_CLASS (nsym) == LOC_REGISTER if (SYMBOL_CLASS (nsym) == LOC_REGISTER
@ -1259,14 +1259,14 @@ find_frame_funname (struct frame_info *frame, enum language *funlang,
func = get_frame_function (frame); func = get_frame_function (frame);
if (func) if (func)
{ {
const char *print_name = SYMBOL_PRINT_NAME (func); const char *print_name = func->print_name ();
*funlang = SYMBOL_LANGUAGE (func); *funlang = SYMBOL_LANGUAGE (func);
if (funcp) if (funcp)
*funcp = func; *funcp = func;
if (*funlang == language_cplus) 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 to display the demangled name that we already have
stored in the symbol table, but we stored a version stored in the symbol table, but we stored a version
with DMGL_PARAMS turned on, and here we don't want to with DMGL_PARAMS turned on, and here we don't want to
@ -1494,11 +1494,11 @@ info_frame_command_core (struct frame_info *fi, bool selected_frame_p)
gdb::unique_xmalloc_ptr<char> func_only; gdb::unique_xmalloc_ptr<char> func_only;
if (func) if (func)
{ {
funname = SYMBOL_PRINT_NAME (func); funname = func->print_name ();
funlang = SYMBOL_LANGUAGE (func); funlang = SYMBOL_LANGUAGE (func);
if (funlang == language_cplus) 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 to display the demangled name that we already have
stored in the symbol table, but we stored a version stored in the symbol table, but we stored a version
with DMGL_PARAMS turned on, and here we don't want to with DMGL_PARAMS turned on, and here we don't want to
@ -2246,7 +2246,7 @@ iterate_over_block_locals (const struct block *b,
break; break;
if (SYMBOL_DOMAIN (sym) == COMMON_BLOCK_DOMAIN) if (SYMBOL_DOMAIN (sym) == COMMON_BLOCK_DOMAIN)
break; break;
(*cb) (SYMBOL_PRINT_NAME (sym), sym, cb_data); (*cb) (sym->print_name (), sym, cb_data);
break; break;
default: default:
@ -2276,7 +2276,7 @@ print_block_frame_labels (struct gdbarch *gdbarch, struct block *b,
ALL_BLOCK_SYMBOLS (b, iter, sym) ALL_BLOCK_SYMBOLS (b, iter, sym)
{ {
if (strcmp (SYMBOL_LINKAGE_NAME (sym), "default") == 0) if (strcmp (sym->linkage_name (), "default") == 0)
{ {
if (*have_default) if (*have_default)
continue; continue;
@ -2289,7 +2289,7 @@ print_block_frame_labels (struct gdbarch *gdbarch, struct block *b,
sal = find_pc_line (SYMBOL_VALUE_ADDRESS (sym), 0); sal = find_pc_line (SYMBOL_VALUE_ADDRESS (sym), 0);
values_printed = 1; values_printed = 1;
fputs_filtered (SYMBOL_PRINT_NAME (sym), stream); fputs_filtered (sym->print_name (), stream);
get_user_print_options (&opts); get_user_print_options (&opts);
if (opts.addressprint) if (opts.addressprint)
{ {
@ -2351,8 +2351,7 @@ do_print_variable_and_value (const char *print_name,
struct frame_info *frame; struct frame_info *frame;
if (p->preg.has_value () if (p->preg.has_value ()
&& p->preg->exec (SYMBOL_NATURAL_NAME (sym), 0, && p->preg->exec (sym->natural_name (), 0, NULL, 0) != 0)
NULL, 0) != 0)
return; return;
if (p->treg.has_value () if (p->treg.has_value ()
&& !treg_matches_sym_type_name (*p->treg, sym)) && !treg_matches_sym_type_name (*p->treg, sym))
@ -2554,9 +2553,9 @@ iterate_over_block_arg_vars (const struct block *b,
float). There are also LOC_ARG/LOC_REGISTER pairs which float). There are also LOC_ARG/LOC_REGISTER pairs which
are not combined in symbol-reading. */ 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; b, VAR_DOMAIN).symbol;
(*cb) (SYMBOL_PRINT_NAME (sym), sym2, cb_data); (*cb) (sym->print_name (), sym2, cb_data);
} }
} }
} }
@ -2856,7 +2855,7 @@ return_command (const char *retval_exp, int from_tty)
if (TYPE_NO_RETURN (thisfun->type)) if (TYPE_NO_RETURN (thisfun->type))
warning (_("Function does not return normally to caller.")); warning (_("Function does not return normally to caller."));
confirmed = query (_("%sMake %s return now? "), query_prefix, confirmed = query (_("%sMake %s return now? "), query_prefix,
SYMBOL_PRINT_NAME (thisfun)); thisfun->print_name ());
} }
if (!confirmed) if (!confirmed)
error (_("Not confirmed")); error (_("Not confirmed"));

View file

@ -339,11 +339,11 @@ dump_symtab_1 (struct symtab *symtab, struct ui_file *outfile)
if (BLOCK_FUNCTION (b)) if (BLOCK_FUNCTION (b))
{ {
fprintf_filtered (outfile, ", function %s", fprintf_filtered (outfile, ", function %s",
SYMBOL_LINKAGE_NAME (BLOCK_FUNCTION (b))); BLOCK_FUNCTION (b)->linkage_name ());
if (SYMBOL_DEMANGLED_NAME (BLOCK_FUNCTION (b)) != NULL) if (BLOCK_FUNCTION (b)->demangled_name () != NULL)
{ {
fprintf_filtered (outfile, ", %s", fprintf_filtered (outfile, ", %s",
SYMBOL_DEMANGLED_NAME (BLOCK_FUNCTION (b))); BLOCK_FUNCTION (b)->demangled_name ());
} }
} }
fprintf_filtered (outfile, "\n"); fprintf_filtered (outfile, "\n");
@ -523,7 +523,7 @@ print_symbol (struct gdbarch *gdbarch, struct symbol *symbol,
print_spaces (depth, outfile); print_spaces (depth, outfile);
if (SYMBOL_DOMAIN (symbol) == LABEL_DOMAIN) 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)), fputs_filtered (paddress (gdbarch, SYMBOL_VALUE_ADDRESS (symbol)),
outfile); outfile);
if (section) if (section)
@ -548,7 +548,7 @@ print_symbol (struct gdbarch *gdbarch, struct symbol *symbol,
? "enum" ? "enum"
: (TYPE_CODE (SYMBOL_TYPE (symbol)) == TYPE_CODE_STRUCT : (TYPE_CODE (SYMBOL_TYPE (symbol)) == TYPE_CODE_STRUCT
? "struct" : "union")), ? "struct" : "union")),
SYMBOL_LINKAGE_NAME (symbol)); symbol->linkage_name ());
LA_PRINT_TYPE (SYMBOL_TYPE (symbol), "", outfile, 1, depth, LA_PRINT_TYPE (SYMBOL_TYPE (symbol), "", outfile, 1, depth,
&type_print_raw_options); &type_print_raw_options);
} }
@ -561,7 +561,7 @@ print_symbol (struct gdbarch *gdbarch, struct symbol *symbol,
if (SYMBOL_TYPE (symbol)) if (SYMBOL_TYPE (symbol))
{ {
/* Print details of types, except for enums where it's clutter. */ /* 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, outfile,
TYPE_CODE (SYMBOL_TYPE (symbol)) != TYPE_CODE_ENUM, TYPE_CODE (SYMBOL_TYPE (symbol)) != TYPE_CODE_ENUM,
depth, depth,
@ -569,7 +569,7 @@ print_symbol (struct gdbarch *gdbarch, struct symbol *symbol,
fprintf_filtered (outfile, "; "); fprintf_filtered (outfile, "; ");
} }
else else
fprintf_filtered (outfile, "%s ", SYMBOL_PRINT_NAME (symbol)); fprintf_filtered (outfile, "%s ", symbol->print_name ());
switch (SYMBOL_CLASS (symbol)) switch (SYMBOL_CLASS (symbol))
{ {

View file

@ -1151,7 +1151,7 @@ eq_symbol_entry (const struct symbol_cache_slot *slot,
} }
else 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); slot_domain = SYMBOL_DOMAIN (slot->value.found.symbol);
} }
@ -1168,7 +1168,7 @@ eq_symbol_entry (const struct symbol_cache_slot *slot,
/* It's important that we use the same comparison that was done /* It's important that we use the same comparison that was done
the first time through. If the slot records a found symbol, the first time through. If the slot records a found symbol,
then this means using the symbol name comparison function of 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 dictionary.c. It also means using symbol_matches_domain for
found symbols. See block.c. found symbols. See block.c.
@ -1517,7 +1517,7 @@ symbol_cache_dump (const struct symbol_cache *cache)
printf_filtered (" [%4u] = %s, %s %s\n", i, printf_filtered (" [%4u] = %s, %s %s\n", i,
host_address_to_string (context), host_address_to_string (context),
SYMBOL_PRINT_NAME (found), found->print_name (),
domain_name (SYMBOL_DOMAIN (found))); domain_name (SYMBOL_DOMAIN (found)));
break; break;
} }
@ -1950,7 +1950,7 @@ lookup_language_this (const struct language_defn *lang,
if (symbol_lookup_debug > 1) if (symbol_lookup_debug > 1)
{ {
fprintf_unfiltered (gdb_stdlog, " = %s (%s, block %s)\n", 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 (sym),
host_address_to_string (block)); host_address_to_string (block));
} }
@ -3136,7 +3136,7 @@ find_pc_sect_line (CORE_ADDR pc, struct obj_section *section, int notcurrent)
* but the "break" still works, and the warning is annoying. * but the "break" still works, and the warning is annoying.
* So I commented out the warning. RT */ * So I commented out the warning. RT */
/* warning ("In stub for %s; unable to find real function/line info", /* warning ("In stub for %s; unable to find real function/line info",
SYMBOL_LINKAGE_NAME (msymbol)); */ msymbol->linkage_name ()); */
; ;
/* fall through */ /* fall through */
else if (BMSYMBOL_VALUE_ADDRESS (mfunsym) else if (BMSYMBOL_VALUE_ADDRESS (mfunsym)
@ -3144,7 +3144,7 @@ find_pc_sect_line (CORE_ADDR pc, struct obj_section *section, int notcurrent)
/* Avoid infinite recursion */ /* Avoid infinite recursion */
/* See above comment about why warning is commented out. */ /* See above comment about why warning is commented out. */
/* warning ("In stub for %s; unable to find real function/line info", /* warning ("In stub for %s; unable to find real function/line info",
SYMBOL_LINKAGE_NAME (msymbol)); */ msymbol->linkage_name ()); */
; ;
/* fall through */ /* fall through */
else else
@ -3715,7 +3715,7 @@ skip_prologue_sal (struct symtab_and_line *sal)
objfile = symbol_objfile (sym); objfile = symbol_objfile (sym);
pc = BLOCK_ENTRY_PC (SYMBOL_BLOCK_VALUE (sym)); pc = BLOCK_ENTRY_PC (SYMBOL_BLOCK_VALUE (sym));
section = SYMBOL_OBJ_SECTION (objfile, sym); section = SYMBOL_OBJ_SECTION (objfile, sym);
name = SYMBOL_LINKAGE_NAME (sym); name = sym->linkage_name ();
} }
else else
{ {
@ -4384,8 +4384,7 @@ symbol_search::compare_search_syms (const symbol_search &sym_a,
if (sym_a.block != sym_b.block) if (sym_a.block != sym_b.block)
return sym_a.block - sym_b.block; return sym_a.block - sym_b.block;
return strcmp (SYMBOL_PRINT_NAME (sym_a.symbol), return strcmp (sym_a.symbol->print_name (), sym_b.symbol->print_name ());
SYMBOL_PRINT_NAME (sym_b.symbol));
} }
/* Returns true if the type_name of symbol_type of SYM matches TREG. /* Returns true if the type_name of symbol_type of SYM matches TREG.
@ -4402,7 +4401,7 @@ treg_matches_sym_type_name (const compiled_regex &treg,
{ {
fprintf_unfiltered (gdb_stdlog, fprintf_unfiltered (gdb_stdlog,
"treg_matches_sym_type_name\n sym %s\n", "treg_matches_sym_type_name\n sym %s\n",
SYMBOL_NATURAL_NAME (sym)); sym->natural_name ());
} }
sym_type = SYMBOL_TYPE (sym); sym_type = SYMBOL_TYPE (sym);
@ -4639,7 +4638,7 @@ search_symbols (const char *regexp, enum search_domain kind,
&& file_matches (symtab_to_fullname (real_symtab), && file_matches (symtab_to_fullname (real_symtab),
files, nfiles, 0))) files, nfiles, 0)))
&& ((!preg.has_value () && ((!preg.has_value ()
|| preg->exec (SYMBOL_NATURAL_NAME (sym), 0, || preg->exec (sym->natural_name (), 0,
NULL, 0) == 0) NULL, 0) == 0)
&& ((kind == VARIABLES_DOMAIN && ((kind == VARIABLES_DOMAIN
&& SYMBOL_CLASS (sym) != LOC_TYPEDEF && SYMBOL_CLASS (sym) != LOC_TYPEDEF
@ -4787,7 +4786,7 @@ print_symbol_info (enum search_domain kind,
{ {
type_print (SYMBOL_TYPE (sym), type_print (SYMBOL_TYPE (sym),
(SYMBOL_CLASS (sym) == LOC_TYPEDEF (SYMBOL_CLASS (sym) == LOC_TYPEDEF
? "" : SYMBOL_PRINT_NAME (sym)), ? "" : sym->print_name ()),
gdb_stdout, 0); gdb_stdout, 0);
printf_filtered (";\n"); printf_filtered (";\n");
@ -4796,7 +4795,7 @@ print_symbol_info (enum search_domain kind,
point we might want a language specific method to print the module point we might want a language specific method to print the module
symbol so that we can customise the output more. */ symbol so that we can customise the output more. */
else if (kind == MODULES_DOMAIN) 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 /* This help function for symtab_symbol_info() prints information
@ -5128,7 +5127,7 @@ rbreak_command (const char *regexp, int from_tty)
const char *fullname = symtab_to_fullname (symtab); const char *fullname = symtab_to_fullname (symtab);
string = string_printf ("%s:'%s'", fullname, string = string_printf ("%s:'%s'", fullname,
SYMBOL_LINKAGE_NAME (p.symbol)); p.symbol->linkage_name ());
break_command (&string[0], from_tty); break_command (&string[0], from_tty);
print_symbol_info (FUNCTIONS_DOMAIN, p.symbol, p.block, NULL); print_symbol_info (FUNCTIONS_DOMAIN, p.symbol, p.block, NULL);
} }
@ -5209,7 +5208,7 @@ completion_list_add_symbol (completion_tracker &tracker,
const char *text, const char *word) const char *text, const char *word)
{ {
completion_list_add_name (tracker, SYMBOL_LANGUAGE (sym), completion_list_add_name (tracker, SYMBOL_LANGUAGE (sym),
SYMBOL_NATURAL_NAME (sym), sym->natural_name (),
lookup_name, text, word); lookup_name, text, word);
} }
@ -5401,7 +5400,7 @@ find_gnu_ifunc (const symbol *sym)
if (SYMBOL_CLASS (sym) != LOC_BLOCK) if (SYMBOL_CLASS (sym) != LOC_BLOCK)
return {}; return {};
lookup_name_info lookup_name (SYMBOL_SEARCH_NAME (sym), lookup_name_info lookup_name (sym->search_name (),
symbol_name_match_type::SEARCH_NAME); symbol_name_match_type::SEARCH_NAME);
struct objfile *objfile = symbol_objfile (sym); struct objfile *objfile = symbol_objfile (sym);
@ -6291,7 +6290,7 @@ get_symbol_address (const struct symbol *sym)
gdb_assert (sym->maybe_copied); gdb_assert (sym->maybe_copied);
gdb_assert (SYMBOL_CLASS (sym) == LOC_STATIC); 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 ()) for (objfile *objfile : current_program_space->objfiles ())
{ {
@ -6372,7 +6371,7 @@ search_module_symbols (const char *module_regexp, const char *regexp,
/* This is a module. */ /* This is a module. */
gdb_assert (p.symbol != nullptr); gdb_assert (p.symbol != nullptr);
std::string prefix = SYMBOL_PRINT_NAME (p.symbol); std::string prefix = p.symbol->print_name ();
prefix += "::"; prefix += "::";
for (const symbol_search &q : symbols) for (const symbol_search &q : symbols)
@ -6380,7 +6379,7 @@ search_module_symbols (const char *module_regexp, const char *regexp,
if (q.symbol == nullptr) if (q.symbol == nullptr)
continue; continue;
if (strncmp (SYMBOL_PRINT_NAME (q.symbol), prefix.c_str (), if (strncmp (q.symbol->print_name (), prefix.c_str (),
prefix.size ()) != 0) prefix.size ()) != 0)
continue; continue;
@ -6523,8 +6522,7 @@ info_module_subcommand (bool quiet, const char *module_regexp,
if (last_module_symbol != p.symbol) if (last_module_symbol != p.symbol)
{ {
printf_filtered ("\n"); printf_filtered ("\n");
printf_filtered (_("Module \"%s\":\n"), printf_filtered (_("Module \"%s\":\n"), p.symbol->print_name ());
SYMBOL_PRINT_NAME (p.symbol));
last_module_symbol = p.symbol; last_module_symbol = p.symbol;
last_filename = ""; last_filename = "";
} }

View file

@ -67,7 +67,7 @@ enum class symbol_name_match_type
/* Search name matching. This is like FULL, but the search name did /* Search name matching. This is like FULL, but the search name did
not come from the user; instead it is already a search name 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 For Ada, this avoids re-encoding an already-encoded search name
(which would potentially incorrectly lowercase letters in the (which would potentially incorrectly lowercase letters in the
linkage/search name that should remain uppercase). For C++, it linkage/search name that should remain uppercase). For C++, it
@ -546,43 +546,6 @@ extern void symbol_set_names (struct general_symbol_info *symbol,
gdb::string_view linkage_name, bool copy_name, gdb::string_view linkage_name, bool copy_name,
struct objfile_per_bfd_storage *per_bfd); 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 /* Return true if NAME matches the "search" name of SYMBOL, according
to the symbol's language. */ to the symbol's language. */
#define SYMBOL_MATCHES_SEARCH_NAME(symbol, name) \ #define SYMBOL_MATCHES_SEARCH_NAME(symbol, name) \
@ -1640,8 +1603,7 @@ extern struct block_symbol lookup_symbol (const char *,
DOMAIN, visible from lexical block BLOCK if non-NULL or from DOMAIN, visible from lexical block BLOCK if non-NULL or from
global/static blocks if BLOCK is NULL. The passed-in search name global/static blocks if BLOCK is NULL. The passed-in search name
should not come from the user; instead it should already be a should not come from the user; instead it should already be a
search name as retrieved from a search name as retrieved from a search_name () call. See definition of
SYMBOL_SEARCH_NAME/search_name () call. See definition of
symbol_name_match_type::SEARCH_NAME. Returns the struct symbol symbol_name_match_type::SEARCH_NAME. Returns the struct symbol
pointer, or NULL if no symbol is found. The symbol's section is pointer, or NULL if no symbol is found. The symbol's section is
fixed up if necessary. */ fixed up if necessary. */

View file

@ -236,11 +236,11 @@ set_traceframe_context (struct frame_info *trace_frame)
/* Save func name as "$trace_func", a debugger variable visible to /* Save func name as "$trace_func", a debugger variable visible to
users. */ users. */
if (traceframe_fun == NULL if (traceframe_fun == NULL
|| SYMBOL_LINKAGE_NAME (traceframe_fun) == NULL) || traceframe_fun->linkage_name () == NULL)
clear_internalvar (lookup_internalvar ("trace_func")); clear_internalvar (lookup_internalvar ("trace_func"));
else else
set_internalvar_string (lookup_internalvar ("trace_func"), 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 /* Save file name as "$trace_file", a debugger variable visible to
users. */ users. */
@ -693,7 +693,7 @@ validate_actionline (const char *line, struct breakpoint *b)
{ {
error (_("constant `%s' (value %s) " error (_("constant `%s' (value %s) "
"will not be collected."), "will not be collected."),
SYMBOL_PRINT_NAME (exp->elts[2].symbol), exp->elts[2].symbol->print_name (),
plongest (SYMBOL_VALUE (exp->elts[2].symbol))); plongest (SYMBOL_VALUE (exp->elts[2].symbol)));
} }
else if (SYMBOL_CLASS (exp->elts[2].symbol) else if (SYMBOL_CLASS (exp->elts[2].symbol)
@ -701,7 +701,7 @@ validate_actionline (const char *line, struct breakpoint *b)
{ {
error (_("`%s' is optimized away " error (_("`%s' is optimized away "
"and cannot be collected."), "and cannot be collected."),
SYMBOL_PRINT_NAME (exp->elts[2].symbol)); exp->elts[2].symbol->print_name ());
} }
} }
@ -926,19 +926,18 @@ collection_list::collect_symbol (struct symbol *sym,
{ {
default: default:
printf_filtered ("%s: don't know symbol class %d\n", printf_filtered ("%s: don't know symbol class %d\n",
SYMBOL_PRINT_NAME (sym), sym->print_name (), SYMBOL_CLASS (sym));
SYMBOL_CLASS (sym));
break; break;
case LOC_CONST: case LOC_CONST:
printf_filtered ("constant %s (value %s) will not be collected.\n", 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; break;
case LOC_STATIC: case LOC_STATIC:
offset = SYMBOL_VALUE_ADDRESS (sym); offset = SYMBOL_VALUE_ADDRESS (sym);
if (info_verbose) if (info_verbose)
{ {
printf_filtered ("LOC_STATIC %s: collect %ld bytes at %s.\n", printf_filtered ("LOC_STATIC %s: collect %ld bytes at %s.\n",
SYMBOL_PRINT_NAME (sym), len, sym->print_name (), len,
paddress (gdbarch, offset)); paddress (gdbarch, offset));
} }
/* A struct may be a C++ class with static fields, go to general /* A struct may be a C++ class with static fields, go to general
@ -951,8 +950,7 @@ collection_list::collect_symbol (struct symbol *sym,
case LOC_REGISTER: case LOC_REGISTER:
reg = SYMBOL_REGISTER_OPS (sym)->register_number (sym, gdbarch); reg = SYMBOL_REGISTER_OPS (sym)->register_number (sym, gdbarch);
if (info_verbose) if (info_verbose)
printf_filtered ("LOC_REG[parm] %s: ", printf_filtered ("LOC_REG[parm] %s: ", sym->print_name ());
SYMBOL_PRINT_NAME (sym));
add_local_register (gdbarch, reg, scope); add_local_register (gdbarch, reg, scope);
/* Check for doubles stored in two registers. */ /* Check for doubles stored in two registers. */
/* FIXME: how about larger types stored in 3 or more regs? */ /* FIXME: how about larger types stored in 3 or more regs? */
@ -962,8 +960,7 @@ collection_list::collect_symbol (struct symbol *sym,
break; break;
case LOC_REF_ARG: case LOC_REF_ARG:
printf_filtered ("Sorry, don't know how to do LOC_REF_ARG yet.\n"); printf_filtered ("Sorry, don't know how to do LOC_REF_ARG yet.\n");
printf_filtered (" (will not collect %s)\n", printf_filtered (" (will not collect %s)\n", sym->print_name ());
SYMBOL_PRINT_NAME (sym));
break; break;
case LOC_ARG: case LOC_ARG:
reg = frame_regno; reg = frame_regno;
@ -971,8 +968,7 @@ collection_list::collect_symbol (struct symbol *sym,
if (info_verbose) if (info_verbose)
{ {
printf_filtered ("LOC_LOCAL %s: Collect %ld bytes at offset %s" printf_filtered ("LOC_LOCAL %s: Collect %ld bytes at offset %s"
" from frame ptr reg %d\n", " from frame ptr reg %d\n", sym->print_name (), len,
SYMBOL_PRINT_NAME (sym), len,
paddress (gdbarch, offset), reg); paddress (gdbarch, offset), reg);
} }
add_memrange (gdbarch, reg, offset, len, scope); add_memrange (gdbarch, reg, offset, len, scope);
@ -983,8 +979,7 @@ collection_list::collect_symbol (struct symbol *sym,
if (info_verbose) if (info_verbose)
{ {
printf_filtered ("LOC_REGPARM_ADDR %s: Collect %ld bytes at offset %s" printf_filtered ("LOC_REGPARM_ADDR %s: Collect %ld bytes at offset %s"
" from reg %d\n", " from reg %d\n", sym->print_name (), len,
SYMBOL_PRINT_NAME (sym), len,
paddress (gdbarch, offset), reg); paddress (gdbarch, offset), reg);
} }
add_memrange (gdbarch, reg, offset, len, scope); add_memrange (gdbarch, reg, offset, len, scope);
@ -995,8 +990,7 @@ collection_list::collect_symbol (struct symbol *sym,
if (info_verbose) if (info_verbose)
{ {
printf_filtered ("LOC_LOCAL %s: Collect %ld bytes at offset %s" printf_filtered ("LOC_LOCAL %s: Collect %ld bytes at offset %s"
" from frame ptr reg %d\n", " from frame ptr reg %d\n", sym->print_name (), len,
SYMBOL_PRINT_NAME (sym), len,
paddress (gdbarch, offset), reg); paddress (gdbarch, offset), reg);
} }
add_memrange (gdbarch, reg, offset, len, scope); add_memrange (gdbarch, reg, offset, len, scope);
@ -1008,7 +1002,7 @@ collection_list::collect_symbol (struct symbol *sym,
case LOC_OPTIMIZED_OUT: case LOC_OPTIMIZED_OUT:
printf_filtered ("%s has been optimized out of existence.\n", printf_filtered ("%s has been optimized out of existence.\n",
SYMBOL_PRINT_NAME (sym)); sym->print_name ());
break; break;
case LOC_COMPUTED: case LOC_COMPUTED:
@ -1028,7 +1022,7 @@ collection_list::collect_symbol (struct symbol *sym,
if (!aexpr) if (!aexpr)
{ {
printf_filtered ("%s has been optimized out of existence.\n", printf_filtered ("%s has been optimized out of existence.\n",
SYMBOL_PRINT_NAME (sym)); sym->print_name ());
return; return;
} }
@ -1424,7 +1418,7 @@ encode_actions_1 (struct command_line *action,
case OP_VAR_VALUE: case OP_VAR_VALUE:
{ {
struct symbol *sym = exp->elts[2].symbol; 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, collect->collect_symbol (exp->elts[2].symbol,
target_gdbarch (), target_gdbarch (),
@ -2526,7 +2520,7 @@ info_scope_command (const char *args_in, int from_tty)
printf_filtered ("Scope for %s:\n", save_args); printf_filtered ("Scope for %s:\n", save_args);
count++; count++;
symname = SYMBOL_PRINT_NAME (sym); symname = sym->print_name ();
if (symname == NULL || *symname == '\0') if (symname == NULL || *symname == '\0')
continue; /* Probably botched, certainly useless. */ continue; /* Probably botched, certainly useless. */
@ -2616,7 +2610,7 @@ info_scope_command (const char *args_in, int from_tty)
paddress (gdbarch, BLOCK_ENTRY_PC (SYMBOL_BLOCK_VALUE (sym)))); paddress (gdbarch, BLOCK_ENTRY_PC (SYMBOL_BLOCK_VALUE (sym))));
break; break;
case LOC_UNRESOLVED: case LOC_UNRESOLVED:
msym = lookup_minimal_symbol (SYMBOL_LINKAGE_NAME (sym), msym = lookup_minimal_symbol (sym->linkage_name (),
NULL, NULL); NULL, NULL);
if (msym.minsym == NULL) if (msym.minsym == NULL)
printf_filtered ("Unresolved Static"); printf_filtered ("Unresolved Static");
@ -3689,7 +3683,7 @@ print_one_static_tracepoint_marker (int count,
if (sym) if (sym)
{ {
uiout->text ("in "); uiout->text ("in ");
uiout->field_string ("func", SYMBOL_PRINT_NAME (sym), uiout->field_string ("func", sym->print_name (),
function_name_style.style ()); function_name_style.style ());
uiout->wrap_hint (wrap_indent); uiout->wrap_hint (wrap_indent);
uiout->text (" at "); uiout->text (" at ");

View file

@ -239,7 +239,7 @@ typedef_hash_table::add_template_parameters (struct type *t)
continue; continue;
tf = XOBNEW (&m_storage, struct decl_field); 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)); tf->type = SYMBOL_TYPE (TYPE_TEMPLATE_ARGUMENT (t, i));
slot = htab_find_slot (m_table, tf, INSERT); slot = htab_find_slot (m_table, tf, INSERT);

View file

@ -1330,13 +1330,13 @@ address_of_variable (struct symbol *var, const struct block *b)
error (_("Address requested for identifier " error (_("Address requested for identifier "
"\"%s\" which is in register $%s"), "\"%s\" which is in register $%s"),
SYMBOL_PRINT_NAME (var), regname); var->print_name (), regname);
break; break;
} }
default: default:
error (_("Can't take address of \"%s\" which isn't an lvalue."), error (_("Can't take address of \"%s\" which isn't an lvalue."),
SYMBOL_PRINT_NAME (var)); var->print_name ());
break; break;
} }
@ -2644,7 +2644,7 @@ find_overload_match (gdb::array_view<value *> args,
if (fsym) 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 /* 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. the function part. Do not try this for non-functions (e.g.
@ -3061,7 +3061,7 @@ find_oload_champ (gdb::array_view<value *> args,
fprintf_filtered (gdb_stderr, fprintf_filtered (gdb_stderr,
"Overloaded function instance " "Overloaded function instance "
"%s # of parms %d\n", "%s # of parms %d\n",
SYMBOL_DEMANGLED_NAME (functions[ix]), functions[ix]->demangled_name (),
(int) parm_types.size ()); (int) parm_types.size ());
for (jj = 0; jj < args.size () - static_offset; jj++) for (jj = 0; jj < args.size () - static_offset; jj++)
fprintf_filtered (gdb_stderr, fprintf_filtered (gdb_stderr,