aboutsummaryrefslogtreecommitdiff
path: root/gdb/stabsread.c
diff options
context:
space:
mode:
authorDaniel Jacobowitz <drow@false.org>2008-08-21 18:14:39 +0000
committerDaniel Jacobowitz <drow@false.org>2008-08-21 18:14:39 +0000
commit3567439cdefa9f2340bae3fbb068780923934865 (patch)
tree4bbcd2dbca60884715d795f442ca09af87d4da1d /gdb/stabsread.c
parentc22a967f855f76192c4053ee196067cd74aa0ecf (diff)
downloadgdb-3567439cdefa9f2340bae3fbb068780923934865.zip
gdb-3567439cdefa9f2340bae3fbb068780923934865.tar.gz
gdb-3567439cdefa9f2340bae3fbb068780923934865.tar.bz2
* 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.
Diffstat (limited to 'gdb/stabsread.c')
-rw-r--r--gdb/stabsread.c86
1 files changed, 44 insertions, 42 deletions
diff --git a/gdb/stabsread.c b/gdb/stabsread.c
index e9580f9..110f937 100644
--- a/gdb/stabsread.c
+++ b/gdb/stabsread.c
@@ -387,8 +387,9 @@ patch_block_stabs (struct pending *symbols, struct pending_stabs *stabs,
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')
{
@@ -648,17 +649,18 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type,
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 '_':
@@ -892,9 +894,9 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type,
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;
}
@@ -1038,8 +1040,8 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type,
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
@@ -1063,16 +1065,16 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int 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);
}
}
@@ -1132,7 +1134,7 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type,
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
@@ -1172,11 +1174,11 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type,
/* 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);
@@ -1194,7 +1196,7 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type,
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);
}
@@ -1220,7 +1222,8 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type,
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)
@@ -1234,7 +1237,8 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type,
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;
@@ -1246,16 +1250,16 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int 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);
}
}
@@ -1539,7 +1543,7 @@ again:
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);
@@ -3488,7 +3492,7 @@ read_enum_type (char **pp, struct type *type,
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;
@@ -3530,7 +3534,7 @@ read_enum_type (char **pp, struct type *type,
{
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;
}
@@ -4145,7 +4149,7 @@ common_block_end (struct objfile *objfile)
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. */
@@ -4172,7 +4176,7 @@ common_block_end (struct objfile *objfile)
/* 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;
@@ -4354,7 +4358,7 @@ cleanup_undefined_types_1 (void)
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));
}
@@ -4421,9 +4425,7 @@ scan_file_globals (struct objfile *objfile)
if (hash >= HASHSIZE)
return;
- for (msymbol = resolve_objfile->msymbols;
- msymbol && DEPRECATED_SYMBOL_NAME (msymbol) != NULL;
- msymbol++)
+ ALL_OBJFILE_MSYMBOLS (resolve_objfile, msymbol)
{
QUIT;
@@ -4443,12 +4445,12 @@ scan_file_globals (struct objfile *objfile)
/* 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. */
@@ -4520,7 +4522,7 @@ scan_file_globals (struct objfile *objfile)
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));