diff options
author | Christian Biesinger <cbiesinger@google.com> | 2019-11-22 12:05:14 -0600 |
---|---|---|
committer | Christian Biesinger <cbiesinger@google.com> | 2019-11-22 12:05:14 -0600 |
commit | 987012b89bce7f6385ed88585547f852a8005a3f (patch) | |
tree | df68767bc0b073a1e0eb95ba58ba2077fdde83b3 /gdb/stabsread.c | |
parent | c9d95fa3d034ae614e33b631e0bc019015c444e9 (diff) | |
download | fsf-binutils-gdb-987012b89bce7f6385ed88585547f852a8005a3f.zip fsf-binutils-gdb-987012b89bce7f6385ed88585547f852a8005a3f.tar.gz fsf-binutils-gdb-987012b89bce7f6385ed88585547f852a8005a3f.tar.bz2 |
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
Diffstat (limited to 'gdb/stabsread.c')
-rw-r--r-- | gdb/stabsread.c | 62 |
1 files changed, 26 insertions, 36 deletions
diff --git a/gdb/stabsread.c b/gdb/stabsread.c index 0fde120..6ec9f97 100644 --- a/gdb/stabsread.c +++ b/gdb/stabsread.c @@ -629,7 +629,7 @@ stab_reg_to_regnum (struct symbol *sym, struct gdbarch *gdbarch) if (regno < 0 || regno >= gdbarch_num_cooked_regs (gdbarch)) { reg_value_complaint (regno, gdbarch_num_cooked_regs (gdbarch), - SYMBOL_PRINT_NAME (sym)); + sym->print_name ()); regno = gdbarch_sp_regnum (gdbarch); /* Known safe, though useless. */ } @@ -1039,9 +1039,9 @@ 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 minimal symbols when the global_sym_chain is relocated. We'll fixup symbol references when we fixup the defining symbol. */ - if (SYMBOL_LINKAGE_NAME (sym) && SYMBOL_LINKAGE_NAME (sym)[0] != '#') + if (sym->linkage_name () && sym->linkage_name ()[0] != '#') { - i = hashname (SYMBOL_LINKAGE_NAME (sym)); + i = hashname (sym->linkage_name ()); SYMBOL_VALUE_CHAIN (sym) = global_sym_chain[i]; global_sym_chain[i] = sym; } @@ -1142,8 +1142,7 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type, the same name to represent an argument passed in a register. GCC uses 'P' for the same case. So if we find such a symbol pair we combine it into one 'P' symbol. - For Sun cc we need to do this regardless of - stabs_argument_has_addr, because the compiler puts out + For Sun cc we need to do this regardless of stabs_argument_has_addr, because the compiler puts out the 'p' symbol even if it never saves the argument onto the stack. @@ -1168,8 +1167,8 @@ define_symbol (CORE_ADDR valu, const 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 (SYMBOL_LINKAGE_NAME (prev_sym), - SYMBOL_LINKAGE_NAME (sym)) == 0) + && strcmp (prev_sym->linkage_name (), + sym->linkage_name ()) == 0) { SYMBOL_ACLASS_INDEX (prev_sym) = stab_register_index; /* Use the type from the LOC_REGISTER; that is the type @@ -1192,18 +1191,16 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type, SYMBOL_ACLASS_INDEX (sym) = LOC_STATIC; SET_SYMBOL_VALUE_ADDRESS (sym, valu); if (gdbarch_static_transform_name_p (gdbarch) - && gdbarch_static_transform_name (gdbarch, - SYMBOL_LINKAGE_NAME (sym)) - != SYMBOL_LINKAGE_NAME (sym)) + && gdbarch_static_transform_name (gdbarch, sym->linkage_name ()) + != sym->linkage_name ()) { struct bound_minimal_symbol msym; - msym = lookup_minimal_symbol (SYMBOL_LINKAGE_NAME (sym), - NULL, objfile); + msym = lookup_minimal_symbol (sym->linkage_name (), NULL, objfile); if (msym.minsym != NULL) { const char *new_name = gdbarch_static_transform_name - (gdbarch, SYMBOL_LINKAGE_NAME (sym)); + (gdbarch, sym->linkage_name ()); SYMBOL_SET_LINKAGE_NAME (sym, new_name); SET_SYMBOL_VALUE_ADDRESS (sym, @@ -1262,7 +1259,7 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type, if (TYPE_NAME (SYMBOL_TYPE (sym)) == NULL) { if ((TYPE_CODE (SYMBOL_TYPE (sym)) == TYPE_CODE_PTR - && strcmp (SYMBOL_LINKAGE_NAME (sym), vtbl_ptr_name)) + && strcmp (sym->linkage_name (), vtbl_ptr_name)) || TYPE_CODE (SYMBOL_TYPE (sym)) == TYPE_CODE_FUNC) { /* If we are giving a name to a type such as "pointer to @@ -1303,11 +1300,11 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type, /* Pascal accepts names for pointer types. */ if (get_current_subfile ()->language == language_pascal) { - TYPE_NAME (SYMBOL_TYPE (sym)) = SYMBOL_LINKAGE_NAME (sym); + TYPE_NAME (SYMBOL_TYPE (sym)) = sym->linkage_name (); } } else - TYPE_NAME (SYMBOL_TYPE (sym)) = SYMBOL_LINKAGE_NAME (sym); + TYPE_NAME (SYMBOL_TYPE (sym)) = sym->linkage_name (); } add_symbol_to_list (sym, get_file_symbols ()); @@ -1323,8 +1320,7 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type, SYMBOL_DOMAIN (struct_sym) = STRUCT_DOMAIN; if (TYPE_NAME (SYMBOL_TYPE (sym)) == 0) TYPE_NAME (SYMBOL_TYPE (sym)) - = obconcat (&objfile->objfile_obstack, - SYMBOL_LINKAGE_NAME (sym), + = obconcat (&objfile->objfile_obstack, sym->linkage_name (), (char *) NULL); add_symbol_to_list (struct_sym, get_file_symbols ()); } @@ -1351,8 +1347,7 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type, SYMBOL_DOMAIN (sym) = STRUCT_DOMAIN; if (TYPE_NAME (SYMBOL_TYPE (sym)) == 0) TYPE_NAME (SYMBOL_TYPE (sym)) - = obconcat (&objfile->objfile_obstack, - SYMBOL_LINKAGE_NAME (sym), + = obconcat (&objfile->objfile_obstack, sym->linkage_name (), (char *) NULL); add_symbol_to_list (sym, get_file_symbols ()); @@ -1367,8 +1362,7 @@ define_symbol (CORE_ADDR valu, const 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, - SYMBOL_LINKAGE_NAME (sym), + = obconcat (&objfile->objfile_obstack, sym->linkage_name (), (char *) NULL); add_symbol_to_list (typedef_sym, get_file_symbols ()); } @@ -1380,18 +1374,16 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type, SYMBOL_ACLASS_INDEX (sym) = LOC_STATIC; SET_SYMBOL_VALUE_ADDRESS (sym, valu); if (gdbarch_static_transform_name_p (gdbarch) - && gdbarch_static_transform_name (gdbarch, - SYMBOL_LINKAGE_NAME (sym)) - != SYMBOL_LINKAGE_NAME (sym)) + && gdbarch_static_transform_name (gdbarch, sym->linkage_name ()) + != sym->linkage_name ()) { struct bound_minimal_symbol msym; - msym = lookup_minimal_symbol (SYMBOL_LINKAGE_NAME (sym), - NULL, objfile); + msym = lookup_minimal_symbol (sym->linkage_name (), NULL, objfile); if (msym.minsym != NULL) { const char *new_name = gdbarch_static_transform_name - (gdbarch, SYMBOL_LINKAGE_NAME (sym)); + (gdbarch, sym->linkage_name ()); SYMBOL_SET_LINKAGE_NAME (sym, new_name); SET_SYMBOL_VALUE_ADDRESS (sym, BMSYMBOL_VALUE_ADDRESS (msym)); @@ -1684,7 +1676,7 @@ again: if (SYMBOL_CLASS (sym) == LOC_TYPEDEF && SYMBOL_DOMAIN (sym) == STRUCT_DOMAIN && (TYPE_CODE (SYMBOL_TYPE (sym)) == code) - && strcmp (SYMBOL_LINKAGE_NAME (sym), type_name) == 0) + && strcmp (sym->linkage_name (), type_name) == 0) { obstack_free (&objfile->objfile_obstack, type_name); type = SYMBOL_TYPE (sym); @@ -3692,7 +3684,7 @@ read_enum_type (const char **pp, struct type *type, struct symbol *xsym = syms->symbol[j]; SYMBOL_TYPE (xsym) = type; - TYPE_FIELD_NAME (type, n) = SYMBOL_LINKAGE_NAME (xsym); + TYPE_FIELD_NAME (type, n) = xsym->linkage_name (); SET_FIELD_ENUMVAL (TYPE_FIELD (type, n), SYMBOL_VALUE (xsym)); TYPE_FIELD_BITSIZE (type, n) = 0; } @@ -4341,7 +4333,7 @@ common_block_end (struct objfile *objfile) /* Should we be putting local_symbols back to what it was? Does it matter? */ - i = hashname (SYMBOL_LINKAGE_NAME (sym)); + i = hashname (sym->linkage_name ()); SYMBOL_VALUE_CHAIN (sym) = global_sym_chain[i]; global_sym_chain[i] = sym; common_block_name = NULL; @@ -4527,8 +4519,7 @@ cleanup_undefined_types_1 (void) TYPE_CODE (*type)) && (TYPE_INSTANCE_FLAGS (*type) == TYPE_INSTANCE_FLAGS (SYMBOL_TYPE (sym))) - && strcmp (SYMBOL_LINKAGE_NAME (sym), - type_name) == 0) + && strcmp (sym->linkage_name (), type_name) == 0) replace_type (*type, SYMBOL_TYPE (sym)); } } @@ -4614,8 +4605,7 @@ scan_file_globals (struct objfile *objfile) for (sym = global_sym_chain[hash]; sym;) { - if (strcmp (msymbol->linkage_name (), - SYMBOL_LINKAGE_NAME (sym)) == 0) + if (strcmp (msymbol->linkage_name (), sym->linkage_name ()) == 0) { /* Splice this symbol out of the hash chain and assign the value we have to it. */ @@ -4689,7 +4679,7 @@ scan_file_globals (struct objfile *objfile) else complaint (_("%s: common block `%s' from " "global_sym_chain unresolved"), - objfile_name (objfile), SYMBOL_PRINT_NAME (prev)); + objfile_name (objfile), prev->print_name ()); } } memset (global_sym_chain, 0, sizeof (global_sym_chain)); |