* ax-gdb.c (gen_var_ref): Use SYMBOL_LINKAGE_NAME.
* blockframe.c (find_pc_partial_function): Likewise. * buildsym.c (find_symbol_in_list): Likewise. * c-valprint.c (c_val_print): Likewise. * coffread.c (patch_opaque_types, process_coff_symbol): Likewise. (coff_read_enum_type): Likewise. Use SYMBOL_SET_LINKAGE_NAME. * cp-support.c (cp_remove_params): Renamed from remove_params and made global. (overload_list_add_symbol): Update call to remove_params. * cp-support.h (cp_remove_params): Declare. * dwarf2read.c (process_enumeration_scope): Use SYMBOL_LINKAGE_NAME. (dwarf2_const_value): Use SYMBOL_PRINT_NAME. * expprint.c (dump_subexp_body_standard): Likewise. * f-valprint.c (info_common_command, there_is_a_visible_common_named): Use SYMBOL_LINKAGE_NAME to find symbols and SYMBOL_PRINT_NAME for messages. * findvar.c (read_var_value): Use SYMBOL_LINKAGE_NAME. * gnu-v2-abi.c (gnuv2_value_rtti_type): Likewise. * hppa-hpux-tdep.c (hppa32_hpux_in_solib_call_trampoline) (hppa_hpux_skip_trampoline_code): Use SYMBOL_LINKAGE_NAME to find symbols and SYMBOL_PRINT_NAME for messages. * jv-lang.c (add_class_symbol): Use SYMBOL_SET_LINKAGE_NAME. * linespec.c (decode_line_2): Use SYMBOL_LINKAGE_NAME. * mdebugread.c (parse_symbol): Use SYMBOL_LINKAGE_NAME and SYMBOL_SET_LINKAGE_NAME. (mylookup_symbol): Use SYMBOL_LINKAGE_NAME. * minsyms.c (add_minsym_to_demangled_hash_table): Use SYMBOL_SEARCH_NAME. (lookup_minimal_symbol): Use SYMBOL_LINKAGE_NAME or SYMBOL_MATCHES_SEARCH_NAME, depending on the pass. * objfiles.h (ALL_OBJFILE_MSYMBOLS): Use SYMBOL_LINKAGE_NAME. * printcmd.c (build_address_symbolic): Use SYMBOL_LINKAGE_NAME. (address_info): Use SYMBOL_PRINT_NAME for messages and SYMBOL_LINKAGE_NAME for lookups. * sol-thread.c (info_cb): Use SYMBOL_PRINT_NAME for messages. * stabsread.c (patch_block_stabs, define_symbol) (read_type, read_enum_type, common_block_end) (cleanup_undefined_types_1, scan_file_globals): Use SYMBOL_LINKAGE_NAME, SYMBOL_SET_LINKAGE_NAME, ALL_OBJFILE_MSYMBOLS, and SYMBOL_PRINT_NAME. * stack.c (print_frame_args): Use SYMBOL_LINKAGE_NAME. (print_frame, frame_info): Use SYMBOL_PRINT_NAME for output. Use cp_remove_params instead of cplus_demangle. (print_block_frame_labels, print_frame_arg_vars): Use SYMBOL_LINKAGE_NAME. * symmisc.c (dump_msymbols): Use ALL_OBJFILE_MSYMBOLS and SYMBOL_LINKAGE_NAME. (dump_symtab_1, print_symbol, print_partial_symbols) (maintenance_check_symtabs): Use SYMBOL_LINKAGE_NAME. * symtab.h (DEPRECATED_SYMBOL_NAME): Delete. (SYMBOL_SET_LINKAGE_NAME): New. (SYMBOL_SET_NAMES): Add a comment. * tracepoint.c (set_traceframe_context, validate_actionline) (collect_symbol, scope_info): Use SYMBOL_LINKAGE_NAME for lookups and SYMBOL_PRINT_NAME for output. * typeprint.c (typedef_print): Use SYMBOL_LINKAGE_NAME. * xcoffread.c (process_xcoff_symbol): Use SYMBOL_SET_LINKAGE_NAME.
This commit is contained in:
parent
c22a967f85
commit
3567439cde
28 changed files with 248 additions and 195 deletions
76
gdb/stack.c
76
gdb/stack.c
|
@ -44,6 +44,7 @@
|
|||
#include "solib.h"
|
||||
#include "valprint.h"
|
||||
#include "gdbthread.h"
|
||||
#include "cp-support.h"
|
||||
|
||||
#include "gdb_assert.h"
|
||||
#include <ctype.h>
|
||||
|
@ -287,10 +288,10 @@ print_frame_args (struct symbol *func, struct frame_info *frame,
|
|||
parameter names occur on the RS/6000, for traceback
|
||||
tables. FIXME, should we even print them? */
|
||||
|
||||
if (*DEPRECATED_SYMBOL_NAME (sym))
|
||||
if (*SYMBOL_LINKAGE_NAME (sym))
|
||||
{
|
||||
struct symbol *nsym;
|
||||
nsym = lookup_symbol (DEPRECATED_SYMBOL_NAME (sym),
|
||||
nsym = lookup_symbol (SYMBOL_LINKAGE_NAME (sym),
|
||||
b, VAR_DOMAIN, NULL);
|
||||
gdb_assert (nsym != NULL);
|
||||
if (SYMBOL_CLASS (nsym) == LOC_REGISTER
|
||||
|
@ -618,12 +619,12 @@ print_frame (struct frame_info *frame, int print_level,
|
|||
/* We also don't know anything about the function besides
|
||||
its address and name. */
|
||||
func = 0;
|
||||
funname = DEPRECATED_SYMBOL_NAME (msymbol);
|
||||
funname = SYMBOL_PRINT_NAME (msymbol);
|
||||
funlang = SYMBOL_LANGUAGE (msymbol);
|
||||
}
|
||||
else
|
||||
{
|
||||
funname = DEPRECATED_SYMBOL_NAME (func);
|
||||
funname = SYMBOL_PRINT_NAME (func);
|
||||
funlang = SYMBOL_LANGUAGE (func);
|
||||
if (funlang == language_cplus)
|
||||
{
|
||||
|
@ -631,23 +632,13 @@ print_frame (struct frame_info *frame, int print_level,
|
|||
to display the demangled name that we already have
|
||||
stored in the symbol table, but we stored a version
|
||||
with DMGL_PARAMS turned on, and here we don't want to
|
||||
display parameters. So call the demangler again, with
|
||||
DMGL_ANSI only.
|
||||
|
||||
Yes, printf_symbol_filtered() will again try to
|
||||
demangle the name on the fly, but the issue is that
|
||||
if cplus_demangle() fails here, it will fail there
|
||||
too. So we want to catch the failure (where DEMANGLED
|
||||
is NULL below) here, while we still have our hands on
|
||||
the function symbol.) */
|
||||
char *demangled = cplus_demangle (funname, DMGL_ANSI);
|
||||
if (demangled == NULL)
|
||||
/* If the demangler fails, try the demangled name from
|
||||
the symbol table. That'll have parameters, but
|
||||
that's preferable to displaying a mangled name. */
|
||||
funname = SYMBOL_PRINT_NAME (func);
|
||||
else
|
||||
xfree (demangled);
|
||||
display parameters. So remove the parameters. */
|
||||
char *func_only = cp_remove_params (funname);
|
||||
if (func_only)
|
||||
{
|
||||
funname = func_only;
|
||||
make_cleanup (xfree, func_only);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -658,7 +649,7 @@ print_frame (struct frame_info *frame, int print_level,
|
|||
|
||||
if (msymbol != NULL)
|
||||
{
|
||||
funname = DEPRECATED_SYMBOL_NAME (msymbol);
|
||||
funname = SYMBOL_PRINT_NAME (msymbol);
|
||||
funlang = SYMBOL_LANGUAGE (msymbol);
|
||||
}
|
||||
}
|
||||
|
@ -895,6 +886,7 @@ frame_info (char *addr_exp, int from_tty)
|
|||
const char *pc_regname;
|
||||
int selected_frame_p;
|
||||
struct gdbarch *gdbarch;
|
||||
struct cleanup *back_to = make_cleanup (null_cleanup, NULL);
|
||||
|
||||
fi = parse_frame_specification_1 (addr_exp, "No stack.", &selected_frame_p);
|
||||
gdbarch = get_frame_arch (fi);
|
||||
|
@ -920,29 +912,21 @@ frame_info (char *addr_exp, int from_tty)
|
|||
s = find_pc_symtab (get_frame_pc (fi));
|
||||
if (func)
|
||||
{
|
||||
/* It seems appropriate to use SYMBOL_PRINT_NAME() here, to
|
||||
display the demangled name that we already have stored in the
|
||||
symbol table, but we stored a version with DMGL_PARAMS turned
|
||||
on, and here we don't want to display parameters. So call the
|
||||
demangler again, with DMGL_ANSI only.
|
||||
|
||||
Yes, printf_symbol_filtered() will again try to demangle the
|
||||
name on the fly, but the issue is that if cplus_demangle()
|
||||
fails here, it will fail there too. So we want to catch the
|
||||
failure (where DEMANGLED is NULL below) here, while we still
|
||||
have our hands on the function symbol.) */
|
||||
funname = DEPRECATED_SYMBOL_NAME (func);
|
||||
funname = SYMBOL_PRINT_NAME (func);
|
||||
funlang = SYMBOL_LANGUAGE (func);
|
||||
if (funlang == language_cplus)
|
||||
{
|
||||
char *demangled = cplus_demangle (funname, DMGL_ANSI);
|
||||
/* If the demangler fails, try the demangled name from the
|
||||
symbol table. That'll have parameters, but that's
|
||||
preferable to displaying a mangled name. */
|
||||
if (demangled == NULL)
|
||||
funname = SYMBOL_PRINT_NAME (func);
|
||||
else
|
||||
xfree (demangled);
|
||||
/* It seems appropriate to use SYMBOL_PRINT_NAME() here,
|
||||
to display the demangled name that we already have
|
||||
stored in the symbol table, but we stored a version
|
||||
with DMGL_PARAMS turned on, and here we don't want to
|
||||
display parameters. So remove the parameters. */
|
||||
char *func_only = cp_remove_params (funname);
|
||||
if (func_only)
|
||||
{
|
||||
funname = func_only;
|
||||
make_cleanup (xfree, func_only);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -952,7 +936,7 @@ frame_info (char *addr_exp, int from_tty)
|
|||
msymbol = lookup_minimal_symbol_by_pc (get_frame_pc (fi));
|
||||
if (msymbol != NULL)
|
||||
{
|
||||
funname = DEPRECATED_SYMBOL_NAME (msymbol);
|
||||
funname = SYMBOL_PRINT_NAME (msymbol);
|
||||
funlang = SYMBOL_LANGUAGE (msymbol);
|
||||
}
|
||||
}
|
||||
|
@ -1154,6 +1138,8 @@ frame_info (char *addr_exp, int from_tty)
|
|||
if (count || need_nl)
|
||||
puts_filtered ("\n");
|
||||
}
|
||||
|
||||
do_cleanups (back_to);
|
||||
}
|
||||
|
||||
/* Print briefly all stack frames or just the innermost COUNT_EXP
|
||||
|
@ -1410,7 +1396,7 @@ print_block_frame_labels (struct block *b, int *have_default,
|
|||
|
||||
ALL_BLOCK_SYMBOLS (b, iter, sym)
|
||||
{
|
||||
if (strcmp (DEPRECATED_SYMBOL_NAME (sym), "default") == 0)
|
||||
if (strcmp (SYMBOL_LINKAGE_NAME (sym), "default") == 0)
|
||||
{
|
||||
if (*have_default)
|
||||
continue;
|
||||
|
@ -1594,7 +1580,7 @@ print_frame_arg_vars (struct frame_info *frame, struct ui_file *stream)
|
|||
float). There are also LOC_ARG/LOC_REGISTER pairs which
|
||||
are not combined in symbol-reading. */
|
||||
|
||||
sym2 = lookup_symbol (DEPRECATED_SYMBOL_NAME (sym),
|
||||
sym2 = lookup_symbol (SYMBOL_LINKAGE_NAME (sym),
|
||||
b, VAR_DOMAIN, NULL);
|
||||
print_variable_value (sym2, frame, stream);
|
||||
fprintf_filtered (stream, "\n");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue