* 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.
+2008-08-21 Daniel Jacobowitz <dan@codesourcery.com>
+
+ * 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.
+
2008-08-21 Pedro Alves <pedro@codesourcery.com>
* arm-tdep.c (arm_pc_is_thumb): Use obj_section_addr.
case LOC_UNRESOLVED:
{
struct minimal_symbol *msym
- = lookup_minimal_symbol (DEPRECATED_SYMBOL_NAME (var), NULL, NULL);
+ = lookup_minimal_symbol (SYMBOL_LINKAGE_NAME (var), NULL, NULL);
if (!msym)
error (_("Couldn't resolve symbol `%s'."), SYMBOL_PRINT_NAME (var));
{
cache_pc_function_low = BLOCK_START (SYMBOL_BLOCK_VALUE (f));
cache_pc_function_high = BLOCK_END (SYMBOL_BLOCK_VALUE (f));
- cache_pc_function_name = DEPRECATED_SYMBOL_NAME (f);
+ cache_pc_function_name = SYMBOL_LINKAGE_NAME (f);
cache_pc_function_section = section;
goto return_cached_value;
}
if (address)
*address = SYMBOL_VALUE_ADDRESS (psb);
if (name)
- *name = DEPRECATED_SYMBOL_NAME (psb);
+ *name = SYMBOL_LINKAGE_NAME (psb);
/* endaddr non-NULL can't happen here. */
return 1;
}
}
cache_pc_function_low = SYMBOL_VALUE_ADDRESS (msymbol);
- cache_pc_function_name = DEPRECATED_SYMBOL_NAME (msymbol);
+ cache_pc_function_name = SYMBOL_LINKAGE_NAME (msymbol);
cache_pc_function_section = section;
/* If the minimal symbol has a size, use it for the cache.
other sections, to find the next symbol in this section with
a different address. */
- for (i = 1; DEPRECATED_SYMBOL_NAME (msymbol + i) != NULL; i++)
+ for (i = 1; SYMBOL_LINKAGE_NAME (msymbol + i) != NULL; i++)
{
if (SYMBOL_VALUE_ADDRESS (msymbol + i) != SYMBOL_VALUE_ADDRESS (msymbol)
&& SYMBOL_BFD_SECTION (msymbol + i) == SYMBOL_BFD_SECTION (msymbol))
break;
}
- if (DEPRECATED_SYMBOL_NAME (msymbol + i) != NULL
+ if (SYMBOL_LINKAGE_NAME (msymbol + i) != NULL
&& SYMBOL_VALUE_ADDRESS (msymbol + i) < obj_section_endaddr (osect))
cache_pc_function_high = SYMBOL_VALUE_ADDRESS (msymbol + i);
else
{
for (j = list->nsyms; --j >= 0;)
{
- pp = DEPRECATED_SYMBOL_NAME (list->symbol[j]);
+ pp = SYMBOL_LINKAGE_NAME (list->symbol[j]);
if (*pp == *name && strncmp (pp, name, length) == 0 &&
pp[length] == '\0')
{
int is_this_fld;
if (msymbol != NULL)
- wsym = lookup_symbol (DEPRECATED_SYMBOL_NAME (msymbol), block,
+ wsym = lookup_symbol (SYMBOL_LINKAGE_NAME (msymbol), block,
VAR_DOMAIN, &is_this_fld);
if (wsym)
TYPE_CODE (SYMBOL_TYPE (real_sym)) == TYPE_CODE_PTR &&
TYPE_LENGTH (TYPE_TARGET_TYPE (SYMBOL_TYPE (real_sym))) != 0)
{
- char *name = DEPRECATED_SYMBOL_NAME (real_sym);
+ char *name = SYMBOL_LINKAGE_NAME (real_sym);
int hash = hashname (name);
struct symbol *sym, *prev;
prev = 0;
for (sym = opaque_type_chain[hash]; sym;)
{
- if (name[0] == DEPRECATED_SYMBOL_NAME (sym)[0] &&
- strcmp (name + 1, DEPRECATED_SYMBOL_NAME (sym) + 1) == 0)
+ if (name[0] == SYMBOL_LINKAGE_NAME (sym)[0] &&
+ strcmp (name + 1, SYMBOL_LINKAGE_NAME (sym) + 1) == 0)
{
if (prev)
{
}
else
TYPE_NAME (SYMBOL_TYPE (sym)) =
- concat (DEPRECATED_SYMBOL_NAME (sym), (char *)NULL);
+ concat (SYMBOL_LINKAGE_NAME (sym), (char *)NULL);
}
/* Keep track of any type which points to empty structured type,
TYPE_CODE (TYPE_TARGET_TYPE (SYMBOL_TYPE (sym))) !=
TYPE_CODE_UNDEF)
{
- int i = hashname (DEPRECATED_SYMBOL_NAME (sym));
+ int i = hashname (SYMBOL_LINKAGE_NAME (sym));
SYMBOL_VALUE_CHAIN (sym) = opaque_type_chain[i];
opaque_type_chain[i] = sym;
names for anonymous enums, structures, and unions, like
"~0fake" or ".0fake". Thanks, but no thanks... */
if (TYPE_TAG_NAME (SYMBOL_TYPE (sym)) == 0)
- if (DEPRECATED_SYMBOL_NAME (sym) != NULL
- && *DEPRECATED_SYMBOL_NAME (sym) != '~'
- && *DEPRECATED_SYMBOL_NAME (sym) != '.')
+ if (SYMBOL_LINKAGE_NAME (sym) != NULL
+ && *SYMBOL_LINKAGE_NAME (sym) != '~'
+ && *SYMBOL_LINKAGE_NAME (sym) != '.')
TYPE_TAG_NAME (SYMBOL_TYPE (sym)) =
- concat (DEPRECATED_SYMBOL_NAME (sym), (char *)NULL);
+ concat (SYMBOL_LINKAGE_NAME (sym), (char *)NULL);
add_symbol_to_list (sym, &file_symbols);
break;
(&objfile->objfile_obstack, sizeof (struct symbol));
memset (sym, 0, sizeof (struct symbol));
- DEPRECATED_SYMBOL_NAME (sym) =
- obsavestring (name, strlen (name), &objfile->objfile_obstack);
+ SYMBOL_SET_LINKAGE_NAME (sym,
+ obsavestring (name, strlen (name),
+ &objfile->objfile_obstack));
SYMBOL_CLASS (sym) = LOC_CONST;
SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
SYMBOL_VALUE (sym) = ms->c_value;
{
struct symbol *xsym = syms->symbol[j];
SYMBOL_TYPE (xsym) = type;
- TYPE_FIELD_NAME (type, n) = DEPRECATED_SYMBOL_NAME (xsym);
+ TYPE_FIELD_NAME (type, n) = SYMBOL_LINKAGE_NAME (xsym);
TYPE_FIELD_BITPOS (type, n) = SYMBOL_VALUE (xsym);
if (SYMBOL_VALUE (xsym) < 0)
unsigned_enum = 0;
(optionally) a return type. Return the name of the function without
parameters or return type, or NULL if we can not parse the name. */
-static char *
-remove_params (const char *demangled_name)
+char *
+cp_remove_params (const char *demangled_name)
{
int done = 0;
struct demangle_component *ret_comp;
return;
/* Get the demangled name without parameters */
- sym_name = remove_params (SYMBOL_NATURAL_NAME (sym));
+ sym_name = cp_remove_params (SYMBOL_NATURAL_NAME (sym));
if (!sym_name)
return;
extern char *cp_func_name (const char *full_name);
+extern char *cp_remove_params (const char *demangled_name);
+
extern struct symbol **make_symbol_overload_list (const char *,
const char *);
* sizeof (struct field));
}
- FIELD_NAME (fields[num_fields]) = DEPRECATED_SYMBOL_NAME (sym);
+ FIELD_NAME (fields[num_fields]) = SYMBOL_LINKAGE_NAME (sym);
FIELD_TYPE (fields[num_fields]) = NULL;
FIELD_BITPOS (fields[num_fields]) = SYMBOL_VALUE (sym);
FIELD_BITSIZE (fields[num_fields]) = 0;
{
case DW_FORM_addr:
if (TYPE_LENGTH (SYMBOL_TYPE (sym)) != cu_header->addr_size)
- dwarf2_const_value_length_mismatch_complaint (DEPRECATED_SYMBOL_NAME (sym),
+ dwarf2_const_value_length_mismatch_complaint (SYMBOL_PRINT_NAME (sym),
cu_header->addr_size,
TYPE_LENGTH (SYMBOL_TYPE
(sym)));
case DW_FORM_block:
blk = DW_BLOCK (attr);
if (TYPE_LENGTH (SYMBOL_TYPE (sym)) != blk->size)
- dwarf2_const_value_length_mismatch_complaint (DEPRECATED_SYMBOL_NAME (sym),
+ dwarf2_const_value_length_mismatch_complaint (SYMBOL_PRINT_NAME (sym),
blk->size,
TYPE_LENGTH (SYMBOL_TYPE
(sym)));
fprintf_filtered (stream, ", symbol @");
gdb_print_host_address (exp->elts[elt + 1].symbol, stream);
fprintf_filtered (stream, " (%s)",
- DEPRECATED_SYMBOL_NAME (exp->elts[elt + 1].symbol));
+ SYMBOL_PRINT_NAME (exp->elts[elt + 1].symbol));
elt += 3;
break;
case OP_LAST:
if (msymbol != NULL
&& (SYMBOL_VALUE_ADDRESS (msymbol)
> BLOCK_START (SYMBOL_BLOCK_VALUE (func))))
- funname = DEPRECATED_SYMBOL_NAME (msymbol);
+ funname = SYMBOL_LINKAGE_NAME (msymbol);
else
- funname = DEPRECATED_SYMBOL_NAME (func);
+ funname = SYMBOL_LINKAGE_NAME (func);
}
else
{
lookup_minimal_symbol_by_pc (get_frame_pc (fi));
if (msymbol != NULL)
- funname = DEPRECATED_SYMBOL_NAME (msymbol);
+ funname = SYMBOL_LINKAGE_NAME (msymbol);
else /* Got no 'funname', code below will fail. */
error (_("No function found for frame."));
}
while (entry != NULL)
{
- printf_filtered ("%s = ", DEPRECATED_SYMBOL_NAME (entry->symbol));
+ printf_filtered ("%s = ", SYMBOL_PRINT_NAME (entry->symbol));
print_variable_value (entry->symbol, fi, gdb_stdout);
printf_filtered ("\n");
entry = entry->next;
if (msymbol != NULL
&& (SYMBOL_VALUE_ADDRESS (msymbol)
> BLOCK_START (SYMBOL_BLOCK_VALUE (func))))
- funname = DEPRECATED_SYMBOL_NAME (msymbol);
+ funname = SYMBOL_LINKAGE_NAME (msymbol);
else
- funname = DEPRECATED_SYMBOL_NAME (func);
+ funname = SYMBOL_LINKAGE_NAME (func);
}
else
{
lookup_minimal_symbol_by_pc (fi->pc);
if (msymbol != NULL)
- funname = DEPRECATED_SYMBOL_NAME (msymbol);
+ funname = SYMBOL_LINKAGE_NAME (msymbol);
}
the_common = find_common_for_function (comname, funname);
{
struct minimal_symbol *msym;
- msym = lookup_minimal_symbol (DEPRECATED_SYMBOL_NAME (var), NULL, NULL);
+ msym = lookup_minimal_symbol (SYMBOL_LINKAGE_NAME (var), NULL, NULL);
if (msym == NULL)
return 0;
if (overlay_debugging)
/* Try to find a symbol that is the vtable */
minsym=lookup_minimal_symbol_by_pc(vtbl);
if (minsym==NULL
- || (demangled_name=DEPRECATED_SYMBOL_NAME (minsym))==NULL
+ || (demangled_name=SYMBOL_LINKAGE_NAME (minsym))==NULL
|| !is_vtable_name (demangled_name))
return NULL;
return 1;
minsym = lookup_minimal_symbol_by_pc (pc);
- if (minsym && strcmp (DEPRECATED_SYMBOL_NAME (minsym), ".stub") == 0)
+ if (minsym && strcmp (SYMBOL_LINKAGE_NAME (minsym), ".stub") == 0)
return 1;
/* Get the unwind descriptor corresponding to PC, return zero
ALL_MSYMBOLS (objfile, msymbol)
{
if (MSYMBOL_TYPE (msymbol) == mst_text
- && strcmp (DEPRECATED_SYMBOL_NAME (msymbol),
- DEPRECATED_SYMBOL_NAME (msym)) == 0)
+ && strcmp (SYMBOL_LINKAGE_NAME (msymbol),
+ SYMBOL_LINKAGE_NAME (msym)) == 0)
{
function_found = 1;
break;
return orig_pc == pc ? 0 : pc & ~0x3;
}
- libsym = lookup_minimal_symbol (DEPRECATED_SYMBOL_NAME (stubsym), NULL, NULL);
+ libsym = lookup_minimal_symbol (SYMBOL_LINKAGE_NAME (stubsym), NULL, NULL);
if (libsym == NULL)
{
warning (_("Unable to find library symbol for %s."),
- DEPRECATED_SYMBOL_NAME (stubsym));
+ SYMBOL_PRINT_NAME (stubsym));
return orig_pc == pc ? 0 : pc & ~0x3;
}
obstack_alloc (&dynamics_objfile->objfile_obstack, sizeof (struct symbol));
memset (sym, 0, sizeof (struct symbol));
SYMBOL_LANGUAGE (sym) = language_java;
- DEPRECATED_SYMBOL_NAME (sym) = TYPE_TAG_NAME (type);
+ SYMBOL_SET_LINKAGE_NAME (sym, TYPE_TAG_NAME (type));
SYMBOL_CLASS (sym) = LOC_TYPEDEF;
/* SYMBOL_VALUE (sym) = valu; */
SYMBOL_TYPE (sym) = type;
{
if (canonical_arr[i] == NULL)
{
- symname = DEPRECATED_SYMBOL_NAME (sym_arr[i]);
+ symname = SYMBOL_LINKAGE_NAME (sym_arr[i]);
canonical_arr[i] = savestring (symname, strlen (symname));
}
}
{
if (canonical_arr)
{
- symname = DEPRECATED_SYMBOL_NAME (sym_arr[num]);
+ symname = SYMBOL_LINKAGE_NAME (sym_arr[num]);
make_cleanup (xfree, symname);
canonical_arr[i] = savestring (symname, strlen (symname));
}
/* It is a FORTRAN common block. At least for SGI Fortran the
address is not in the symbol; we need to fix it later in
scan_file_globals. */
- int bucket = hashname (DEPRECATED_SYMBOL_NAME (s));
+ int bucket = hashname (SYMBOL_LINKAGE_NAME (s));
SYMBOL_VALUE_CHAIN (s) = global_sym_chain[bucket];
global_sym_chain[bucket] = s;
}
obstack_alloc (¤t_objfile->objfile_obstack,
sizeof (struct symbol)));
memset (enum_sym, 0, sizeof (struct symbol));
- DEPRECATED_SYMBOL_NAME (enum_sym) =
- obsavestring (f->name, strlen (f->name),
- ¤t_objfile->objfile_obstack);
+ SYMBOL_SET_LINKAGE_NAME
+ (enum_sym, obsavestring (f->name, strlen (f->name),
+ ¤t_objfile->objfile_obstack));
SYMBOL_CLASS (enum_sym) = LOC_CONST;
SYMBOL_TYPE (enum_sym) = t;
SYMBOL_DOMAIN (enum_sym) = VAR_DOMAIN;
for anything except pointers or functions. */
}
else
- TYPE_NAME (SYMBOL_TYPE (s)) = DEPRECATED_SYMBOL_NAME (s);
+ TYPE_NAME (SYMBOL_TYPE (s)) = SYMBOL_LINKAGE_NAME (s);
}
break;
inc = name[0];
ALL_BLOCK_SYMBOLS (block, iter, sym)
{
- if (DEPRECATED_SYMBOL_NAME (sym)[0] == inc
+ if (SYMBOL_LINKAGE_NAME (sym)[0] == inc
&& SYMBOL_DOMAIN (sym) == domain
&& SYMBOL_CLASS (sym) == class
- && strcmp (DEPRECATED_SYMBOL_NAME (sym), name) == 0)
+ && strcmp (SYMBOL_LINKAGE_NAME (sym), name) == 0)
return sym;
}
{
if (sym->demangled_hash_next == NULL)
{
- unsigned int hash = msymbol_hash_iw (SYMBOL_DEMANGLED_NAME (sym)) % MINIMAL_SYMBOL_HASH_SIZE;
+ unsigned int hash
+ = msymbol_hash_iw (SYMBOL_SEARCH_NAME (sym)) % MINIMAL_SYMBOL_HASH_SIZE;
sym->demangled_hash_next = table[hash];
table[hash] = sym;
}
while (msymbol != NULL && found_symbol == NULL)
{
- /* FIXME: carlton/2003-02-27: This is an unholy
- mixture of linkage names and natural names. If
- you want to test the linkage names with strcmp,
- do that. If you want to test the natural names
- with strcmp_iw, use SYMBOL_MATCHES_NATURAL_NAME. */
- if (strcmp (DEPRECATED_SYMBOL_NAME (msymbol), (name)) == 0
- || (SYMBOL_DEMANGLED_NAME (msymbol) != NULL
- && strcmp_iw (SYMBOL_DEMANGLED_NAME (msymbol),
- (name)) == 0))
+ int match;
+
+ if (pass == 1)
+ match = strcmp (SYMBOL_LINKAGE_NAME (msymbol), name) == 0;
+ else
+ match = SYMBOL_MATCHES_SEARCH_NAME (msymbol, name);
+ if (match)
{
switch (MSYMBOL_TYPE (msymbol))
{
/* Traverse all minimal symbols in one objfile. */
#define ALL_OBJFILE_MSYMBOLS(objfile, m) \
- for ((m) = (objfile) -> msymbols; DEPRECATED_SYMBOL_NAME(m) != NULL; (m)++)
+ for ((m) = (objfile) -> msymbols; SYMBOL_LINKAGE_NAME(m) != NULL; (m)++)
/* Traverse all symtabs in all objfiles. */
if (do_demangle || asm_demangle)
name_temp = SYMBOL_PRINT_NAME (symbol);
else
- name_temp = DEPRECATED_SYMBOL_NAME (symbol);
+ name_temp = SYMBOL_LINKAGE_NAME (symbol);
}
if (msymbol != NULL)
if (do_demangle || asm_demangle)
name_temp = SYMBOL_PRINT_NAME (msymbol);
else
- name_temp = DEPRECATED_SYMBOL_NAME (msymbol);
+ name_temp = SYMBOL_LINKAGE_NAME (msymbol);
}
}
if (symbol == NULL && msymbol == NULL)
}
printf_filtered ("Symbol \"");
- fprintf_symbol_filtered (gdb_stdout, DEPRECATED_SYMBOL_NAME (sym),
+ fprintf_symbol_filtered (gdb_stdout, SYMBOL_PRINT_NAME (sym),
current_language->la_language, DMGL_ANSI);
printf_filtered ("\" is ");
val = SYMBOL_VALUE (sym);
{
struct minimal_symbol *msym;
- msym = lookup_minimal_symbol (DEPRECATED_SYMBOL_NAME (sym), NULL, NULL);
+ msym = lookup_minimal_symbol (SYMBOL_LINKAGE_NAME (sym), NULL, NULL);
if (msym == NULL)
printf_filtered ("unresolved");
else
msym = lookup_minimal_symbol_by_pc (ti.ti_startfunc);
if (msym)
printf_filtered (" startfunc: %s\n",
- DEPRECATED_SYMBOL_NAME (msym));
+ SYMBOL_PRINT_NAME (msym));
else
printf_filtered (" startfunc: 0x%s\n", paddr (ti.ti_startfunc));
}
msym = lookup_minimal_symbol_by_pc (ti.ti_pc);
if (msym)
printf_filtered (" - Sleep func: %s\n",
- DEPRECATED_SYMBOL_NAME (msym));
+ SYMBOL_PRINT_NAME (msym));
else
printf_filtered (" - Sleep func: 0x%s\n", paddr (ti.ti_startfunc));
}
memset (sym, 0, sizeof (struct symbol));
SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
SYMBOL_CLASS (sym) = LOC_OPTIMIZED_OUT;
- DEPRECATED_SYMBOL_NAME (sym) =
- obsavestring (name, pp - name, &objfile->objfile_obstack);
+ SYMBOL_SET_LINKAGE_NAME
+ (sym, obsavestring (name, pp - name,
+ &objfile->objfile_obstack));
pp += 2;
if (*(pp - 1) == 'F' || *(pp - 1) == 'f')
{
switch (string[1])
{
case 't':
- DEPRECATED_SYMBOL_NAME (sym) = obsavestring ("this", strlen ("this"),
- &objfile->objfile_obstack);
+ SYMBOL_SET_LINKAGE_NAME
+ (sym, obsavestring ("this", strlen ("this"),
+ &objfile->objfile_obstack));
break;
case 'v': /* $vtbl_ptr_type */
- /* Was: DEPRECATED_SYMBOL_NAME (sym) = "vptr"; */
goto normal;
case 'e':
- DEPRECATED_SYMBOL_NAME (sym) = obsavestring ("eh_throw", strlen ("eh_throw"),
- &objfile->objfile_obstack);
+ SYMBOL_SET_LINKAGE_NAME
+ (sym, obsavestring ("eh_throw", strlen ("eh_throw"),
+ &objfile->objfile_obstack));
break;
case '_':
Symbol references don't have valid names and wont't match up with
minimal symbols when the global_sym_chain is relocated.
We'll fixup symbol references when we fixup the defining symbol. */
- if (DEPRECATED_SYMBOL_NAME (sym) && DEPRECATED_SYMBOL_NAME (sym)[0] != '#')
+ if (SYMBOL_LINKAGE_NAME (sym) && SYMBOL_LINKAGE_NAME (sym)[0] != '#')
{
- i = hashname (DEPRECATED_SYMBOL_NAME (sym));
+ i = hashname (SYMBOL_LINKAGE_NAME (sym));
SYMBOL_VALUE_CHAIN (sym) = global_sym_chain[i];
global_sym_chain[i] = sym;
}
prev_sym = local_symbols->symbol[local_symbols->nsyms - 1];
if ((SYMBOL_CLASS (prev_sym) == LOC_REF_ARG
|| SYMBOL_CLASS (prev_sym) == LOC_ARG)
- && strcmp (DEPRECATED_SYMBOL_NAME (prev_sym),
- DEPRECATED_SYMBOL_NAME (sym)) == 0)
+ && strcmp (SYMBOL_LINKAGE_NAME (prev_sym),
+ SYMBOL_LINKAGE_NAME (sym)) == 0)
{
SYMBOL_CLASS (prev_sym) = LOC_REGISTER;
/* Use the type from the LOC_REGISTER; that is the type
SYMBOL_VALUE_ADDRESS (sym) = valu;
if (gdbarch_static_transform_name_p (gdbarch)
&& gdbarch_static_transform_name (gdbarch,
- DEPRECATED_SYMBOL_NAME (sym))
- != DEPRECATED_SYMBOL_NAME (sym))
+ SYMBOL_LINKAGE_NAME (sym))
+ != SYMBOL_LINKAGE_NAME (sym))
{
struct minimal_symbol *msym;
- msym = lookup_minimal_symbol (DEPRECATED_SYMBOL_NAME (sym), NULL, objfile);
+ msym = lookup_minimal_symbol (SYMBOL_LINKAGE_NAME (sym), NULL, objfile);
if (msym != NULL)
{
- DEPRECATED_SYMBOL_NAME (sym) = gdbarch_static_transform_name
- (gdbarch,
- DEPRECATED_SYMBOL_NAME (sym));
+ char *new_name = gdbarch_static_transform_name
+ (gdbarch, SYMBOL_LINKAGE_NAME (sym));
+ SYMBOL_SET_LINKAGE_NAME (sym, new_name);
SYMBOL_VALUE_ADDRESS (sym) = SYMBOL_VALUE_ADDRESS (msym);
}
}
extern const char vtbl_ptr_name[];
if ((TYPE_CODE (SYMBOL_TYPE (sym)) == TYPE_CODE_PTR
- && strcmp (DEPRECATED_SYMBOL_NAME (sym), vtbl_ptr_name))
+ && strcmp (SYMBOL_LINKAGE_NAME (sym), vtbl_ptr_name))
|| TYPE_CODE (SYMBOL_TYPE (sym)) == TYPE_CODE_FUNC)
{
/* If we are giving a name to a type such as "pointer to
/* Pascal accepts names for pointer types. */
if (current_subfile->language == language_pascal)
{
- TYPE_NAME (SYMBOL_TYPE (sym)) = DEPRECATED_SYMBOL_NAME (sym);
+ TYPE_NAME (SYMBOL_TYPE (sym)) = SYMBOL_LINKAGE_NAME (sym);
}
}
else
- TYPE_NAME (SYMBOL_TYPE (sym)) = DEPRECATED_SYMBOL_NAME (sym);
+ TYPE_NAME (SYMBOL_TYPE (sym)) = SYMBOL_LINKAGE_NAME (sym);
}
add_symbol_to_list (sym, &file_symbols);
if (TYPE_NAME (SYMBOL_TYPE (sym)) == 0)
TYPE_NAME (SYMBOL_TYPE (sym))
= obconcat (&objfile->objfile_obstack, "", "",
- DEPRECATED_SYMBOL_NAME (sym));
+ SYMBOL_LINKAGE_NAME (sym));
add_symbol_to_list (struct_sym, &file_symbols);
}
SYMBOL_DOMAIN (sym) = STRUCT_DOMAIN;
if (TYPE_TAG_NAME (SYMBOL_TYPE (sym)) == 0)
TYPE_TAG_NAME (SYMBOL_TYPE (sym))
- = obconcat (&objfile->objfile_obstack, "", "", DEPRECATED_SYMBOL_NAME (sym));
+ = obconcat (&objfile->objfile_obstack, "", "",
+ SYMBOL_LINKAGE_NAME (sym));
add_symbol_to_list (sym, &file_symbols);
if (synonym)
SYMBOL_DOMAIN (typedef_sym) = VAR_DOMAIN;
if (TYPE_NAME (SYMBOL_TYPE (sym)) == 0)
TYPE_NAME (SYMBOL_TYPE (sym))
- = obconcat (&objfile->objfile_obstack, "", "", DEPRECATED_SYMBOL_NAME (sym));
+ = obconcat (&objfile->objfile_obstack, "", "",
+ SYMBOL_LINKAGE_NAME (sym));
add_symbol_to_list (typedef_sym, &file_symbols);
}
break;
SYMBOL_VALUE_ADDRESS (sym) = valu;
if (gdbarch_static_transform_name_p (gdbarch)
&& gdbarch_static_transform_name (gdbarch,
- DEPRECATED_SYMBOL_NAME (sym))
- != DEPRECATED_SYMBOL_NAME (sym))
+ SYMBOL_LINKAGE_NAME (sym))
+ != SYMBOL_LINKAGE_NAME (sym))
{
struct minimal_symbol *msym;
- msym = lookup_minimal_symbol (DEPRECATED_SYMBOL_NAME (sym), NULL, objfile);
+ msym = lookup_minimal_symbol (SYMBOL_LINKAGE_NAME (sym), NULL, objfile);
if (msym != NULL)
{
- DEPRECATED_SYMBOL_NAME (sym) = gdbarch_static_transform_name
- (gdbarch,
- DEPRECATED_SYMBOL_NAME (sym));
+ char *new_name = gdbarch_static_transform_name
+ (gdbarch, SYMBOL_LINKAGE_NAME (sym));
+ SYMBOL_SET_LINKAGE_NAME (sym, new_name);
SYMBOL_VALUE_ADDRESS (sym) = SYMBOL_VALUE_ADDRESS (msym);
}
}
if (SYMBOL_CLASS (sym) == LOC_TYPEDEF
&& SYMBOL_DOMAIN (sym) == STRUCT_DOMAIN
&& (TYPE_CODE (SYMBOL_TYPE (sym)) == code)
- && strcmp (DEPRECATED_SYMBOL_NAME (sym), type_name) == 0)
+ && strcmp (SYMBOL_LINKAGE_NAME (sym), type_name) == 0)
{
obstack_free (&objfile->objfile_obstack, type_name);
type = SYMBOL_TYPE (sym);
sym = (struct symbol *)
obstack_alloc (&objfile->objfile_obstack, sizeof (struct symbol));
memset (sym, 0, sizeof (struct symbol));
- DEPRECATED_SYMBOL_NAME (sym) = name;
+ SYMBOL_SET_LINKAGE_NAME (sym, name);
SYMBOL_LANGUAGE (sym) = current_subfile->language;
SYMBOL_CLASS (sym) = LOC_CONST;
SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
{
struct symbol *xsym = syms->symbol[j];
SYMBOL_TYPE (xsym) = type;
- TYPE_FIELD_NAME (type, n) = DEPRECATED_SYMBOL_NAME (xsym);
+ TYPE_FIELD_NAME (type, n) = SYMBOL_LINKAGE_NAME (xsym);
TYPE_FIELD_BITPOS (type, n) = SYMBOL_VALUE (xsym);
TYPE_FIELD_BITSIZE (type, n) = 0;
}
obstack_alloc (&objfile->objfile_obstack, sizeof (struct symbol));
memset (sym, 0, sizeof (struct symbol));
/* Note: common_block_name already saved on objfile_obstack */
- DEPRECATED_SYMBOL_NAME (sym) = common_block_name;
+ SYMBOL_SET_LINKAGE_NAME (sym, common_block_name);
SYMBOL_CLASS (sym) = LOC_BLOCK;
/* Now we copy all the symbols which have been defined since the BCOMM. */
/* Should we be putting local_symbols back to what it was?
Does it matter? */
- i = hashname (DEPRECATED_SYMBOL_NAME (sym));
+ i = hashname (SYMBOL_LINKAGE_NAME (sym));
SYMBOL_VALUE_CHAIN (sym) = global_sym_chain[i];
global_sym_chain[i] = sym;
common_block_name = NULL;
TYPE_CODE (*type))
&& (TYPE_INSTANCE_FLAGS (*type) ==
TYPE_INSTANCE_FLAGS (SYMBOL_TYPE (sym)))
- && strcmp (DEPRECATED_SYMBOL_NAME (sym),
+ && strcmp (SYMBOL_LINKAGE_NAME (sym),
typename) == 0)
replace_type (*type, SYMBOL_TYPE (sym));
}
if (hash >= HASHSIZE)
return;
- for (msymbol = resolve_objfile->msymbols;
- msymbol && DEPRECATED_SYMBOL_NAME (msymbol) != NULL;
- msymbol++)
+ ALL_OBJFILE_MSYMBOLS (resolve_objfile, msymbol)
{
QUIT;
/* Get the hash index and check all the symbols
under that hash index. */
- hash = hashname (DEPRECATED_SYMBOL_NAME (msymbol));
+ hash = hashname (SYMBOL_LINKAGE_NAME (msymbol));
for (sym = global_sym_chain[hash]; sym;)
{
- if (DEPRECATED_SYMBOL_NAME (msymbol)[0] == DEPRECATED_SYMBOL_NAME (sym)[0] &&
- strcmp (DEPRECATED_SYMBOL_NAME (msymbol) + 1, DEPRECATED_SYMBOL_NAME (sym) + 1) == 0)
+ if (strcmp (SYMBOL_LINKAGE_NAME (msymbol),
+ SYMBOL_LINKAGE_NAME (sym)) == 0)
{
/* Splice this symbol out of the hash chain and
assign the value we have to it. */
else
complaint (&symfile_complaints,
_("%s: common block `%s' from global_sym_chain unresolved"),
- objfile->name, DEPRECATED_SYMBOL_NAME (prev));
+ objfile->name, SYMBOL_PRINT_NAME (prev));
}
}
memset (global_sym_chain, 0, sizeof (global_sym_chain));
#include "solib.h"
#include "valprint.h"
#include "gdbthread.h"
+#include "cp-support.h"
#include "gdb_assert.h"
#include <ctype.h>
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
/* 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)
{
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);
+ }
}
}
}
if (msymbol != NULL)
{
- funname = DEPRECATED_SYMBOL_NAME (msymbol);
+ funname = SYMBOL_PRINT_NAME (msymbol);
funlang = SYMBOL_LANGUAGE (msymbol);
}
}
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);
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
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);
}
}
if (count || need_nl)
puts_filtered ("\n");
}
+
+ do_cleanups (back_to);
}
/* Print briefly all stack frames or just the innermost COUNT_EXP
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;
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");
fprintf_filtered (outfile, "No minimal symbols found.\n");
return;
}
- for (index = 0, msymbol = objfile->msymbols;
- DEPRECATED_SYMBOL_NAME (msymbol) != NULL; msymbol++, index++)
+ index = 0;
+ ALL_OBJFILE_MSYMBOLS (objfile, msymbol)
{
switch (msymbol->type)
{
}
fprintf_filtered (outfile, "[%2d] %c ", index, ms_type);
fputs_filtered (paddress (SYMBOL_VALUE_ADDRESS (msymbol)), outfile);
- fprintf_filtered (outfile, " %s", DEPRECATED_SYMBOL_NAME (msymbol));
+ fprintf_filtered (outfile, " %s", SYMBOL_LINKAGE_NAME (msymbol));
if (SYMBOL_BFD_SECTION (msymbol))
fprintf_filtered (outfile, " section %s",
bfd_section_name (objfile->obfd,
if (msymbol->filename)
fprintf_filtered (outfile, " %s", msymbol->filename);
fputs_filtered ("\n", outfile);
+ index++;
}
if (objfile->minimal_symbol_count != index)
{
fputs_filtered (paddress (BLOCK_END (b)), outfile);
if (BLOCK_FUNCTION (b))
{
- fprintf_filtered (outfile, ", function %s", DEPRECATED_SYMBOL_NAME (BLOCK_FUNCTION (b)));
+ fprintf_filtered (outfile, ", function %s",
+ SYMBOL_LINKAGE_NAME (BLOCK_FUNCTION (b)));
if (SYMBOL_DEMANGLED_NAME (BLOCK_FUNCTION (b)) != NULL)
{
fprintf_filtered (outfile, ", %s",
? "enum"
: (TYPE_CODE (SYMBOL_TYPE (symbol)) == TYPE_CODE_STRUCT
? "struct" : "union")),
- DEPRECATED_SYMBOL_NAME (symbol));
+ SYMBOL_LINKAGE_NAME (symbol));
LA_PRINT_TYPE (SYMBOL_TYPE (symbol), "", outfile, 1, depth);
}
fprintf_filtered (outfile, ";\n");
fprintf_filtered (outfile, " %s partial symbols:\n", what);
while (count-- > 0)
{
- fprintf_filtered (outfile, " `%s'", DEPRECATED_SYMBOL_NAME (*p));
+ fprintf_filtered (outfile, " `%s'", SYMBOL_LINKAGE_NAME (*p));
if (SYMBOL_DEMANGLED_NAME (*p) != NULL)
{
fprintf_filtered (outfile, " `%s'", SYMBOL_DEMANGLED_NAME (*p));
length = ps->n_static_syms;
while (length--)
{
- sym = lookup_block_symbol (b, DEPRECATED_SYMBOL_NAME (*psym),
+ sym = lookup_block_symbol (b, SYMBOL_LINKAGE_NAME (*psym),
NULL, SYMBOL_DOMAIN (*psym));
if (!sym)
{
printf_filtered ("Static symbol `");
- puts_filtered (DEPRECATED_SYMBOL_NAME (*psym));
+ puts_filtered (SYMBOL_LINKAGE_NAME (*psym));
printf_filtered ("' only found in ");
puts_filtered (ps->filename);
printf_filtered (" psymtab\n");
length = ps->n_global_syms;
while (length--)
{
- sym = lookup_block_symbol (b, DEPRECATED_SYMBOL_NAME (*psym),
+ sym = lookup_block_symbol (b, SYMBOL_LINKAGE_NAME (*psym),
NULL, SYMBOL_DOMAIN (*psym));
if (!sym)
{
printf_filtered ("Global symbol `");
- puts_filtered (DEPRECATED_SYMBOL_NAME (*psym));
+ puts_filtered (SYMBOL_LINKAGE_NAME (*psym));
printf_filtered ("' only found in ");
puts_filtered (ps->filename);
printf_filtered (" psymtab\n");
functions, unless the callers are changed to pass in the ginfo
field only, instead of the SYMBOL parameter. */
-#define DEPRECATED_SYMBOL_NAME(symbol) (symbol)->ginfo.name
#define SYMBOL_VALUE(symbol) (symbol)->ginfo.value.ivalue
#define SYMBOL_VALUE_ADDRESS(symbol) (symbol)->ginfo.value.address
#define SYMBOL_VALUE_BYTES(symbol) (symbol)->ginfo.value.bytes
extern void symbol_init_language_specific (struct general_symbol_info *symbol,
enum language language);
+/* Set just the linkage name of a symbol; do not try to demangle
+ it. Used for constructs which do not have a mangled name,
+ e.g. struct tags. Unlike SYMBOL_SET_NAMES, linkage_name must
+ be terminated and already on the objfile's obstack. */
+#define SYMBOL_SET_LINKAGE_NAME(symbol,linkage_name) \
+ (symbol)->ginfo.name = (linkage_name)
+
+/* Set the linkage and natural names of a symbol, by demangling
+ the linkage name. */
#define SYMBOL_SET_NAMES(symbol,linkage_name,len,objfile) \
symbol_set_names (&(symbol)->ginfo, linkage_name, len, objfile)
extern void symbol_set_names (struct general_symbol_info *symbol,
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. Don't use
- DEPRECATED_SYMBOL_NAME at all: instances of that macro should be
- replaced by SYMBOL_NATURAL_NAME, SYMBOL_LINKAGE_NAME, or perhaps
- SYMBOL_PRINT_NAME. */
+ SYMBOL_LINKAGE_NAME are different. */
/* Return SYMBOL's "natural" name, i.e. the name that it was called in
the original source code. In languages like C++ where symbols may
/* 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. This is currently identical
- to DEPRECATED_SYMBOL_NAME, but please use SYMBOL_LINKAGE_NAME when
- appropriate: it conveys the additional semantic information that
- you really have thought about the issue and decided that you mean
- SYMBOL_LINKAGE_NAME instead of SYMBOL_NATURAL_NAME. */
+ it's the same as SYMBOL_NATURAL_NAME. */
#define SYMBOL_LINKAGE_NAME(symbol) (symbol)->ginfo.name
/* Save func name as "$trace_func", a debugger variable visible to
users. */
if (traceframe_fun == NULL ||
- DEPRECATED_SYMBOL_NAME (traceframe_fun) == NULL)
+ SYMBOL_LINKAGE_NAME (traceframe_fun) == NULL)
set_internalvar (lookup_internalvar ("trace_func"),
value_from_pointer (charstar, (LONGEST) 0));
else
{
- len = strlen (DEPRECATED_SYMBOL_NAME (traceframe_fun));
+ len = strlen (SYMBOL_LINKAGE_NAME (traceframe_fun));
func_range = create_range_type (func_range,
builtin_type_int, 0, len - 1);
func_string = create_array_type (func_string,
func_val = allocate_value (func_string);
deprecated_set_value_type (func_val, func_string);
memcpy (value_contents_raw (func_val),
- DEPRECATED_SYMBOL_NAME (traceframe_fun),
+ SYMBOL_LINKAGE_NAME (traceframe_fun),
len);
deprecated_set_value_modifiable (func_val, 0);
set_internalvar (lookup_internalvar ("trace_func"), func_val);
if (SYMBOL_CLASS (exp->elts[2].symbol) == LOC_CONST)
{
warning (_("constant %s (value %ld) will not be collected."),
- DEPRECATED_SYMBOL_NAME (exp->elts[2].symbol),
+ SYMBOL_PRINT_NAME (exp->elts[2].symbol),
SYMBOL_VALUE (exp->elts[2].symbol));
return BADLINE;
}
else if (SYMBOL_CLASS (exp->elts[2].symbol) == LOC_OPTIMIZED_OUT)
{
warning (_("%s is optimized away and cannot be collected."),
- DEPRECATED_SYMBOL_NAME (exp->elts[2].symbol));
+ SYMBOL_PRINT_NAME (exp->elts[2].symbol));
return BADLINE;
}
}
{
default:
printf_filtered ("%s: don't know symbol class %d\n",
- DEPRECATED_SYMBOL_NAME (sym),
+ SYMBOL_PRINT_NAME (sym),
SYMBOL_CLASS (sym));
break;
case LOC_CONST:
printf_filtered ("constant %s (value %ld) will not be collected.\n",
- DEPRECATED_SYMBOL_NAME (sym), SYMBOL_VALUE (sym));
+ SYMBOL_PRINT_NAME (sym), SYMBOL_VALUE (sym));
break;
case LOC_STATIC:
offset = SYMBOL_VALUE_ADDRESS (sym);
sprintf_vma (tmp, offset);
printf_filtered ("LOC_STATIC %s: collect %ld bytes at %s.\n",
- DEPRECATED_SYMBOL_NAME (sym), len,
+ SYMBOL_PRINT_NAME (sym), len,
tmp /* address */);
}
add_memrange (collect, memrange_absolute, offset, len);
reg = SYMBOL_VALUE (sym);
if (info_verbose)
printf_filtered ("LOC_REG[parm] %s: ",
- DEPRECATED_SYMBOL_NAME (sym));
+ SYMBOL_PRINT_NAME (sym));
add_register (collect, reg);
/* Check for doubles stored in two registers. */
/* FIXME: how about larger types stored in 3 or more regs? */
case LOC_REF_ARG:
printf_filtered ("Sorry, don't know how to do LOC_REF_ARG yet.\n");
printf_filtered (" (will not collect %s)\n",
- DEPRECATED_SYMBOL_NAME (sym));
+ SYMBOL_PRINT_NAME (sym));
break;
case LOC_ARG:
reg = frame_regno;
if (info_verbose)
{
printf_filtered ("LOC_LOCAL %s: Collect %ld bytes at offset ",
- DEPRECATED_SYMBOL_NAME (sym), len);
+ SYMBOL_PRINT_NAME (sym), len);
printf_vma (offset);
printf_filtered (" from frame ptr reg %d\n", reg);
}
if (info_verbose)
{
printf_filtered ("LOC_REGPARM_ADDR %s: Collect %ld bytes at offset ",
- DEPRECATED_SYMBOL_NAME (sym), len);
+ SYMBOL_PRINT_NAME (sym), len);
printf_vma (offset);
printf_filtered (" from reg %d\n", reg);
}
if (info_verbose)
{
printf_filtered ("LOC_LOCAL %s: Collect %ld bytes at offset ",
- DEPRECATED_SYMBOL_NAME (sym), len);
+ SYMBOL_PRINT_NAME (sym), len);
printf_vma (offset);
printf_filtered (" from frame ptr reg %d\n", reg);
}
break;
case LOC_UNRESOLVED:
printf_filtered ("Don't know LOC_UNRESOLVED %s\n",
- DEPRECATED_SYMBOL_NAME (sym));
+ SYMBOL_PRINT_NAME (sym));
break;
case LOC_OPTIMIZED_OUT:
printf_filtered ("%s has been optimized out of existence.\n",
- DEPRECATED_SYMBOL_NAME (sym));
+ SYMBOL_PRINT_NAME (sym));
break;
}
}
printf_filtered ("Scope for %s:\n", save_args);
count++;
- symname = DEPRECATED_SYMBOL_NAME (sym);
+ symname = SYMBOL_PRINT_NAME (sym);
if (symname == NULL || *symname == '\0')
continue; /* probably botched, certainly useless */
printf_filtered ("%s", paddress (BLOCK_START (SYMBOL_BLOCK_VALUE (sym))));
break;
case LOC_UNRESOLVED:
- msym = lookup_minimal_symbol (DEPRECATED_SYMBOL_NAME (sym),
+ msym = lookup_minimal_symbol (SYMBOL_LINKAGE_NAME (sym),
NULL, NULL);
if (msym == NULL)
printf_filtered ("Unresolved Static");
fprintf_filtered (stream, "typedef ");
type_print (type, "", stream, 0);
if (TYPE_NAME ((SYMBOL_TYPE (new))) == 0
- || strcmp (TYPE_NAME ((SYMBOL_TYPE (new))), DEPRECATED_SYMBOL_NAME (new)) != 0)
+ || strcmp (TYPE_NAME ((SYMBOL_TYPE (new))), SYMBOL_LINKAGE_NAME (new)) != 0)
fprintf_filtered (stream, " %s", SYMBOL_PRINT_NAME (new));
break;
#endif
case language_m2:
fprintf_filtered (stream, "TYPE ");
if (!TYPE_NAME (SYMBOL_TYPE (new))
- || strcmp (TYPE_NAME ((SYMBOL_TYPE (new))), DEPRECATED_SYMBOL_NAME (new)) != 0)
+ || strcmp (TYPE_NAME ((SYMBOL_TYPE (new))), SYMBOL_LINKAGE_NAME (new)) != 0)
fprintf_filtered (stream, "%s = ", SYMBOL_PRINT_NAME (new));
else
fprintf_filtered (stream, "<builtin> = ");
will be patched with the type from its stab entry later on in
patch_block_stabs (), unless the file was compiled without -g. */
- DEPRECATED_SYMBOL_NAME (sym) = SYMNAME_ALLOC (name, symname_alloced);
+ SYMBOL_SET_LINKAGE_NAME (sym, SYMNAME_ALLOC (name, symname_alloced));
SYMBOL_TYPE (sym) = builtin_type (gdbarch)->nodebug_text_symbol;
SYMBOL_CLASS (sym) = LOC_BLOCK;