From: Simon Marchi Date: Thu, 14 Aug 2025 20:14:06 +0000 (-0400) Subject: gdb: rename address_class -> location_class X-Git-Tag: gdb-17-branchpoint~248 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4260abb7a700d1c7491648c695ea6bfdff21a432;p=thirdparty%2Fbinutils-gdb.git gdb: rename address_class -> location_class The enum address_class and related fields and methods seem misnamed to me. Generalize it to "location_class". The enumerators in address_class are already prefixed with LOC, so the new name seems logical to me. Rename related fields and methods as well. Plus, address_class could easily be mistaken for other unrelated things named "address class" in GDB or DWARF. Tested by rebuilding. Change-Id: I0dca3738df412b350715286c608041b08e9b4d82 Approved-by: Kevin Buettner --- diff --git a/gdb/ada-exp.y b/gdb/ada-exp.y index 1546ae950b0..7ac103de61c 100644 --- a/gdb/ada-exp.y +++ b/gdb/ada-exp.y @@ -1338,7 +1338,7 @@ write_object_renaming (struct parser_state *par_state, SEARCH_VFT); if (sym_info.symbol == NULL) error (_("Could not find renamed variable: %s"), ada_decode (name).c_str ()); - else if (sym_info.symbol->aclass () == LOC_TYPEDEF) + else if (sym_info.symbol->loc_class () == LOC_TYPEDEF) /* We have a renaming of an old-style renaming symbol. Don't trust the block information. */ sym_info.block = orig_left_context; @@ -1408,7 +1408,7 @@ write_object_renaming (struct parser_state *par_state, SEARCH_VFT); if (index_sym_info.symbol == NULL) error (_("Could not find %s"), index_name); - else if (index_sym_info.symbol->aclass () == LOC_TYPEDEF) + else if (index_sym_info.symbol->loc_class () == LOC_TYPEDEF) /* Index is an old-style renaming symbol. */ index_sym_info.block = orig_left_context; write_var_from_sym (par_state, index_sym_info); @@ -1478,14 +1478,14 @@ block_lookup (const struct block *context, const char *raw_name) = ada_lookup_symbol_list (name, context, SEARCH_FUNCTION_DOMAIN); if (context == NULL - && (syms.empty () || syms[0].symbol->aclass () != LOC_BLOCK)) + && (syms.empty () || syms[0].symbol->loc_class () != LOC_BLOCK)) symtab = lookup_symtab (current_program_space, name); else symtab = NULL; if (symtab != NULL) result = symtab->compunit ()->blockvector ()->static_block (); - else if (syms.empty () || syms[0].symbol->aclass () != LOC_BLOCK) + else if (syms.empty () || syms[0].symbol->loc_class () != LOC_BLOCK) { if (context == NULL) error (_("No file or function \"%s\"."), raw_name); @@ -1511,7 +1511,7 @@ select_possible_type_sym (const std::vector &syms) preferred_index = -1; preferred_type = NULL; for (i = 0; i < syms.size (); i += 1) - switch (syms[i].symbol->aclass ()) + switch (syms[i].symbol->loc_class ()) { case LOC_TYPEDEF: if (ada_prefer_type (syms[i].symbol->type (), preferred_type)) @@ -1555,7 +1555,7 @@ find_primitive_type (struct parser_state *par_state, const char *name) strcpy (expanded_name, "standard__"); strcat (expanded_name, name); sym = ada_lookup_symbol (expanded_name, NULL, SEARCH_TYPE_DOMAIN).symbol; - if (sym != NULL && sym->aclass () == LOC_TYPEDEF) + if (sym != NULL && sym->loc_class () == LOC_TYPEDEF) type = sym->type (); } @@ -1966,7 +1966,7 @@ write_name_assoc (struct parser_state *par_state, struct stoken name) par_state->expression_context_block, SEARCH_VFT); - if (syms.size () != 1 || syms[0].symbol->aclass () == LOC_TYPEDEF) + if (syms.size () != 1 || syms[0].symbol->loc_class () == LOC_TYPEDEF) pstate->push_new (copy_name (name)); else write_var_from_sym (par_state, syms[0]); diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c index 1955169eca6..74ac3e32b8b 100644 --- a/gdb/ada-lang.c +++ b/gdb/ada-lang.c @@ -3637,7 +3637,7 @@ See set/show multiple-symbol.")); if (syms[i].symbol == NULL) continue; - if (syms[i].symbol->aclass () == LOC_BLOCK) + if (syms[i].symbol->loc_class () == LOC_BLOCK) { struct symtab_and_line sal = find_function_start_sal (syms[i].symbol, 1); @@ -3659,7 +3659,7 @@ See set/show multiple-symbol.")); else { int is_enumeral = - (syms[i].symbol->aclass () == LOC_CONST + (syms[i].symbol->loc_class () == LOC_CONST && syms[i].symbol->type () != NULL && syms[i].symbol->type ()->code () == TYPE_CODE_ENUM); struct symtab *symtab = NULL; @@ -3822,7 +3822,7 @@ ada_resolve_variable (struct symbol *sym, const struct block *block, candidates.end (), [] (block_symbol &bsym) { - switch (bsym.symbol->aclass ()) + switch (bsym.symbol->loc_class ()) { case LOC_REGISTER: case LOC_ARG: @@ -3845,7 +3845,7 @@ ada_resolve_variable (struct symbol *sym, const struct block *block, candidates.end (), [] (block_symbol &bsym) { - return bsym.symbol->aclass () == LOC_TYPEDEF; + return bsym.symbol->loc_class () == LOC_TYPEDEF; }), candidates.end ()); } @@ -4000,7 +4000,7 @@ ada_args_match (struct symbol *func, struct value **actuals, int n_actuals) int i; struct type *func_type = func->type (); - if (func->aclass () == LOC_CONST + if (func->loc_class () == LOC_CONST && func_type->code () == TYPE_CODE_ENUM) return (n_actuals == 0); else if (func_type == NULL || func_type->code () != TYPE_CODE_FUNC) @@ -4310,7 +4310,7 @@ ada_parse_renaming (struct symbol *sym, if (sym == NULL) return ADA_NOT_RENAMING; - switch (sym->aclass ()) + switch (sym->loc_class ()) { default: return ADA_NOT_RENAMING; @@ -4776,7 +4776,7 @@ is_nonfunction (const std::vector &syms) for (const block_symbol &sym : syms) if (sym.symbol->type ()->code () != TYPE_CODE_FUNC && (sym.symbol->type ()->code () != TYPE_CODE_ENUM - || sym.symbol->aclass () != LOC_CONST)) + || sym.symbol->loc_class () != LOC_CONST)) return 1; return 0; @@ -4811,10 +4811,10 @@ lesseq_defined_than (struct symbol *sym0, struct symbol *sym1) if (sym0 == sym1) return 1; if (sym0->domain () != sym1->domain () - || sym0->aclass () != sym1->aclass ()) + || sym0->loc_class () != sym1->loc_class ()) return 0; - switch (sym0->aclass ()) + switch (sym0->loc_class ()) { case LOC_UNDEF: return 1; @@ -5069,7 +5069,7 @@ remove_extra_symbols (std::vector &syms) should be identical. */ else if (syms[i].symbol->linkage_name () != NULL - && syms[i].symbol->aclass () == LOC_STATIC + && syms[i].symbol->loc_class () == LOC_STATIC && is_nondebugging_type (syms[i].symbol->type ())) { for (j = 0; !remove_p && j < syms.size (); j += 1) @@ -5078,8 +5078,8 @@ remove_extra_symbols (std::vector &syms) && syms[j].symbol->linkage_name () != NULL && strcmp (syms[i].symbol->linkage_name (), syms[j].symbol->linkage_name ()) == 0 - && (syms[i].symbol->aclass () - == syms[j].symbol->aclass ()) + && (syms[i].symbol->loc_class () + == syms[j].symbol->loc_class ()) && syms[i].symbol->value_address () == syms[j].symbol->value_address ()) remove_p = true; @@ -5088,12 +5088,12 @@ remove_extra_symbols (std::vector &syms) /* Two functions with the same block are identical. */ - else if (syms[i].symbol->aclass () == LOC_BLOCK) + else if (syms[i].symbol->loc_class () == LOC_BLOCK) { for (j = 0; !remove_p && j < syms.size (); j += 1) { if (i != j - && syms[j].symbol->aclass () == LOC_BLOCK + && syms[j].symbol->loc_class () == LOC_BLOCK && (syms[i].symbol->value_block () == syms[j].symbol->value_block ())) remove_p = true; @@ -5170,7 +5170,7 @@ is_package_name (const char *name) static int old_renaming_is_invisible (const struct symbol *sym, const char *function_name) { - if (sym->aclass () != LOC_TYPEDEF) + if (sym->loc_class () != LOC_TYPEDEF) return 0; std::string scope = xget_renaming_scope (sym->type ()); @@ -5249,7 +5249,7 @@ remove_irrelevant_renamings (std::vector *syms, const char *name; const char *suffix; - if (sym == NULL || sym->aclass () == LOC_TYPEDEF) + if (sym == NULL || sym->loc_class () == LOC_TYPEDEF) continue; name = sym->linkage_name (); suffix = strstr (name, "___XR"); @@ -5374,7 +5374,7 @@ match_data::operator() (struct block_symbol *bsym) } else { - if (sym->aclass () == LOC_UNRESOLVED) + if (sym->loc_class () == LOC_UNRESOLVED) return true; else if (sym->is_argument ()) arg_sym = sym; @@ -5979,7 +5979,7 @@ ada_add_block_symbols (std::vector &result, { if (sym->matches (domain)) { - if (sym->aclass () != LOC_UNRESOLVED) + if (sym->loc_class () != LOC_UNRESOLVED) { if (sym->is_argument ()) arg_sym = sym; @@ -6028,7 +6028,7 @@ ada_add_block_symbols (std::vector &result, if (cmp == 0 && is_name_suffix (sym->linkage_name () + name_len + 5)) { - if (sym->aclass () != LOC_UNRESOLVED) + if (sym->loc_class () != LOC_UNRESOLVED) { if (sym->is_argument ()) arg_sym = sym; @@ -11707,9 +11707,9 @@ ada_has_this_exception_support (const struct exception_support_info *einfo) /* Make sure that the symbol we found corresponds to a function. */ - if (sym->aclass () != LOC_BLOCK) + if (sym->loc_class () != LOC_BLOCK) error (_("Symbol \"%s\" is not a function (class = %d)"), - sym->linkage_name (), sym->aclass ()); + sym->linkage_name (), sym->loc_class ()); sym = standard_lookup (einfo->catch_handlers_sym, NULL, SEARCH_FUNCTION_DOMAIN); @@ -11729,9 +11729,9 @@ ada_has_this_exception_support (const struct exception_support_info *einfo) /* Make sure that the symbol we found corresponds to a function. */ - if (sym->aclass () != LOC_BLOCK) + if (sym->loc_class () != LOC_BLOCK) error (_("Symbol \"%s\" is not a function (class = %d)"), - sym->linkage_name (), sym->aclass ()); + sym->linkage_name (), sym->loc_class ()); return 1; } @@ -12686,7 +12686,7 @@ ada_exception_sal (enum ada_exception_catchpoint_kind ex) throw_error (NOT_FOUND_ERROR, _("Catchpoint symbol not found: %s"), sym_name); - if (sym->aclass () != LOC_BLOCK) + if (sym->loc_class () != LOC_BLOCK) error (_("Unable to insert catchpoint. %s is not a function."), sym_name); return find_function_start_sal (sym, 1); @@ -12852,10 +12852,10 @@ ada_is_exception_sym (struct symbol *sym) { const char *type_name = sym->type ()->name (); - return (sym->aclass () != LOC_TYPEDEF - && sym->aclass () != LOC_BLOCK - && sym->aclass () != LOC_CONST - && sym->aclass () != LOC_UNRESOLVED + return (sym->loc_class () != LOC_TYPEDEF + && sym->loc_class () != LOC_BLOCK + && sym->loc_class () != LOC_CONST + && sym->loc_class () != LOC_UNRESOLVED && type_name != NULL && strcmp (type_name, "exception") == 0); } @@ -12988,7 +12988,7 @@ ada_add_exceptions_from_frame (compiled_regex *preg, { for (struct symbol *sym : block_iterator_range (block)) { - switch (sym->aclass ()) + switch (sym->loc_class ()) { case LOC_TYPEDEF: case LOC_BLOCK: diff --git a/gdb/ax-gdb.c b/gdb/ax-gdb.c index 57626ab210e..54717bf2a80 100644 --- a/gdb/ax-gdb.c +++ b/gdb/ax-gdb.c @@ -525,7 +525,7 @@ gen_var_ref (struct agent_expr *ax, struct axs_value *value, struct symbol *var) return computed_ops->tracepoint_var_ref (var, ax, value); /* I'm imitating the code in read_var_value. */ - switch (var->aclass ()) + switch (var->loc_class ()) { case LOC_CONST: /* A constant, like an enum value. */ ax_const_l (ax, (LONGEST) var->value_longest ()); diff --git a/gdb/block.c b/gdb/block.c index 1866c0f7ab9..5ed253418fd 100644 --- a/gdb/block.c +++ b/gdb/block.c @@ -618,7 +618,7 @@ block_iterator_next (struct block_iterator *iterator) bool best_symbol (struct symbol *a, const domain_search_flags domain) { - if (a->aclass () == LOC_UNRESOLVED) + if (a->loc_class () == LOC_UNRESOLVED) return false; if ((domain & SEARCH_VAR_DOMAIN) != 0) @@ -644,10 +644,10 @@ better_symbol (struct symbol *a, struct symbol *b, if (b->matches (domain) && !a->matches (domain)) return b; - if (a->aclass () != LOC_UNRESOLVED && b->aclass () == LOC_UNRESOLVED) + if (a->loc_class () != LOC_UNRESOLVED && b->loc_class () == LOC_UNRESOLVED) return a; - if (b->aclass () != LOC_UNRESOLVED && a->aclass () == LOC_UNRESOLVED) + if (b->loc_class () != LOC_UNRESOLVED && a->loc_class () == LOC_UNRESOLVED) return b; return a; diff --git a/gdb/c-exp.y b/gdb/c-exp.y index 14d4b704ff1..8c6e4609c0b 100644 --- a/gdb/c-exp.y +++ b/gdb/c-exp.y @@ -3046,7 +3046,7 @@ classify_name (struct parser_state *par_state, const struct block *block, par_state->language ()->name_of_this () ? &is_a_field_of_this : NULL); - if (bsym.symbol && bsym.symbol->aclass () == LOC_BLOCK) + if (bsym.symbol && bsym.symbol->loc_class () == LOC_BLOCK) { yylval.ssym.sym = bsym; yylval.ssym.is_a_field_of_this = is_a_field_of_this.type != NULL; @@ -3094,7 +3094,7 @@ classify_name (struct parser_state *par_state, const struct block *block, } } - if (bsym.symbol && bsym.symbol->aclass () == LOC_TYPEDEF) + if (bsym.symbol && bsym.symbol->loc_class () == LOC_TYPEDEF) { yylval.tsym.type = bsym.symbol->type (); return TYPENAME; @@ -3189,7 +3189,7 @@ classify_inner_name (struct parser_state *par_state, return ERROR; } - switch (yylval.ssym.sym.symbol->aclass ()) + switch (yylval.ssym.sym.symbol->loc_class ()) { case LOC_BLOCK: case LOC_LABEL: diff --git a/gdb/c-typeprint.c b/gdb/c-typeprint.c index b6b3f6b778b..be19987ea53 100644 --- a/gdb/c-typeprint.c +++ b/gdb/c-typeprint.c @@ -814,7 +814,7 @@ c_type_print_template_args (const struct type_print_options *flags, { struct symbol *sym = TYPE_TEMPLATE_ARGUMENT (type, i); - if (sym->aclass () != LOC_TYPEDEF) + if (sym->loc_class () != LOC_TYPEDEF) continue; if (first) diff --git a/gdb/coffread.c b/gdb/coffread.c index db18c43a505..b69c06f381d 100644 --- a/gdb/coffread.c +++ b/gdb/coffread.c @@ -1567,7 +1567,7 @@ patch_opaque_types (struct symtab *s) Remove syms from the chain when their types are stored, but search the whole chain, as there may be several syms from different files with the same name. */ - if (real_sym->aclass () == LOC_TYPEDEF + if (real_sym->loc_class () == LOC_TYPEDEF && real_sym->domain () == TYPE_DOMAIN && real_sym->type ()->code () == TYPE_CODE_PTR && real_sym->type ()->target_type ()->length () != 0) @@ -1614,7 +1614,7 @@ static const struct symbol_register_ops coff_register_funcs = { coff_reg_to_regnum }; -/* The "aclass" index for computed COFF symbols. */ +/* The "loc_class" index for computed COFF symbols. */ static int coff_register_index; @@ -1646,7 +1646,7 @@ process_coff_symbol (struct coff_symbol *cs, (lookup_function_type (decode_function_type (cs, cs->c_type, aux, objfile))); - sym->set_aclass_index (LOC_BLOCK); + sym->set_loc_class_index (LOC_BLOCK); if (cs->c_sclass == C_STAT || cs->c_sclass == C_THUMBSTAT || cs->c_sclass == C_THUMBSTATFUNC) add_symbol_to_list (sym, get_file_symbols ()); @@ -1663,14 +1663,14 @@ process_coff_symbol (struct coff_symbol *cs, break; case C_AUTO: - sym->set_aclass_index (LOC_LOCAL); + sym->set_loc_class_index (LOC_LOCAL); add_symbol_to_list (sym, get_local_symbols ()); break; case C_THUMBEXT: case C_THUMBEXTFUNC: case C_EXT: - sym->set_aclass_index (LOC_STATIC); + sym->set_loc_class_index (LOC_STATIC); sym->set_value_address ((CORE_ADDR) cs->c_value + objfile->section_offsets[SECT_OFF_TEXT (objfile)]); add_symbol_to_list (sym, get_global_symbols ()); @@ -1679,7 +1679,7 @@ process_coff_symbol (struct coff_symbol *cs, case C_THUMBSTAT: case C_THUMBSTATFUNC: case C_STAT: - sym->set_aclass_index (LOC_STATIC); + sym->set_loc_class_index (LOC_STATIC); sym->set_value_address ((CORE_ADDR) cs->c_value + objfile->section_offsets[SECT_OFF_TEXT (objfile)]); if (within_function) @@ -1698,7 +1698,7 @@ process_coff_symbol (struct coff_symbol *cs, case C_GLBLREG: #endif case C_REG: - sym->set_aclass_index (coff_register_index); + sym->set_loc_class_index (coff_register_index); sym->set_value_longest (cs->c_value); add_symbol_to_list (sym, get_local_symbols ()); break; @@ -1708,20 +1708,20 @@ process_coff_symbol (struct coff_symbol *cs, break; case C_ARG: - sym->set_aclass_index (LOC_ARG); + sym->set_loc_class_index (LOC_ARG); sym->set_is_argument (1); add_symbol_to_list (sym, get_local_symbols ()); break; case C_REGPARM: - sym->set_aclass_index (coff_register_index); + sym->set_loc_class_index (coff_register_index); sym->set_is_argument (1); sym->set_value_longest (cs->c_value); add_symbol_to_list (sym, get_local_symbols ()); break; case C_TPDEF: - sym->set_aclass_index (LOC_TYPEDEF); + sym->set_loc_class_index (LOC_TYPEDEF); sym->set_domain (TYPE_DOMAIN); /* If type has no name, give it one. */ @@ -1776,7 +1776,7 @@ process_coff_symbol (struct coff_symbol *cs, case C_STRTAG: case C_UNTAG: case C_ENTAG: - sym->set_aclass_index (LOC_TYPEDEF); + sym->set_loc_class_index (LOC_TYPEDEF); sym->set_domain (STRUCT_DOMAIN); /* Some compilers try to be helpful by inventing "fake" @@ -2165,7 +2165,7 @@ coff_read_enum_type (int index, int length, int lastsym, name = obstack_strdup (&objfile->objfile_obstack, name); sym->set_linkage_name (name); - sym->set_aclass_index (LOC_CONST); + sym->set_loc_class_index (LOC_CONST); sym->set_domain (VAR_DOMAIN); sym->set_value_longest (ms->c_value); add_symbol_to_list (sym, symlist); diff --git a/gdb/compile/compile-c-symbols.c b/gdb/compile/compile-c-symbols.c index b31592fbb1a..65789775fc4 100644 --- a/gdb/compile/compile-c-symbols.c +++ b/gdb/compile/compile-c-symbols.c @@ -61,7 +61,7 @@ convert_one_symbol (compile_c_instance *context, context->error_symbol_once (sym.symbol); - if (sym.symbol->aclass () == LOC_LABEL) + if (sym.symbol->loc_class () == LOC_LABEL) sym_type = 0; else sym_type = context->convert_type (sym.symbol->type ()); @@ -79,7 +79,7 @@ convert_one_symbol (compile_c_instance *context, CORE_ADDR addr = 0; gdb::unique_xmalloc_ptr symbol_name; - switch (sym.symbol->aclass ()) + switch (sym.symbol->loc_class ()) { case LOC_TYPEDEF: kind = GCC_C_SYMBOL_TYPEDEF; @@ -536,7 +536,7 @@ generate_c_for_for_one_variable (compile_instance *compiler, } else { - switch (sym->aclass ()) + switch (sym->loc_class ()) { case LOC_REGISTER: case LOC_ARG: diff --git a/gdb/compile/compile-cplus-symbols.c b/gdb/compile/compile-cplus-symbols.c index b03c4b9d618..96ebd84887a 100644 --- a/gdb/compile/compile-cplus-symbols.c +++ b/gdb/compile/compile-cplus-symbols.c @@ -53,7 +53,7 @@ convert_one_symbol (compile_cplus_instance *instance, instance->error_symbol_once (sym.symbol); - if (sym.symbol->aclass () == LOC_LABEL) + if (sym.symbol->loc_class () == LOC_LABEL) sym_type = 0; else sym_type = instance->convert_type (sym.symbol->type ()); @@ -70,7 +70,7 @@ convert_one_symbol (compile_cplus_instance *instance, std::string name; gdb::unique_xmalloc_ptr symbol_name; - switch (sym.symbol->aclass ()) + switch (sym.symbol->loc_class ()) { case LOC_TYPEDEF: if (sym.symbol->type ()->code () == TYPE_CODE_TYPEDEF) diff --git a/gdb/cp-support.c b/gdb/cp-support.c index cab711051dc..8f5c0d1dd45 100644 --- a/gdb/cp-support.c +++ b/gdb/cp-support.c @@ -1518,7 +1518,7 @@ cp_lookup_rtti_type (const char *name, const struct block *block) return NULL; } - if (rtti_sym->aclass () != LOC_TYPEDEF) + if (rtti_sym->loc_class () != LOC_TYPEDEF) { warning (_("RTTI symbol for class '%s' is not a type"), name); return NULL; diff --git a/gdb/ctfread.c b/gdb/ctfread.c index e568f159e3d..76de16ccc21 100644 --- a/gdb/ctfread.c +++ b/gdb/ctfread.c @@ -328,7 +328,7 @@ set_symbol_address (struct objfile *of, struct symbol *sym, const char *name) if (msym.minsym != NULL) { sym->set_value_address (msym.value_address ()); - sym->set_aclass_index (LOC_STATIC); + sym->set_loc_class_index (LOC_STATIC); sym->set_section_index (msym.minsym->section_index ()); } } @@ -447,7 +447,7 @@ ctf_add_enum_member_cb (const char *name, int enum_value, void *arg) sym->set_language (language_c, &ccp->of->objfile_obstack); sym->compute_and_set_names (name, false, ccp->of->per_bfd); - sym->set_aclass_index (LOC_CONST); + sym->set_loc_class_index (LOC_CONST); sym->set_domain (VAR_DOMAIN); sym->set_type (fip->ptype); add_symbol_to_list (sym, ccp->builder->get_global_symbols ()); @@ -477,7 +477,7 @@ new_symbol (struct ctf_context *ccp, struct type *type, ctf_id_t tid) sym->set_language (language_c, &objfile->objfile_obstack); sym->compute_and_set_names (name, false, objfile->per_bfd); sym->set_domain (VAR_DOMAIN); - sym->set_aclass_index (LOC_OPTIMIZED_OUT); + sym->set_loc_class_index (LOC_OPTIMIZED_OUT); if (type != nullptr) sym->set_type (type); @@ -488,11 +488,11 @@ new_symbol (struct ctf_context *ccp, struct type *type, ctf_id_t tid) case CTF_K_STRUCT: case CTF_K_UNION: case CTF_K_ENUM: - sym->set_aclass_index (LOC_TYPEDEF); + sym->set_loc_class_index (LOC_TYPEDEF); sym->set_domain (STRUCT_DOMAIN); break; case CTF_K_FUNCTION: - sym->set_aclass_index (LOC_STATIC); + sym->set_loc_class_index (LOC_STATIC); set_symbol_address (objfile, sym, sym->linkage_name ()); break; case CTF_K_CONST: @@ -502,7 +502,7 @@ new_symbol (struct ctf_context *ccp, struct type *type, ctf_id_t tid) case CTF_K_TYPEDEF: case CTF_K_INTEGER: case CTF_K_FLOAT: - sym->set_aclass_index (LOC_TYPEDEF); + sym->set_loc_class_index (LOC_TYPEDEF); sym->set_domain (TYPE_DOMAIN); break; case CTF_K_POINTER: @@ -1169,7 +1169,7 @@ ctf_add_var_cb (const char *name, ctf_id_t id, void *arg) OBJSTAT (ccp->of, n_syms++); sym->set_type (type); sym->set_domain (VAR_DOMAIN); - sym->set_aclass_index (LOC_OPTIMIZED_OUT); + sym->set_loc_class_index (LOC_OPTIMIZED_OUT); sym->compute_and_set_names (name, false, ccp->of->per_bfd); add_symbol_to_list (sym, ccp->builder->get_file_symbols ()); break; @@ -1205,7 +1205,7 @@ add_stt_entries (struct ctf_context *ccp, int functions) OBJSTAT (ccp->of, n_syms++); sym->set_type (type); sym->set_domain (VAR_DOMAIN); - sym->set_aclass_index (LOC_STATIC); + sym->set_loc_class_index (LOC_STATIC); sym->compute_and_set_names (tname, false, ccp->of->per_bfd); add_symbol_to_list (sym, ccp->builder->get_global_symbols ()); set_symbol_address (ccp->of, sym, tname); @@ -1309,7 +1309,7 @@ ctf_psymtab_add_stt_entries (ctf_dict_t *cfp, ctf_psymtab *pst, while ((tid = ctf_symbol_next (cfp, &i, &tname, functions)) != CTF_ERR) { uint32_t kind = ctf_type_kind (cfp, tid); - address_class aclass; + location_class loc_class; domain_enum tdomain; switch (kind) { @@ -1324,14 +1324,14 @@ ctf_psymtab_add_stt_entries (ctf_dict_t *cfp, ctf_psymtab *pst, } if (kind == CTF_K_FUNCTION) - aclass = LOC_STATIC; + loc_class = LOC_STATIC; else if (kind == CTF_K_CONST) - aclass = LOC_CONST; + loc_class = LOC_CONST; else - aclass = LOC_TYPEDEF; + loc_class = LOC_TYPEDEF; pst->add_psymbol (tname, true, - tdomain, aclass, -1, + tdomain, loc_class, -1, psymbol_placement::GLOBAL, unrelocated_addr (0), language_c, pst->context.partial_symtabs, of); @@ -1465,7 +1465,7 @@ ctf_psymtab_type_cb (ctf_id_t tid, void *arg) ccp = (struct ctf_context *) arg; domain_enum domain = UNDEF_DOMAIN; - enum address_class aclass = LOC_UNDEF; + location_class loc_class = LOC_UNDEF; kind = ctf_type_kind (ccp->fp, tid); switch (kind) { @@ -1475,29 +1475,29 @@ ctf_psymtab_type_cb (ctf_id_t tid, void *arg) case CTF_K_STRUCT: case CTF_K_UNION: domain = STRUCT_DOMAIN; - aclass = LOC_TYPEDEF; + loc_class = LOC_TYPEDEF; break; case CTF_K_FUNCTION: case CTF_K_FORWARD: domain = VAR_DOMAIN; - aclass = LOC_STATIC; + loc_class = LOC_STATIC; section = SECT_OFF_TEXT (ccp->of); break; case CTF_K_CONST: domain = VAR_DOMAIN; - aclass = LOC_STATIC; + loc_class = LOC_STATIC; break; case CTF_K_TYPEDEF: case CTF_K_POINTER: case CTF_K_VOLATILE: case CTF_K_RESTRICT: domain = VAR_DOMAIN; - aclass = LOC_TYPEDEF; + loc_class = LOC_TYPEDEF; break; case CTF_K_INTEGER: case CTF_K_FLOAT: domain = VAR_DOMAIN; - aclass = LOC_TYPEDEF; + loc_class = LOC_TYPEDEF; break; case CTF_K_ARRAY: case CTF_K_UNKNOWN: @@ -1509,7 +1509,7 @@ ctf_psymtab_type_cb (ctf_id_t tid, void *arg) return 0; ccp->pst->add_psymbol (name, false, - domain, aclass, section, + domain, loc_class, section, psymbol_placement::STATIC, unrelocated_addr (0), language_c, ccp->partial_symtabs, ccp->of); diff --git a/gdb/d-exp.y b/gdb/d-exp.y index e0ee75858b4..f77b15e46f2 100644 --- a/gdb/d-exp.y +++ b/gdb/d-exp.y @@ -444,7 +444,7 @@ PrimaryExpression: sym = lookup_symbol (copy.c_str (), pstate->expression_context_block, SEARCH_VFT, &is_a_field_of_this); - if (sym.symbol && sym.symbol->aclass () != LOC_TYPEDEF) + if (sym.symbol && sym.symbol->loc_class () != LOC_TYPEDEF) { if (symbol_read_needs_frame (sym.symbol)) pstate->block_tracker->update (sym); @@ -1334,7 +1334,7 @@ classify_name (struct parser_state *par_state, const struct block *block) std::string copy = copy_name (yylval.sval); sym = lookup_symbol (copy.c_str (), block, SEARCH_VFT, &is_a_field_of_this); - if (sym.symbol && sym.symbol->aclass () == LOC_TYPEDEF) + if (sym.symbol && sym.symbol->loc_class () == LOC_TYPEDEF) { yylval.tsym.type = sym.symbol->type (); return TYPENAME; @@ -1383,7 +1383,7 @@ classify_inner_name (struct parser_state *par_state, if (yylval.ssym.sym.symbol == NULL) return ERROR; - if (yylval.ssym.sym.symbol->aclass () == LOC_TYPEDEF) + if (yylval.ssym.sym.symbol->loc_class () == LOC_TYPEDEF) { yylval.tsym.type = yylval.ssym.sym.symbol->type (); return TYPENAME; diff --git a/gdb/dwarf2/ada-imported.c b/gdb/dwarf2/ada-imported.c index 1e259663279..48e6fccdb73 100644 --- a/gdb/dwarf2/ada-imported.c +++ b/gdb/dwarf2/ada-imported.c @@ -109,7 +109,7 @@ ada_alias_get_block_value (const struct symbol *sym) if (real_symbol.symbol == nullptr) error (_("could not find alias '%s' for function '%s'"), name, sym->print_name ()); - if (real_symbol.symbol->aclass () != LOC_BLOCK) + if (real_symbol.symbol->loc_class () != LOC_BLOCK) error (_("alias '%s' for function '%s' is not a function"), name, sym->print_name ()); diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c index 7bd0850ee5b..29650c57737 100644 --- a/gdb/dwarf2/read.c +++ b/gdb/dwarf2/read.c @@ -147,7 +147,7 @@ static const registry::key dwarf2_per_bfd_bfd_data_key; static const registry::key dwarf2_per_bfd_objfile_data_key; -/* The "aclass" indices for various kinds of computed DWARF symbols. */ +/* The "loc_class" indices for various kinds of computed DWARF symbols. */ static int dwarf2_locexpr_index; static int dwarf2_loclist_index; @@ -4261,7 +4261,7 @@ fixup_go_packaging (struct dwarf2_cu *cu) struct symbol *sym = list->symbol[i]; if (sym->language () == language_go - && sym->aclass () == LOC_BLOCK) + && sym->loc_class () == LOC_BLOCK) { gdb::unique_xmalloc_ptr this_package_name = go_symbol_package_name (sym); @@ -4298,7 +4298,7 @@ fixup_go_packaging (struct dwarf2_cu *cu) sym->set_language (language_go, &objfile->objfile_obstack); sym->compute_and_set_names (saved_package_name, false, objfile->per_bfd); sym->set_domain (TYPE_DOMAIN); - sym->set_aclass_index (LOC_TYPEDEF); + sym->set_loc_class_index (LOC_TYPEDEF); sym->set_type (type); add_symbol_to_list (sym, cu->get_builder ()->get_global_symbols ()); @@ -5684,7 +5684,7 @@ read_alias (struct die_info *die, struct dwarf2_cu *cu) type = die_type (d, imported_cu); struct symbol *sym = new_symbol (die, type, cu); attr = dwarf2_attr (d, DW_AT_location, imported_cu); - sym->set_aclass_index (LOC_UNRESOLVED); + sym->set_loc_class_index (LOC_UNRESOLVED); if (attr != nullptr) var_decode_location (attr, sym, cu); return true; @@ -12412,7 +12412,7 @@ mark_common_block_symbol_computed (struct symbol *sym, gdb_assert (ptr - baton->data == baton->size); SYMBOL_LOCATION_BATON (sym) = baton; - sym->set_aclass_index (dwarf2_locexpr_index); + sym->set_loc_class_index (dwarf2_locexpr_index); } /* Create appropriate locally-scoped variables for all the @@ -16659,7 +16659,7 @@ var_decode_location (struct attribute *attr, struct symbol *sym, variable has been optimized away. */ if (attr->form_is_block () && attr->as_block ()->size == 0) { - sym->set_aclass_index (LOC_OPTIMIZED_OUT); + sym->set_loc_class_index (LOC_OPTIMIZED_OUT); return; } @@ -16689,7 +16689,7 @@ var_decode_location (struct attribute *attr, struct symbol *sym, else tem = read_addr_index_from_leb128 (cu, block->data + 1, &dummy); sym->set_value_address ((CORE_ADDR) tem); - sym->set_aclass_index (LOC_STATIC); + sym->set_loc_class_index (LOC_STATIC); fixup_symbol_section (sym, objfile); sym->set_value_address (sym->value_address () @@ -16726,7 +16726,7 @@ add_ada_export_symbol (struct symbol *orig, const char *new_name, = new (&cu->per_objfile->objfile->objfile_obstack) symbol (*orig); copy->set_linkage_name (new_name); SYMBOL_LOCATION_BATON (copy) = (void *) orig_name; - copy->set_aclass_index (copy->aclass () == LOC_BLOCK + copy->set_loc_class_index (copy->loc_class () == LOC_BLOCK ? ada_block_index : ada_imported_index); add_symbol_to_list (copy, list_to_add); @@ -16826,7 +16826,7 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu, /* Default assumptions. Use the passed type or decode it from the die. */ sym->set_domain (UNDEF_DOMAIN); - sym->set_aclass_index (LOC_OPTIMIZED_OUT); + sym->set_loc_class_index (LOC_OPTIMIZED_OUT); if (type != NULL) sym->set_type (type); else @@ -16876,10 +16876,10 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu, CORE_ADDR addr = per_objfile->relocate (attr->as_address ()); sym->set_section_index (SECT_OFF_TEXT (objfile)); sym->set_value_address (addr); - sym->set_aclass_index (LOC_LABEL); + sym->set_loc_class_index (LOC_LABEL); } else - sym->set_aclass_index (LOC_OPTIMIZED_OUT); + sym->set_loc_class_index (LOC_OPTIMIZED_OUT); sym->set_type (builtin_type (objfile)->builtin_core_addr); sym->set_domain (LABEL_DOMAIN); list_to_add = cu->list_in_scope; @@ -16888,7 +16888,7 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu, /* SYMBOL_BLOCK_VALUE (sym) will be filled in later by finish_block. */ sym->set_domain (FUNCTION_DOMAIN); - sym->set_aclass_index (LOC_BLOCK); + sym->set_loc_class_index (LOC_BLOCK); /* DW_TAG_entry_point provides an additional entry_point to an existing sub_program. Therefore, we inherit the "external" attribute from the sub_program to which the entry_point @@ -16903,7 +16903,7 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu, /* SYMBOL_BLOCK_VALUE (sym) will be filled in later by finish_block. */ sym->set_domain (FUNCTION_DOMAIN); - sym->set_aclass_index (LOC_BLOCK); + sym->set_loc_class_index (LOC_BLOCK); attr2 = dwarf2_attr (die, DW_AT_external, cu); if ((attr2 != nullptr && attr2->as_boolean ()) || cu->lang () == language_ada @@ -16932,7 +16932,7 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu, /* For Import, create a symbol using the source name, and have it refer to the linkage name. */ SYMBOL_LOCATION_BATON (sym) = (void *) linkagename; - sym->set_aclass_index (ada_block_index); + sym->set_loc_class_index (ada_block_index); } else { @@ -16948,7 +16948,7 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu, /* SYMBOL_BLOCK_VALUE (sym) will be filled in later by finish_block. */ sym->set_domain (FUNCTION_DOMAIN); - sym->set_aclass_index (LOC_BLOCK); + sym->set_loc_class_index (LOC_BLOCK); sym->set_is_inlined (1); list_to_add = cu->list_in_scope; break; @@ -17000,7 +17000,7 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu, && die->parent->tag == DW_TAG_common_block) attr2 = NULL; - if (sym->aclass () == LOC_STATIC + if (sym->loc_class () == LOC_STATIC && sym->value_address () == 0 && !per_objfile->per_bfd->has_section_at_zero) { @@ -17011,7 +17011,7 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu, } else if (attr2 != nullptr && attr2->as_boolean ()) { - if (sym->aclass () == LOC_STATIC + if (sym->loc_class () == LOC_STATIC && (objfile->flags & OBJF_MAINLINE) == 0 && per_objfile->per_bfd->can_copy) { @@ -17080,7 +17080,7 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu, ? cu->get_builder ()->get_global_symbols () : cu->list_in_scope); SYMBOL_LOCATION_BATON (sym) = (void *) linkagename; - sym->set_aclass_index (ada_imported_index); + sym->set_loc_class_index (ada_imported_index); } else if (attr2 != nullptr && attr2->as_boolean () && dwarf2_attr (die, DW_AT_type, cu) != NULL) @@ -17093,12 +17093,12 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu, ? cu->get_builder ()->get_global_symbols () : cu->list_in_scope); - sym->set_aclass_index (LOC_UNRESOLVED); + sym->set_loc_class_index (LOC_UNRESOLVED); } else if (!die_is_declaration (die, cu)) { /* Use the default LOC_OPTIMIZED_OUT class. */ - gdb_assert (sym->aclass () == LOC_OPTIMIZED_OUT); + gdb_assert (sym->loc_class () == LOC_OPTIMIZED_OUT); if (!suppress_add) list_to_add = cu->list_in_scope; } @@ -17154,13 +17154,13 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu, there's a special hack for C++ in the matching code, so we don't need to enter a separate typedef for the tag. */ - sym->set_aclass_index (LOC_TYPEDEF); + sym->set_loc_class_index (LOC_TYPEDEF); sym->set_domain (STRUCT_DOMAIN); } else { /* Other languages don't have a tag namespace. */ - sym->set_aclass_index (LOC_TYPEDEF); + sym->set_loc_class_index (LOC_TYPEDEF); sym->set_domain (TYPE_DOMAIN); } @@ -17205,7 +17205,7 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu, case DW_TAG_base_type: case DW_TAG_subrange_type: case DW_TAG_generic_subrange: - sym->set_aclass_index (LOC_TYPEDEF); + sym->set_loc_class_index (LOC_TYPEDEF); sym->set_domain (TYPE_DOMAIN); list_to_add = cu->list_in_scope; break; @@ -17229,21 +17229,21 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu, case DW_TAG_imported_declaration: case DW_TAG_namespace: sym->set_domain (TYPE_DOMAIN); - sym->set_aclass_index (LOC_TYPEDEF); + sym->set_loc_class_index (LOC_TYPEDEF); list_to_add = cu->get_builder ()->get_global_symbols (); break; case DW_TAG_module: - sym->set_aclass_index (LOC_TYPEDEF); + sym->set_loc_class_index (LOC_TYPEDEF); sym->set_domain (MODULE_DOMAIN); list_to_add = cu->get_builder ()->get_global_symbols (); break; case DW_TAG_common_block: - sym->set_aclass_index (LOC_COMMON_BLOCK); + sym->set_loc_class_index (LOC_COMMON_BLOCK); sym->set_domain (COMMON_BLOCK_DOMAIN); list_to_add = cu->list_in_scope; break; case DW_TAG_namelist: - sym->set_aclass_index (LOC_STATIC); + sym->set_loc_class_index (LOC_STATIC); sym->set_domain (VAR_DOMAIN); list_to_add = cu->list_in_scope; break; @@ -17396,17 +17396,17 @@ dwarf2_const_value (const struct attribute *attr, struct symbol *sym, if (baton != NULL) { SYMBOL_LOCATION_BATON (sym) = baton; - sym->set_aclass_index (dwarf2_locexpr_index); + sym->set_loc_class_index (dwarf2_locexpr_index); } else if (bytes != NULL) { sym->set_value_bytes (bytes); - sym->set_aclass_index (LOC_CONST_BYTES); + sym->set_loc_class_index (LOC_CONST_BYTES); } else { sym->set_value_longest (value); - sym->set_aclass_index (LOC_CONST); + sym->set_loc_class_index (LOC_CONST); } } @@ -18977,7 +18977,7 @@ decode_locdesc (struct dwarf_block *blk, struct dwarf2_cu *cu, case DW_OP_deref: /* If we're not the last op, then we definitely can't encode - this using GDB's address_class enum. This is valid for partial + this using GDB's location_class enum. This is valid for partial global symbols, although the variable's address will be bogus in the psymtab. */ if (i < size) @@ -19219,7 +19219,7 @@ dwarf2_symbol_mark_computed (const struct attribute *attr, struct symbol *sym, complaint (_("Location list used without " "specifying the CU base address.")); - sym->set_aclass_index ((is_block + sym->set_loc_class_index ((is_block ? dwarf2_loclist_block_index : dwarf2_loclist_index)); SYMBOL_LOCATION_BATON (sym) = baton; @@ -19252,7 +19252,7 @@ dwarf2_symbol_mark_computed (const struct attribute *attr, struct symbol *sym, baton->size = 0; } - sym->set_aclass_index ((is_block + sym->set_loc_class_index ((is_block ? dwarf2_locexpr_block_index : dwarf2_locexpr_index)); SYMBOL_LOCATION_BATON (sym) = baton; diff --git a/gdb/eval.c b/gdb/eval.c index 6227a26a93d..491125c7409 100644 --- a/gdb/eval.c +++ b/gdb/eval.c @@ -2678,11 +2678,11 @@ var_value_operation::evaluate_for_address (struct expression *exp, if (noside == EVAL_AVOID_SIDE_EFFECTS) { struct type *type = lookup_pointer_type (var->type ()); - enum address_class sym_class = var->aclass (); + location_class loc_class = var->loc_class (); - if (sym_class == LOC_CONST - || sym_class == LOC_CONST_BYTES - || sym_class == LOC_REGISTER) + if (loc_class == LOC_CONST + || loc_class == LOC_CONST_BYTES + || loc_class == LOC_REGISTER) error (_("Attempt to take address of register or constant.")); return value::zero (type, not_lval); diff --git a/gdb/expop.h b/gdb/expop.h index a3541d4e5ca..6f509dac324 100644 --- a/gdb/expop.h +++ b/gdb/expop.h @@ -476,11 +476,11 @@ check_constant (const gdb_mpz &cst) static inline bool check_constant (struct symbol *sym) { - enum address_class sc = sym->aclass (); - return (sc == LOC_BLOCK - || sc == LOC_CONST - || sc == LOC_CONST_BYTES - || sc == LOC_LABEL); + location_class lc = sym->loc_class (); + return (lc == LOC_BLOCK + || lc == LOC_CONST + || lc == LOC_CONST_BYTES + || lc == LOC_LABEL); } static inline bool diff --git a/gdb/f-exp.y b/gdb/f-exp.y index 44ea11b6508..afcdc4141cc 100644 --- a/gdb/f-exp.y +++ b/gdb/f-exp.y @@ -1663,7 +1663,7 @@ yylex (void) { result = lookup_symbol (tmp.c_str (), pstate->expression_context_block, domain, NULL); - if (result.symbol && result.symbol->aclass () == LOC_TYPEDEF) + if (result.symbol && result.symbol->loc_class () == LOC_TYPEDEF) { yylval.tsym.type = result.symbol->type (); return TYPENAME; diff --git a/gdb/f-valprint.c b/gdb/f-valprint.c index a0812b3f973..935bf026c8e 100644 --- a/gdb/f-valprint.c +++ b/gdb/f-valprint.c @@ -631,7 +631,7 @@ info_common_command_for_block (const struct block *block, const char *comname, const struct common_block *common = sym->value_common_block (); size_t index; - gdb_assert (sym->aclass () == LOC_COMMON_BLOCK); + gdb_assert (sym->loc_class () == LOC_COMMON_BLOCK); if (comname && (!sym->linkage_name () || strcmp (comname, sym->linkage_name ()) != 0)) diff --git a/gdb/findvar.c b/gdb/findvar.c index 9da5c4831a6..c5294fe449e 100644 --- a/gdb/findvar.c +++ b/gdb/findvar.c @@ -124,7 +124,7 @@ symbol_read_needs (struct symbol *sym) computed_ops != nullptr) return computed_ops->get_symbol_read_needs (sym); - switch (sym->aclass ()) + switch (sym->loc_class ()) { /* All cases listed explicitly so that gcc -Wall will detect it if we failed to consider one. */ @@ -306,7 +306,7 @@ language_defn::read_var_value (struct symbol *var, if (const symbol_computed_ops *computed_ops = var->computed_ops ()) return computed_ops->read_variable (var, frame); - switch (var->aclass ()) + switch (var->loc_class ()) { case LOC_CONST: if (is_dynamic_type (type)) @@ -429,7 +429,7 @@ language_defn::read_var_value (struct symbol *var, const symbol_register_ops *reg_ops = var->register_ops (); int regno = reg_ops->register_number (var, get_frame_arch (frame)); - if (var->aclass () == LOC_REGPARM_ADDR) + if (var->loc_class () == LOC_REGPARM_ADDR) addr = value_as_address (value_from_register (lookup_pointer_type (type), regno, frame)); else diff --git a/gdb/frame.c b/gdb/frame.c index 50223f405e3..5c41dcdc345 100644 --- a/gdb/frame.c +++ b/gdb/frame.c @@ -2617,7 +2617,7 @@ inside_main_func (const frame_info_ptr &this_frame) SEARCH_FUNCTION_DOMAIN, nullptr); /* This lookup should always yield a block-valued symbol. */ - if (bs.symbol != nullptr && bs.symbol->aclass () == LOC_BLOCK) + if (bs.symbol != nullptr && bs.symbol->loc_class () == LOC_BLOCK) { const struct block *block = bs.symbol->value_block (); gdb_assert (block != nullptr); diff --git a/gdb/go-exp.y b/gdb/go-exp.y index 8823503a2c9..a61724285c4 100644 --- a/gdb/go-exp.y +++ b/gdb/go-exp.y @@ -1290,7 +1290,7 @@ package_name_p (const char *name, const struct block *block) &is_a_field_of_this).symbol; if (sym - && sym->aclass () == LOC_TYPEDEF + && sym->loc_class () == LOC_TYPEDEF && sym->type ()->code () == TYPE_CODE_MODULE) return 1; diff --git a/gdb/guile/scm-symbol.c b/gdb/guile/scm-symbol.c index 8c2ae240083..1d3fb2972b8 100644 --- a/gdb/guile/scm-symbol.c +++ b/gdb/guile/scm-symbol.c @@ -405,7 +405,7 @@ gdbscm_symbol_addr_class (SCM self) = syscm_get_valid_symbol_smob_arg_unsafe (self, SCM_ARG1, FUNC_NAME); const struct symbol *symbol = s_smob->symbol; - return scm_from_int (symbol->aclass ()); + return scm_from_int (symbol->loc_class ()); } /* (symbol-argument? ) -> boolean */ @@ -428,11 +428,9 @@ gdbscm_symbol_constant_p (SCM self) symbol_smob *s_smob = syscm_get_valid_symbol_smob_arg_unsafe (self, SCM_ARG1, FUNC_NAME); const struct symbol *symbol = s_smob->symbol; - enum address_class theclass; + location_class loc_class = symbol->loc_class (); - theclass = symbol->aclass (); - - return scm_from_bool (theclass == LOC_CONST || theclass == LOC_CONST_BYTES); + return scm_from_bool (loc_class == LOC_CONST || loc_class == LOC_CONST_BYTES); } /* (symbol-function? ) -> boolean */ @@ -443,11 +441,9 @@ gdbscm_symbol_function_p (SCM self) symbol_smob *s_smob = syscm_get_valid_symbol_smob_arg_unsafe (self, SCM_ARG1, FUNC_NAME); const struct symbol *symbol = s_smob->symbol; - enum address_class theclass; - - theclass = symbol->aclass (); + location_class loc_class = symbol->loc_class (); - return scm_from_bool (theclass == LOC_BLOCK); + return scm_from_bool (loc_class == LOC_BLOCK); } /* (symbol-variable? ) -> boolean */ @@ -458,14 +454,12 @@ gdbscm_symbol_variable_p (SCM self) symbol_smob *s_smob = syscm_get_valid_symbol_smob_arg_unsafe (self, SCM_ARG1, FUNC_NAME); const struct symbol *symbol = s_smob->symbol; - enum address_class theclass; - - theclass = symbol->aclass (); + location_class loc_class = symbol->loc_class (); return scm_from_bool (!symbol->is_argument () - && (theclass == LOC_LOCAL || theclass == LOC_REGISTER - || theclass == LOC_STATIC || theclass == LOC_COMPUTED - || theclass == LOC_OPTIMIZED_OUT)); + && (loc_class == LOC_LOCAL || loc_class == LOC_REGISTER + || loc_class == LOC_STATIC || loc_class == LOC_COMPUTED + || loc_class == LOC_OPTIMIZED_OUT)); } /* (symbol-needs-frame? ) -> boolean @@ -526,7 +520,7 @@ gdbscm_symbol_value (SCM self, SCM rest) if (!gdbscm_is_false (frame_scm)) f_smob = frscm_get_frame_smob_arg_unsafe (frame_scm, frame_pos, FUNC_NAME); - if (symbol->aclass () == LOC_TYPEDEF) + if (symbol->loc_class () == LOC_TYPEDEF) { gdbscm_out_of_range_error (FUNC_NAME, SCM_ARG1, self, _("cannot get the value of a typedef")); diff --git a/gdb/infcmd.c b/gdb/infcmd.c index 8978c8a6303..b5e5909cb27 100644 --- a/gdb/infcmd.c +++ b/gdb/infcmd.c @@ -989,7 +989,7 @@ prepare_one_step (thread_info *tp, struct step_command_fsm *sm) if (inline_skipped_frames (tp) > 0) { const symbol *sym = inline_skipped_symbol (tp); - if (sym->aclass () == LOC_BLOCK) + if (sym->loc_class () == LOC_BLOCK) { const block *block = sym->value_block (); if (block->end () < tp->control.step_range_end) diff --git a/gdb/jit.c b/gdb/jit.c index 0ea7bd9e6ac..b105697b9b7 100644 --- a/gdb/jit.c +++ b/gdb/jit.c @@ -584,7 +584,7 @@ finalize_symtab (struct gdb_symtab *stab, struct objfile *objfile) /* The name. */ block_name->set_domain (FUNCTION_DOMAIN); - block_name->set_aclass_index (LOC_BLOCK); + block_name->set_loc_class_index (LOC_BLOCK); block_name->set_symtab (filetab); block_name->set_type (lookup_function_type (block_type)); block_name->set_value_block (new_block); diff --git a/gdb/language.c b/gdb/language.c index 80f9b0185a6..212a236e247 100644 --- a/gdb/language.c +++ b/gdb/language.c @@ -976,7 +976,7 @@ language_arch_info::type_and_symbol::alloc_type_symbol symbol->set_section_index (0); symbol->set_type (type); symbol->set_domain (TYPE_DOMAIN); - symbol->set_aclass_index (LOC_TYPEDEF); + symbol->set_loc_class_index (LOC_TYPEDEF); return symbol; } diff --git a/gdb/linespec.c b/gdb/linespec.c index b59c0553c34..cefee026d92 100644 --- a/gdb/linespec.c +++ b/gdb/linespec.c @@ -230,7 +230,7 @@ collect_info::add_symbol (block_symbol *bsym) { /* In list mode, add all matching symbols, regardless of class. This allows the user to type "list a_global_variable". */ - if (bsym->symbol->aclass () == LOC_BLOCK || this->state->list_mode) + if (bsym->symbol->loc_class () == LOC_BLOCK || this->state->list_mode) this->result.symbols->push_back (*bsym); /* Continue iterating. */ @@ -2129,7 +2129,7 @@ create_sals_line_offset (struct linespec_state *self, line 16 will also result in a breakpoint in main, at line 17. */ if (!was_exact && sym != nullptr - && sym->aclass () == LOC_BLOCK + && sym->loc_class () == LOC_BLOCK && sal.pc == sym->value_block ()->entry_pc () && val.line < sym->line ()) continue; @@ -2224,7 +2224,7 @@ convert_linespec_to_sals (struct linespec_state *state, linespec *ls) if (state->funfirstline && !ls->minimal_symbols.empty () - && sym.symbol->aclass () == LOC_BLOCK) + && sym.symbol->loc_class () == LOC_BLOCK) { const CORE_ADDR addr = sym.symbol->value_block ()->entry_pc (); @@ -3361,7 +3361,7 @@ decode_compound_collector::operator () (block_symbol *bsym) struct type *t; struct symbol *sym = bsym->symbol; - if (sym->aclass () != LOC_TYPEDEF) + if (sym->loc_class () != LOC_TYPEDEF) return true; /* Continue iterating. */ t = sym->type (); @@ -4316,14 +4316,14 @@ static bool symbol_to_sal (struct symtab_and_line *result, bool funfirstline, struct symbol *sym) { - if (sym->aclass () == LOC_BLOCK) + if (sym->loc_class () == LOC_BLOCK) { *result = find_function_start_sal (sym, funfirstline); return true; } else { - if (sym->aclass () == LOC_LABEL && sym->value_address () != 0) + if (sym->loc_class () == LOC_LABEL && sym->value_address () != 0) { *result = {}; result->symtab = sym->symtab (); diff --git a/gdb/m2-exp.y b/gdb/m2-exp.y index 5c31a5ede43..55d5f2e3056 100644 --- a/gdb/m2-exp.y +++ b/gdb/m2-exp.y @@ -507,7 +507,7 @@ fblock : block COLONCOLON BLOCKNAME { struct symbol *tem = lookup_symbol (copy_name ($3).c_str (), $1, SEARCH_VFT, 0).symbol; - if (!tem || tem->aclass () != LOC_BLOCK) + if (!tem || tem->loc_class () != LOC_BLOCK) error (_("No function \"%s\" in specified context."), copy_name ($3).c_str ()); $$ = tem; @@ -928,7 +928,7 @@ yylex (void) sym = lookup_symbol (tmp.c_str (), pstate->expression_context_block, SEARCH_VFT, 0).symbol; - if (sym && sym->aclass () == LOC_BLOCK) + if (sym && sym->loc_class () == LOC_BLOCK) return BLOCKNAME; if (lookup_typename (pstate->language (), tmp.c_str (), pstate->expression_context_block, 1)) @@ -936,7 +936,7 @@ yylex (void) if(sym) { - switch(sym->aclass ()) + switch(sym->loc_class ()) { case LOC_STATIC: case LOC_REGISTER: diff --git a/gdb/mdebugread.c b/gdb/mdebugread.c index b9302c594cd..a7d26c3422c 100644 --- a/gdb/mdebugread.c +++ b/gdb/mdebugread.c @@ -248,7 +248,7 @@ static struct type *parse_type (int, union aux_ext *, unsigned int, int *, int, const char *); static struct symbol *mylookup_symbol (const char *, const struct block *, - domain_enum, enum address_class); + domain_enum, location_class); static void sort_blocks (struct symtab *); @@ -550,7 +550,7 @@ static const struct symbol_register_ops mdebug_register_funcs = { mdebug_reg_to_regnum }; -/* The "aclass" indices for computed symbols. */ +/* The "loc_class" indices for computed symbols. */ static int mdebug_register_index; static int mdebug_regparm_index; @@ -559,11 +559,11 @@ static int mdebug_regparm_index; static void add_data_symbol (SYMR *sh, union aux_ext *ax, int bigend, - struct symbol *s, int aclass_index, struct block *b, + struct symbol *s, int loc_class_index, struct block *b, struct objfile *objfile, const char *name) { s->set_domain (VAR_DOMAIN); - s->set_aclass_index (aclass_index); + s->set_loc_class_index (loc_class_index); add_symbol (s, top_stack->cur_st, b); /* Type could be missing if file is compiled without debugging info. */ @@ -688,19 +688,19 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend, { case scRegister: /* Pass by value in register. */ - s->set_aclass_index (mdebug_register_index); + s->set_loc_class_index (mdebug_register_index); break; case scVar: /* Pass by reference on stack. */ - s->set_aclass_index (LOC_REF_ARG); + s->set_loc_class_index (LOC_REF_ARG); break; case scVarRegister: /* Pass by reference in register. */ - s->set_aclass_index (mdebug_regparm_index); + s->set_loc_class_index (mdebug_regparm_index); break; default: /* Pass by value on stack. */ - s->set_aclass_index (LOC_ARG); + s->set_loc_class_index (LOC_ARG); break; } s->set_value_longest (svalue); @@ -711,7 +711,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend, case stLabel: /* label, goes into current block. */ s = new_symbol (name); s->set_domain (LABEL_DOMAIN); /* So that it can be used */ - s->set_aclass_index (LOC_LABEL); /* but not misused. */ + s->set_loc_class_index (LOC_LABEL); /* but not misused. */ s->set_section_index (section_index); s->set_value_address (sh->value); s->set_type (builtin_type (objfile)->builtin_int); @@ -753,7 +753,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend, } s = new_symbol (name); s->set_domain (FUNCTION_DOMAIN); - s->set_aclass_index (LOC_BLOCK); + s->set_loc_class_index (LOC_BLOCK); s->set_section_index (section_index); /* Type of the return value. */ if (SC_IS_UNDEF (sh->sc) || sh->sc == scNil) @@ -1074,7 +1074,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend, enum_sym->set_linkage_name (obstack_strdup (&mdebugread_objfile->objfile_obstack, f->name ())); - enum_sym->set_aclass_index (LOC_CONST); + enum_sym->set_loc_class_index (LOC_CONST); enum_sym->set_type (t); enum_sym->set_domain (VAR_DOMAIN); enum_sym->set_value_longest (tsym.value); @@ -1107,7 +1107,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend, s = new_symbol (name); s->set_domain (STRUCT_DOMAIN); - s->set_aclass_index (LOC_TYPEDEF); + s->set_loc_class_index (LOC_TYPEDEF); s->set_value_longest (0); s->set_type (t); add_symbol (s, top_stack->cur_st, top_stack->cur_block); @@ -1164,7 +1164,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend, /* Make up special symbol to contain procedure specific info. */ s = new_symbol (MDEBUG_EFI_SYMBOL_NAME); s->set_domain (LABEL_DOMAIN); - s->set_aclass_index (LOC_CONST); + s->set_loc_class_index (LOC_CONST); s->set_type (builtin_type (mdebugread_objfile)->builtin_void); e = OBSTACK_ZALLOC (&mdebugread_objfile->objfile_obstack, mdebug_extra_func_info); @@ -1297,7 +1297,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend, break; s = new_symbol (name); s->set_domain (TYPE_DOMAIN); - s->set_aclass_index (LOC_TYPEDEF); + s->set_loc_class_index (LOC_TYPEDEF); s->set_value_block (top_stack->cur_block); s->set_type (t); add_symbol (s, top_stack->cur_st, top_stack->cur_block); @@ -3369,7 +3369,7 @@ parse_partial_symbols (minimal_symbol_reader &reader, for (cur_sdx = 0; cur_sdx < fh->csym;) { char *sym_name; - enum address_class theclass; + location_class loc_class; unrelocated_addr minsym_value; int section = -1; @@ -3526,7 +3526,7 @@ parse_partial_symbols (minimal_symbol_reader &reader, reader.record_with_info (sym_name, minsym_value, mst_file_bss, SECT_OFF_BSS (objfile)); - theclass = LOC_STATIC; + loc_class = LOC_STATIC; break; case stIndirect: /* Irix5 forward declaration */ @@ -3538,11 +3538,11 @@ parse_partial_symbols (minimal_symbol_reader &reader, structs from alpha and mips cc. */ if (sh.iss == 0 || has_opaque_xref (fh, &sh)) goto skip; - theclass = LOC_TYPEDEF; + loc_class = LOC_TYPEDEF; break; case stConstant: /* Constant decl */ - theclass = LOC_CONST; + loc_class = LOC_CONST; break; case stUnion: @@ -3600,7 +3600,7 @@ parse_partial_symbols (minimal_symbol_reader &reader, } /* Use this gdb symbol. */ pst->add_psymbol (sym_name, true, - VAR_DOMAIN, theclass, section, + VAR_DOMAIN, loc_class, section, psymbol_placement::STATIC, unrelocated_addr (sh.value), psymtab_language, @@ -3616,7 +3616,7 @@ parse_partial_symbols (minimal_symbol_reader &reader, PST_PRIVATE (save_pst)->extern_tab = ext_ptr; for (; --cur_sdx >= 0; ext_ptr++) { - enum address_class theclass; + location_class loc_class; SYMR *psh; CORE_ADDR svalue; int section; @@ -3663,7 +3663,7 @@ parse_partial_symbols (minimal_symbol_reader &reader, Ignore them, as parse_external will ignore them too. */ continue; case stLabel: - theclass = LOC_LABEL; + loc_class = LOC_LABEL; break; default: unknown_ext_complaint (debug_info->ssext + psh->iss); @@ -3675,12 +3675,12 @@ parse_partial_symbols (minimal_symbol_reader &reader, if (SC_IS_COMMON (psh->sc)) continue; - theclass = LOC_STATIC; + loc_class = LOC_STATIC; break; } char *sym_name = debug_info->ssext + psh->iss; pst->add_psymbol (sym_name, true, - VAR_DOMAIN, theclass, + VAR_DOMAIN, loc_class, section, psymbol_placement::GLOBAL, unrelocated_addr (svalue), @@ -3991,7 +3991,7 @@ mdebug_expand_psymtab (legacy_psymtab *pst, struct objfile *objfile) struct symbol *s = new_symbol (MDEBUG_EFI_SYMBOL_NAME); s->set_domain (LABEL_DOMAIN); - s->set_aclass_index (LOC_CONST); + s->set_loc_class_index (LOC_CONST); s->set_type (builtin_type (objfile)->builtin_void); s->set_value_bytes ((gdb_byte *) e); e->pdr.framereg = -1; @@ -4464,7 +4464,7 @@ cross_ref (int fd, union aux_ext *ax, struct type **tpp, static struct symbol * mylookup_symbol (const char *name, const struct block *block, - domain_enum domain, enum address_class theclass) + domain_enum domain, location_class loc_class) { int inc; @@ -4473,14 +4473,14 @@ mylookup_symbol (const char *name, const struct block *block, { if (sym->linkage_name ()[0] == inc && sym->domain () == domain - && sym->aclass () == theclass + && sym->loc_class () == loc_class && strcmp (sym->linkage_name (), name) == 0) return sym; } block = block->superblock (); if (block) - return mylookup_symbol (name, block, domain, theclass); + return mylookup_symbol (name, block, domain, loc_class); return 0; } diff --git a/gdb/mi/mi-cmd-stack.c b/gdb/mi/mi-cmd-stack.c index cc26747cfa0..d4a2499d424 100644 --- a/gdb/mi/mi-cmd-stack.c +++ b/gdb/mi/mi-cmd-stack.c @@ -604,7 +604,7 @@ list_args_or_locals (const frame_print_options &fp_opts, { int print_me = 0; - switch (sym->aclass ()) + switch (sym->loc_class ()) { default: case LOC_UNDEF: /* catches errors */ diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c index 32f832b230c..d072b9a4d33 100644 --- a/gdb/mips-tdep.c +++ b/gdb/mips-tdep.c @@ -487,7 +487,7 @@ msymbol_is_micromips (struct minimal_symbol *msym) static void mips_make_symbol_special (struct symbol *sym, struct objfile *objfile) { - if (sym->aclass () == LOC_BLOCK) + if (sym->loc_class () == LOC_BLOCK) { /* We are in symbol reading so it is OK to cast away constness. */ struct block *block = (struct block *) sym->value_block (); diff --git a/gdb/objfiles.c b/gdb/objfiles.c index d25d1a02cea..1cd6e8c0f4c 100644 --- a/gdb/objfiles.c +++ b/gdb/objfiles.c @@ -521,8 +521,8 @@ relocate_one_symbol (struct symbol *sym, struct objfile *objfile, any symbols in STRUCT_DOMAIN or UNDEF_DOMAIN. But I'm leaving out that test, on the theory that they can't possibly pass the tests below. */ - if ((sym->aclass () == LOC_LABEL - || sym->aclass () == LOC_STATIC) + if ((sym->loc_class () == LOC_LABEL + || sym->loc_class () == LOC_STATIC) && sym->section_index () >= 0) sym->set_value_address (sym->value_address () + delta[sym->section_index ()]); diff --git a/gdb/p-exp.y b/gdb/p-exp.y index cbf6b449343..2b923ab44df 100644 --- a/gdb/p-exp.y +++ b/gdb/p-exp.y @@ -1519,7 +1519,7 @@ yylex (void) /* Call lookup_symtab, not lookup_partial_symtab, in case there are no psymtabs (coff, xcoff, or some future change to blow away the psymtabs once once symbols are read). */ - if ((sym && sym->aclass () == LOC_BLOCK) + if ((sym && sym->loc_class () == LOC_BLOCK) || lookup_symtab (current_program_space, tmp.c_str ())) { yylval.ssym.sym.symbol = sym; @@ -1528,7 +1528,7 @@ yylex (void) free (uptokstart); return BLOCKNAME; } - if (sym && sym->aclass () == LOC_TYPEDEF) + if (sym && sym->loc_class () == LOC_TYPEDEF) { #if 1 /* Despite the following flaw, we need to keep this code enabled. @@ -1597,7 +1597,7 @@ yylex (void) SEARCH_VFT, NULL).symbol; if (cur_sym) { - if (cur_sym->aclass () == LOC_TYPEDEF) + if (cur_sym->loc_class () == LOC_TYPEDEF) { best_sym = cur_sym; pstate->lexptr = p; diff --git a/gdb/printcmd.c b/gdb/printcmd.c index c6d7075e89b..1c50b6cbae8 100644 --- a/gdb/printcmd.c +++ b/gdb/printcmd.c @@ -1655,7 +1655,7 @@ info_address_command (const char *exp, int from_tty) return; } - switch (sym->aclass ()) + switch (sym->loc_class ()) { case LOC_CONST: case LOC_CONST_BYTES: diff --git a/gdb/psymtab.c b/gdb/psymtab.c index 516ba725ced..c19e4f2fef1 100644 --- a/gdb/psymtab.c +++ b/gdb/psymtab.c @@ -228,7 +228,7 @@ find_pc_sect_psymbol (struct objfile *objfile, for (const partial_symbol *p : psymtab->global_psymbols) { if (p->domain == VAR_DOMAIN - && p->aclass == LOC_BLOCK + && p->loc_class == LOC_BLOCK && pc >= p->address (objfile) && (p->address (objfile) > best_pc || (psymtab->text_low (objfile) == 0 @@ -248,7 +248,7 @@ find_pc_sect_psymbol (struct objfile *objfile, for (const partial_symbol *p : psymtab->static_psymbols) { if (p->domain == VAR_DOMAIN - && p->aclass == LOC_BLOCK + && p->loc_class == LOC_BLOCK && pc >= p->address (objfile) && (p->address (objfile) > best_pc || (psymtab->text_low (objfile) == 0 @@ -537,7 +537,7 @@ print_partial_symbols (struct gdbarch *gdbarch, struct objfile *objfile, gdb_puts (", ", outfile); break; } - switch (p->aclass) + switch (p->loc_class) { case LOC_UNDEF: gdb_puts ("undefined", outfile); @@ -1022,12 +1022,12 @@ psymbol_bcache::hash (const void *addr, int length) struct partial_symbol *psymbol = (struct partial_symbol *) addr; unsigned int lang = psymbol->ginfo.language (); unsigned int domain = psymbol->domain; - unsigned int theclass = psymbol->aclass; + unsigned int loc_class = psymbol->loc_class; h = fast_hash (&psymbol->ginfo.m_value, sizeof (psymbol->ginfo.m_value), h); h = fast_hash (&lang, sizeof (unsigned int), h); h = fast_hash (&domain, sizeof (unsigned int), h); - h = fast_hash (&theclass, sizeof (unsigned int), h); + h = fast_hash (&loc_class, sizeof (unsigned int), h); /* Note that psymbol names are interned via compute_and_set_names, so there's no need to hash the contents of the name here. */ h = fast_hash (&psymbol->ginfo.m_name, sizeof (psymbol->ginfo.m_name), h); @@ -1047,7 +1047,7 @@ psymbol_bcache::compare (const void *addr1, const void *addr2, int length) sizeof (sym1->ginfo.m_value)) == 0 && sym1->ginfo.language () == sym2->ginfo.language () && sym1->domain == sym2->domain - && sym1->aclass == sym2->aclass + && sym1->loc_class == sym2->loc_class /* Note that psymbol names are interned via compute_and_set_names, so there's no need to compare the contents of the name here. */ @@ -1085,7 +1085,7 @@ partial_symtab::add_psymbol (const partial_symbol &psymbol, void partial_symtab::add_psymbol (std::string_view name, bool copy_name, domain_enum domain, - enum address_class theclass, + location_class loc_class, int section, psymbol_placement where, unrelocated_addr coreaddr, @@ -1099,7 +1099,7 @@ partial_symtab::add_psymbol (std::string_view name, bool copy_name, psymbol.set_unrelocated_address (coreaddr); psymbol.ginfo.set_section_index (section); psymbol.domain = domain; - psymbol.aclass = theclass; + psymbol.loc_class = loc_class; psymbol.ginfo.set_language (language, partial_symtabs->obstack ()); psymbol.ginfo.compute_and_set_names (name, copy_name, objfile->per_bfd); @@ -1498,7 +1498,7 @@ maintenance_check_psymtabs (const char *ignore, int from_tty) { /* Skip symbols for inlined functions without address. These may or may not have a match in the full symtab. */ - if (psym->aclass == LOC_BLOCK + if (psym->loc_class == LOC_BLOCK && psym->ginfo.value_address () == 0) continue; diff --git a/gdb/psymtab.h b/gdb/psymtab.h index ad0b2ff4234..6e1a019cbcb 100644 --- a/gdb/psymtab.h +++ b/gdb/psymtab.h @@ -184,10 +184,10 @@ struct partial_symbol ENUM_BITFIELD(domain_enum) domain : SYMBOL_DOMAIN_BITS; /* Address class (for info_symbols). Note that we don't allow - synthetic "aclass" values here at present, simply because there's + synthetic "loc_class" values here at present, simply because there's no need. */ - ENUM_BITFIELD(address_class) aclass : SYMBOL_ACLASS_BITS; + ENUM_BITFIELD(location_class) loc_class : SYMBOL_LOC_CLASS_BITS; }; /* A convenience enum to give names to some constants used when @@ -333,7 +333,7 @@ struct partial_symtab If COPY_NAME is true, make a copy of NAME, otherwise use the passed reference. - THECLASS is the type of symbol. + LOC_CLASS is the type of symbol. SECTION is the index of the section of OBJFILE in which the symbol is found. @@ -348,7 +348,7 @@ struct partial_symtab void add_psymbol (std::string_view name, bool copy_name, domain_enum domain, - enum address_class theclass, + location_class loc_class, int section, psymbol_placement where, unrelocated_addr coreaddr, diff --git a/gdb/python/py-framefilter.c b/gdb/python/py-framefilter.c index adf42331f1e..db8c274cdc0 100644 --- a/gdb/python/py-framefilter.c +++ b/gdb/python/py-framefilter.c @@ -168,7 +168,7 @@ mi_should_print (struct symbol *sym, enum mi_print_types type) { int print_me = 0; - switch (sym->aclass ()) + switch (sym->loc_class ()) { default: case LOC_UNDEF: /* catches errors */ diff --git a/gdb/python/py-symbol.c b/gdb/python/py-symbol.c index 3028a307205..69062f2e546 100644 --- a/gdb/python/py-symbol.c +++ b/gdb/python/py-symbol.c @@ -126,7 +126,7 @@ sympy_get_addr_class (PyObject *self, void *closure) SYMPY_REQUIRE_VALID (self, symbol); - return gdb_py_object_from_longest (symbol->aclass ()).release (); + return gdb_py_object_from_longest (symbol->loc_class ()).release (); } /* Implement gdb.Symbol.domain attribute. Return the domain as an @@ -156,42 +156,39 @@ static PyObject * sympy_is_constant (PyObject *self, void *closure) { struct symbol *symbol = NULL; - enum address_class theclass; SYMPY_REQUIRE_VALID (self, symbol); - theclass = symbol->aclass (); + location_class loc_class = symbol->loc_class (); - return PyBool_FromLong (theclass == LOC_CONST || theclass == LOC_CONST_BYTES); + return PyBool_FromLong (loc_class == LOC_CONST || loc_class == LOC_CONST_BYTES); } static PyObject * sympy_is_function (PyObject *self, void *closure) { struct symbol *symbol = NULL; - enum address_class theclass; SYMPY_REQUIRE_VALID (self, symbol); - theclass = symbol->aclass (); + location_class loc_class = symbol->loc_class (); - return PyBool_FromLong (theclass == LOC_BLOCK); + return PyBool_FromLong (loc_class == LOC_BLOCK); } static PyObject * sympy_is_variable (PyObject *self, void *closure) { struct symbol *symbol = NULL; - enum address_class theclass; SYMPY_REQUIRE_VALID (self, symbol); - theclass = symbol->aclass (); + location_class loc_class = symbol->loc_class (); return PyBool_FromLong (!symbol->is_argument () - && (theclass == LOC_LOCAL || theclass == LOC_REGISTER - || theclass == LOC_STATIC || theclass == LOC_COMPUTED - || theclass == LOC_OPTIMIZED_OUT)); + && (loc_class == LOC_LOCAL || loc_class == LOC_REGISTER + || loc_class == LOC_STATIC || loc_class == LOC_COMPUTED + || loc_class == LOC_OPTIMIZED_OUT)); } /* Implementation of Symbol.is_artificial. */ @@ -279,7 +276,7 @@ sympy_value (PyObject *self, PyObject *args) } SYMPY_REQUIRE_VALID (self, symbol); - if (symbol->aclass () == LOC_TYPEDEF) + if (symbol->loc_class () == LOC_TYPEDEF) { PyErr_SetString (PyExc_TypeError, "cannot get the value of a typedef"); return NULL; diff --git a/gdb/python/py-type.c b/gdb/python/py-type.c index 10ae636a9d1..a2c5939cf5c 100644 --- a/gdb/python/py-type.c +++ b/gdb/python/py-type.c @@ -1045,9 +1045,9 @@ typy_template_argument (PyObject *self, PyObject *args) } sym = TYPE_TEMPLATE_ARGUMENT (type, argno); - if (sym->aclass () == LOC_TYPEDEF) + if (sym->loc_class () == LOC_TYPEDEF) return type_to_type_object (sym->type ()); - else if (sym->aclass () == LOC_OPTIMIZED_OUT) + else if (sym->loc_class () == LOC_OPTIMIZED_OUT) { PyErr_Format (PyExc_RuntimeError, _("Template argument is optimized out")); diff --git a/gdb/rust-parse.c b/gdb/rust-parse.c index b428b97355a..7fad148f98b 100644 --- a/gdb/rust-parse.c +++ b/gdb/rust-parse.c @@ -1232,14 +1232,14 @@ rust_parser::name_to_operation (const std::string &name) struct block_symbol sym = lookup_symbol (name.c_str (), pstate->expression_context_block, SEARCH_VFT); - if (sym.symbol != nullptr && sym.symbol->aclass () != LOC_TYPEDEF) + if (sym.symbol != nullptr && sym.symbol->loc_class () != LOC_TYPEDEF) return make_operation (sym); struct type *type = nullptr; if (sym.symbol != nullptr) { - gdb_assert (sym.symbol->aclass () == LOC_TYPEDEF); + gdb_assert (sym.symbol->loc_class () == LOC_TYPEDEF); type = sym.symbol->type (); } if (type == nullptr) diff --git a/gdb/stabsread.c b/gdb/stabsread.c index 74d01756c8c..2d1411e9146 100644 --- a/gdb/stabsread.c +++ b/gdb/stabsread.c @@ -472,7 +472,7 @@ patch_block_stabs (struct pending *symbols, struct pending_stabs *stabs, a N_GSYM stab for it, but no regular (C_EXT) symbol. */ sym = new (&objfile->objfile_obstack) symbol; sym->set_domain (VAR_DOMAIN); - sym->set_aclass_index (LOC_OPTIMIZED_OUT); + sym->set_loc_class_index (LOC_OPTIMIZED_OUT); sym->set_linkage_name (obstack_strndup (&objfile->objfile_obstack, name, pp - name)); pp += 2; @@ -3123,7 +3123,7 @@ static const struct symbol_register_ops stab_register_funcs = { stab_reg_to_regnum }; -/* The "aclass" indices for computed symbols. */ +/* The "loc_class" indices for computed symbols. */ static int stab_register_index; static int stab_regparm_index; @@ -3268,7 +3268,7 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type, (where type 6 is defined by "blobs:t6=eblob1:0,blob2:1,;"). */ if (*p != '=') { - sym->set_aclass_index (LOC_CONST); + sym->set_loc_class_index (LOC_CONST); sym->set_type (error_type (&p, objfile)); sym->set_domain (VAR_DOMAIN); add_symbol_to_list (sym, get_file_symbols ()); @@ -3291,7 +3291,7 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type, sym->set_type (dbl_type); sym->set_value_bytes (dbl_valu); - sym->set_aclass_index (LOC_CONST_BYTES); + sym->set_loc_class_index (LOC_CONST_BYTES); } break; case 'i': @@ -3305,7 +3305,7 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type, sym->set_type (builtin_type (objfile)->builtin_long); sym->set_value_longest (atoi (p)); - sym->set_aclass_index (LOC_CONST); + sym->set_loc_class_index (LOC_CONST); } break; @@ -3313,7 +3313,7 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type, { sym->set_type (builtin_type (objfile)->builtin_char); sym->set_value_longest (atoi (p)); - sym->set_aclass_index (LOC_CONST); + sym->set_loc_class_index (LOC_CONST); } break; @@ -3327,7 +3327,7 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type, if (quote != '\'' && quote != '"') { - sym->set_aclass_index (LOC_CONST); + sym->set_loc_class_index (LOC_CONST); sym->set_type (error_type (&p, objfile)); sym->set_domain (VAR_DOMAIN); add_symbol_to_list (sym, get_file_symbols ()); @@ -3352,7 +3352,7 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type, } if (*p != quote) { - sym->set_aclass_index (LOC_CONST); + sym->set_loc_class_index (LOC_CONST); sym->set_type (error_type (&p, objfile)); sym->set_domain (VAR_DOMAIN); add_symbol_to_list (sym, get_file_symbols ()); @@ -3375,7 +3375,7 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type, p++; sym->set_value_bytes (string_value); - sym->set_aclass_index (LOC_CONST_BYTES); + sym->set_loc_class_index (LOC_CONST_BYTES); } break; @@ -3385,7 +3385,7 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type, e.g. "b:c=e6,0" for "const b = blob1" (where type 6 is defined by "blobs:t6=eblob1:0,blob2:1,;"). */ { - sym->set_aclass_index (LOC_CONST); + sym->set_loc_class_index (LOC_CONST); sym->set_type (read_type (&p, objfile)); if (*p != ',') @@ -3406,7 +3406,7 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type, break; default: { - sym->set_aclass_index (LOC_CONST); + sym->set_loc_class_index (LOC_CONST); sym->set_type (error_type (&p, objfile)); } } @@ -3417,7 +3417,7 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type, case 'C': /* The name of a caught exception. */ sym->set_type (read_type (&p, objfile)); - sym->set_aclass_index (LOC_LABEL); + sym->set_loc_class_index (LOC_LABEL); sym->set_domain (VAR_DOMAIN); sym->set_value_address (valu); add_symbol_to_list (sym, get_local_symbols ()); @@ -3426,7 +3426,7 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type, case 'f': /* A static function definition. */ sym->set_type (read_type (&p, objfile)); - sym->set_aclass_index (LOC_BLOCK); + sym->set_loc_class_index (LOC_BLOCK); sym->set_domain (FUNCTION_DOMAIN); add_symbol_to_list (sym, get_file_symbols ()); /* fall into process_function_types. */ @@ -3497,7 +3497,7 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type, case 'F': /* A global function definition. */ sym->set_type (read_type (&p, objfile)); - sym->set_aclass_index (LOC_BLOCK); + sym->set_loc_class_index (LOC_BLOCK); sym->set_domain (FUNCTION_DOMAIN); add_symbol_to_list (sym, get_global_symbols ()); goto process_function_types; @@ -3508,7 +3508,7 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type, corresponding linker definition to find the value. These definitions appear at the end of the namelist. */ sym->set_type (read_type (&p, objfile)); - sym->set_aclass_index (LOC_STATIC); + sym->set_loc_class_index (LOC_STATIC); sym->set_domain (VAR_DOMAIN); /* Don't add symbol references to global_sym_chain. Symbol references don't have valid names and won't match up with @@ -3529,7 +3529,7 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type, case 's': case 'l': sym->set_type (read_type (&p, objfile)); - sym->set_aclass_index (LOC_LOCAL); + sym->set_loc_class_index (LOC_LOCAL); sym->set_value_longest (valu); sym->set_domain (VAR_DOMAIN); add_symbol_to_list (sym, get_local_symbols ()); @@ -3549,7 +3549,7 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type, else sym->set_type (read_type (&p, objfile)); - sym->set_aclass_index (LOC_ARG); + sym->set_loc_class_index (LOC_ARG); sym->set_value_longest (valu); sym->set_domain (VAR_DOMAIN); sym->set_is_argument (1); @@ -3598,7 +3598,7 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type, case 'R': /* Parameter which is in a register. */ sym->set_type (read_type (&p, objfile)); - sym->set_aclass_index (stab_register_index); + sym->set_loc_class_index (stab_register_index); sym->set_is_argument (1); sym->set_value_longest (valu); sym->set_domain (VAR_DOMAIN); @@ -3608,7 +3608,7 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type, case 'r': /* Register variable (either global or local). */ sym->set_type (read_type (&p, objfile)); - sym->set_aclass_index (stab_register_index); + sym->set_loc_class_index (stab_register_index); sym->set_value_longest (valu); sym->set_domain (VAR_DOMAIN); if (within_function) @@ -3640,12 +3640,12 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type, struct symbol *prev_sym; prev_sym = local_symbols->symbol[local_symbols->nsyms - 1]; - if ((prev_sym->aclass () == LOC_REF_ARG - || prev_sym->aclass () == LOC_ARG) + if ((prev_sym->loc_class () == LOC_REF_ARG + || prev_sym->loc_class () == LOC_ARG) && strcmp (prev_sym->linkage_name (), sym->linkage_name ()) == 0) { - prev_sym->set_aclass_index (stab_register_index); + prev_sym->set_loc_class_index (stab_register_index); /* Use the type from the LOC_REGISTER; that is the type that is actually in that register. */ prev_sym->set_type (sym->type ()); @@ -3663,7 +3663,7 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type, case 'S': /* Static symbol at top level of file. */ sym->set_type (read_type (&p, objfile)); - sym->set_aclass_index (LOC_STATIC); + sym->set_loc_class_index (LOC_STATIC); sym->set_value_address (valu); sym->set_domain (VAR_DOMAIN); add_symbol_to_list (sym, get_file_symbols ()); @@ -3694,7 +3694,7 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type, if (nameless) return NULL; - sym->set_aclass_index (LOC_TYPEDEF); + sym->set_loc_class_index (LOC_TYPEDEF); sym->set_value_longest (valu); sym->set_domain (TYPE_DOMAIN); /* C++ vagaries: we may have a type which is derived from @@ -3771,7 +3771,7 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type, struct symbol *struct_sym = new (&objfile->objfile_obstack) symbol; *struct_sym = *sym; - struct_sym->set_aclass_index (LOC_TYPEDEF); + struct_sym->set_loc_class_index (LOC_TYPEDEF); struct_sym->set_value_longest (valu); struct_sym->set_domain (STRUCT_DOMAIN); if (sym->type ()->name () == 0) @@ -3798,7 +3798,7 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type, if (nameless) return NULL; - sym->set_aclass_index (LOC_TYPEDEF); + sym->set_loc_class_index (LOC_TYPEDEF); sym->set_value_longest (valu); sym->set_domain (STRUCT_DOMAIN); if (sym->type ()->name () == 0) @@ -3813,7 +3813,7 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type, struct symbol *typedef_sym = new (&objfile->objfile_obstack) symbol; *typedef_sym = *sym; - typedef_sym->set_aclass_index (LOC_TYPEDEF); + typedef_sym->set_loc_class_index (LOC_TYPEDEF); typedef_sym->set_value_longest (valu); typedef_sym->set_domain (TYPE_DOMAIN); if (sym->type ()->name () == 0) @@ -3827,7 +3827,7 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type, case 'V': /* Static symbol of local scope. */ sym->set_type (read_type (&p, objfile)); - sym->set_aclass_index (LOC_STATIC); + sym->set_loc_class_index (LOC_STATIC); sym->set_value_address (valu); sym->set_domain (VAR_DOMAIN); add_symbol_to_list (sym, get_local_symbols ()); @@ -3836,7 +3836,7 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type, case 'v': /* Reference parameter */ sym->set_type (read_type (&p, objfile)); - sym->set_aclass_index (LOC_REF_ARG); + sym->set_loc_class_index (LOC_REF_ARG); sym->set_is_argument (1); sym->set_value_longest (valu); sym->set_domain (VAR_DOMAIN); @@ -3846,7 +3846,7 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type, case 'a': /* Reference parameter which is in a register. */ sym->set_type (read_type (&p, objfile)); - sym->set_aclass_index (stab_regparm_index); + sym->set_loc_class_index (stab_regparm_index); sym->set_is_argument (1); sym->set_value_longest (valu); sym->set_domain (VAR_DOMAIN); @@ -3859,7 +3859,7 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type, that Pascal uses it too, but when I tried it Pascal used "x:3" (local symbol) instead. */ sym->set_type (read_type (&p, objfile)); - sym->set_aclass_index (LOC_LOCAL); + sym->set_loc_class_index (LOC_LOCAL); sym->set_value_longest (valu); sym->set_domain (VAR_DOMAIN); add_symbol_to_list (sym, get_local_symbols ()); @@ -3867,7 +3867,7 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type, default: sym->set_type (error_type (&p, objfile)); - sym->set_aclass_index (LOC_CONST); + sym->set_loc_class_index (LOC_CONST); sym->set_value_longest (0); sym->set_domain (VAR_DOMAIN); add_symbol_to_list (sym, get_file_symbols ()); @@ -3883,12 +3883,12 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type, { /* We have to convert LOC_REGISTER to LOC_REGPARM_ADDR (for variables passed in a register). */ - if (sym->aclass () == LOC_REGISTER) - sym->set_aclass_index (LOC_REGPARM_ADDR); + if (sym->loc_class () == LOC_REGISTER) + sym->set_loc_class_index (LOC_REGPARM_ADDR); /* Likewise for converting LOC_ARG to LOC_REF_ARG (for the 7th and subsequent arguments on SPARC, for example). */ - else if (sym->aclass () == LOC_ARG) - sym->set_aclass_index (LOC_REF_ARG); + else if (sym->loc_class () == LOC_ARG) + sym->set_loc_class_index (LOC_REF_ARG); } return sym; @@ -4139,7 +4139,7 @@ again: { struct symbol *sym = ppt->symbol[i]; - if (sym->aclass () == LOC_TYPEDEF + if (sym->loc_class () == LOC_TYPEDEF && sym->domain () == STRUCT_DOMAIN && (sym->type ()->code () == code) && strcmp (sym->linkage_name (), type_name) == 0) @@ -6060,7 +6060,7 @@ read_enum_type (const char **pp, struct type *type, sym->set_linkage_name (name); sym->set_language (get_current_subfile ()->language, &objfile->objfile_obstack); - sym->set_aclass_index (LOC_CONST); + sym->set_loc_class_index (LOC_CONST); sym->set_domain (VAR_DOMAIN); sym->set_value_longest (n); if (n < 0) @@ -6727,7 +6727,7 @@ common_block_end (struct objfile *objfile) sym = new (&objfile->objfile_obstack) symbol; /* Note: common_block_name already saved on objfile_obstack. */ sym->set_linkage_name (common_block_name); - sym->set_aclass_index (LOC_BLOCK); + sym->set_loc_class_index (LOC_BLOCK); /* Now we copy all the symbols which have been defined since the BCOMM. */ @@ -6935,7 +6935,7 @@ cleanup_undefined_types_1 (void) { struct symbol *sym = ppt->symbol[i]; - if (sym->aclass () == LOC_TYPEDEF + if (sym->loc_class () == LOC_TYPEDEF && sym->domain () == STRUCT_DOMAIN && (sym->type ()->code () == (*type)->code ()) && ((*type)->instance_flags () @@ -7045,7 +7045,7 @@ scan_file_globals (struct objfile *objfile) the same symbol if there are multiple references. */ if (sym) { - if (sym->aclass () == LOC_BLOCK) + if (sym->loc_class () == LOC_BLOCK) fix_common_block (sym, msymbol->value_address (resolve_objfile), msymbol->section_index ()); @@ -7091,8 +7091,8 @@ scan_file_globals (struct objfile *objfile) prev->set_value_address (0); /* Complain about unresolved common block symbols. */ - if (prev->aclass () == LOC_STATIC) - prev->set_aclass_index (LOC_UNRESOLVED); + if (prev->loc_class () == LOC_STATIC) + prev->set_loc_class_index (LOC_UNRESOLVED); else complaint (_("%s: common block `%s' from " "global_sym_chain unresolved"), diff --git a/gdb/stack.c b/gdb/stack.c index e3fa1f4bcaf..c0af030bd74 100644 --- a/gdb/stack.c +++ b/gdb/stack.c @@ -758,7 +758,7 @@ print_frame_args (const frame_print_options &fp_opts, break; } - switch (sym->aclass ()) + switch (sym->loc_class ()) { case LOC_ARG: case LOC_REF_ARG: @@ -813,7 +813,7 @@ print_frame_args (const frame_print_options &fp_opts, nsym = lookup_symbol_search_name (sym->search_name (), b, SEARCH_VAR_DOMAIN).symbol; gdb_assert (nsym != NULL); - if (nsym->aclass () == LOC_REGISTER + if (nsym->loc_class () == LOC_REGISTER && !nsym->is_argument ()) { /* There is a LOC_ARG/LOC_REGISTER pair. This means @@ -2216,7 +2216,7 @@ iterate_over_block_locals (const struct block *b, { for (struct symbol *sym : block_iterator_range (b)) { - switch (sym->aclass ()) + switch (sym->loc_class ()) { case LOC_CONST: case LOC_CONST_BYTES: diff --git a/gdb/symmisc.c b/gdb/symmisc.c index 0cb6a1b0cb6..a352e0655bd 100644 --- a/gdb/symmisc.c +++ b/gdb/symmisc.c @@ -537,7 +537,7 @@ print_symbol (struct gdbarch *gdbarch, struct symbol *symbol, } else { - if (symbol->aclass () == LOC_TYPEDEF) + if (symbol->loc_class () == LOC_TYPEDEF) gdb_printf (outfile, "typedef "); if (symbol->type ()) { @@ -552,7 +552,7 @@ print_symbol (struct gdbarch *gdbarch, struct symbol *symbol, else gdb_printf (outfile, "%s ", symbol->print_name ()); - switch (symbol->aclass ()) + switch (symbol->loc_class ()) { case LOC_CONST: gdb_printf (outfile, "const %s (%s)", @@ -646,7 +646,7 @@ print_symbol (struct gdbarch *gdbarch, struct symbol *symbol, default: gdb_printf (outfile, "botched symbol class %x", - symbol->aclass ()); + symbol->loc_class ()); break; } } diff --git a/gdb/symtab.c b/gdb/symtab.c index 302f4ebf274..0d110e4f2ec 100644 --- a/gdb/symtab.c +++ b/gdb/symtab.c @@ -1780,7 +1780,7 @@ fixup_symbol_section (struct symbol *sym, struct objfile *objfile) index without doing the check that is done by the wrapper macros like SECT_OFF_TEXT. */ int fallback; - switch (sym->aclass ()) + switch (sym->loc_class ()) { case LOC_STATIC: fallback = objfile->sect_index_data; @@ -3038,7 +3038,7 @@ find_symbol_at_address (CORE_ADDR address) for (struct symbol *sym : block_iterator_range (b)) { - if (sym->aclass () == LOC_STATIC + if (sym->loc_class () == LOC_STATIC && sym->value_address () == addr) return sym; } @@ -4310,7 +4310,7 @@ find_function_alias_target (bound_minimal_symbol msymbol) symbol *sym = find_pc_function (func_addr); if (sym != NULL - && sym->aclass () == LOC_BLOCK + && sym->loc_class () == LOC_BLOCK && sym->value_block ()->entry_pc () == func_addr) return sym; @@ -5021,12 +5021,12 @@ global_symbol_searcher::add_matching_symbols if ((kind & SEARCH_VAR_DOMAIN) != 0) { - if (sym->aclass () == LOC_UNRESOLVED + if (sym->loc_class () == LOC_UNRESOLVED /* LOC_CONST can be used for more than just enums, e.g., c++ static const members. We only want to skip enums here. */ - || (sym->aclass () == LOC_CONST + || (sym->loc_class () == LOC_CONST && (sym->type ()->code () == TYPE_CODE_ENUM))) continue; } @@ -5234,7 +5234,7 @@ symbol_to_info_string (struct symbol *sym, int block) string_file tmp_stream; type_print (sym->type (), - (sym->aclass () == LOC_TYPEDEF + (sym->loc_class () == LOC_TYPEDEF ? "" : sym->print_name ()), &tmp_stream, 0); @@ -5753,7 +5753,7 @@ completion_list_add_symbol (completion_tracker &tracker, the msymbol name and removes the msymbol name from the completion tracker. */ if (sym->language () == language_cplus - && sym->aclass () == LOC_BLOCK) + && sym->loc_class () == LOC_BLOCK) { /* The call to canonicalize returns the empty string if the input string is already in canonical form, thanks to this we don't @@ -5898,7 +5898,7 @@ completion_list_add_fields (completion_tracker &tracker, const lookup_name_info &lookup_name, const char *text, const char *word) { - if (sym->aclass () == LOC_TYPEDEF) + if (sym->loc_class () == LOC_TYPEDEF) { struct type *t = sym->type (); enum type_code c = t->code (); @@ -5950,7 +5950,7 @@ symbol_is_function_or_method (minimal_symbol *msymbol) bound_minimal_symbol find_gnu_ifunc (const symbol *sym) { - if (sym->aclass () != LOC_BLOCK) + if (sym->loc_class () != LOC_BLOCK) return {}; lookup_name_info lookup_name (sym->search_name (), @@ -6629,13 +6629,13 @@ main_language (void) /* The next index to hand out in response to a registration request. */ -static int next_aclass_value = LOC_FINAL_VALUE; +static int next_loc_class_value = LOC_FINAL_VALUE; -/* The maximum number of "aclass" registrations we support. This is +/* The maximum number of "loc_class" registrations we support. This is constant for convenience. */ #define MAX_SYMBOL_IMPLS (LOC_FINAL_VALUE + 11) -/* The objects representing the various "aclass" values. The elements +/* The objects representing the various "loc_class" values. The elements from 0 up to LOC_FINAL_VALUE-1 represent themselves, and subsequent elements are those registered at gdb initialization time. */ @@ -6648,22 +6648,22 @@ gdb::array_view symbol_impls (symbol_impl); /* Make sure we saved enough room in struct symbol. */ -static_assert (MAX_SYMBOL_IMPLS <= (1 << SYMBOL_ACLASS_BITS)); +static_assert (MAX_SYMBOL_IMPLS <= (1 << SYMBOL_LOC_CLASS_BITS)); -/* Register a computed symbol type. ACLASS must be LOC_COMPUTED. OPS +/* Register a computed symbol type. LOC_CLASS must be LOC_COMPUTED. OPS is the ops vector associated with this index. This returns the new - index, which should be used as the aclass_index field for symbols + index, which should be used as the loc_class_index field for symbols of this type. */ int -register_symbol_computed_impl (enum address_class aclass, +register_symbol_computed_impl (location_class loc_class, const struct symbol_computed_ops *ops) { - int result = next_aclass_value++; + int result = next_loc_class_value++; - gdb_assert (aclass == LOC_COMPUTED); + gdb_assert (loc_class == LOC_COMPUTED); gdb_assert (result < MAX_SYMBOL_IMPLS); - symbol_impl[result].aclass = aclass; + symbol_impl[result].loc_class = loc_class; symbol_impl[result].ops_computed = ops; /* Sanity check OPS. */ @@ -6676,20 +6676,20 @@ register_symbol_computed_impl (enum address_class aclass, return result; } -/* Register a function with frame base type. ACLASS must be LOC_BLOCK. +/* Register a function with frame base type. LOC_CLASS must be LOC_BLOCK. OPS is the ops vector associated with this index. This returns the - new index, which should be used as the aclass_index field for symbols + new index, which should be used as the loc_class_index field for symbols of this type. */ int -register_symbol_block_impl (enum address_class aclass, +register_symbol_block_impl (location_class loc_class, const struct symbol_block_ops *ops) { - int result = next_aclass_value++; + int result = next_loc_class_value++; - gdb_assert (aclass == LOC_BLOCK); + gdb_assert (loc_class == LOC_BLOCK); gdb_assert (result < MAX_SYMBOL_IMPLS); - symbol_impl[result].aclass = aclass; + symbol_impl[result].loc_class = loc_class; symbol_impl[result].ops_block = ops; /* Sanity check OPS. */ @@ -6700,35 +6700,33 @@ register_symbol_block_impl (enum address_class aclass, return result; } -/* Register a register symbol type. ACLASS must be LOC_REGISTER or +/* Register a register symbol type. LOC_CLASS must be LOC_REGISTER or LOC_REGPARM_ADDR. OPS is the register ops vector associated with this index. This returns the new index, which should be used as - the aclass_index field for symbols of this type. */ + the loc_class_index field for symbols of this type. */ int -register_symbol_register_impl (enum address_class aclass, +register_symbol_register_impl (location_class loc_class, const struct symbol_register_ops *ops) { - int result = next_aclass_value++; + int result = next_loc_class_value++; - gdb_assert (aclass == LOC_REGISTER || aclass == LOC_REGPARM_ADDR); + gdb_assert (loc_class == LOC_REGISTER || loc_class == LOC_REGPARM_ADDR); gdb_assert (result < MAX_SYMBOL_IMPLS); - symbol_impl[result].aclass = aclass; + symbol_impl[result].loc_class = loc_class; symbol_impl[result].ops_register = ops; return result; } /* Initialize elements of 'symbol_impl' for the constants in enum - address_class. */ + location_class. */ static void initialize_ordinary_address_classes (void) { - int i; - - for (i = 0; i < LOC_FINAL_VALUE; ++i) - symbol_impl[i].aclass = (enum address_class) i; + for (int i = 0; i < LOC_FINAL_VALUE; ++i) + symbol_impl[i].loc_class = static_cast (i); } @@ -6776,7 +6774,7 @@ CORE_ADDR symbol::get_maybe_copied_address () const { gdb_assert (this->maybe_copied); - gdb_assert (this->aclass () == LOC_STATIC); + gdb_assert (this->loc_class () == LOC_STATIC); const char *linkage_name = this->linkage_name (); bound_minimal_symbol minsym diff --git a/gdb/symtab.h b/gdb/symtab.h index a71195313a1..25f2aaf016d 100644 --- a/gdb/symtab.h +++ b/gdb/symtab.h @@ -967,9 +967,9 @@ to_scripting_domain (domain_search_flags val) Throws an exception if VAL is not one of the allowable values. */ extern domain_search_flags from_scripting_domain (int val); -/* An address-class says where to find the value of a symbol. */ +/* A location class says where to find the value of a symbol. */ -enum address_class +enum location_class { /* Not used; catches errors. */ @@ -1078,14 +1078,14 @@ enum address_class LOC_FINAL_VALUE }; -/* The number of bits needed for values in enum address_class, with some +/* The number of bits needed for values in enum location_class, with some padding for reasonable growth, and room for run-time registered address classes. See symtab.c:MAX_SYMBOL_IMPLS. This is a #define so that we can have a assertion elsewhere to verify that we have reserved enough space for synthetic address classes. */ -#define SYMBOL_ACLASS_BITS 5 -static_assert (LOC_FINAL_VALUE <= (1 << SYMBOL_ACLASS_BITS)); +#define SYMBOL_LOC_CLASS_BITS 5 +static_assert (LOC_FINAL_VALUE <= (1 << SYMBOL_LOC_CLASS_BITS)); /* The methods needed to implement LOC_COMPUTED. These methods can use the symbol's .aux_value for additional per-symbol information. @@ -1202,7 +1202,7 @@ struct symbol_register_ops struct symbol_impl { - enum address_class aclass; + location_class loc_class; /* Used with LOC_COMPUTED. */ const struct symbol_computed_ops *ops_computed; @@ -1238,7 +1238,7 @@ struct symbol : public general_symbol_info, public allocate_on_obstack symbol () /* Class-initialization of bitfields is only allowed in C++20. */ : m_domain (UNDEF_DOMAIN), - m_aclass_index (0), + m_loc_class_index (0), m_is_objfile_owned (1), m_is_argument (0), m_is_inlined (0), @@ -1262,14 +1262,14 @@ struct symbol : public general_symbol_info, public allocate_on_obstack symbol (const symbol &) = default; symbol &operator= (const symbol &) = default; - void set_aclass_index (unsigned int aclass_index) + void set_loc_class_index (unsigned int loc_class_index) { - m_aclass_index = aclass_index; + m_loc_class_index = loc_class_index; } const symbol_impl &impl () const { - return symbol_impls[this->m_aclass_index]; + return symbol_impls[this->m_loc_class_index]; } const symbol_block_ops *block_ops () const @@ -1287,9 +1287,9 @@ struct symbol : public general_symbol_info, public allocate_on_obstack return this->impl ().ops_register; } - address_class aclass () const + location_class loc_class () const { - return this->impl ().aclass; + return this->impl ().loc_class; } /* Return true if this symbol's domain matches FLAGS. */ @@ -1480,11 +1480,11 @@ struct symbol : public general_symbol_info, public allocate_on_obstack ENUM_BITFIELD(domain_enum) m_domain : SYMBOL_DOMAIN_BITS; - /* Address class. This holds an index into the 'symbol_impls' - table. The actual enum address_class value is stored there, + /* Location class. This holds an index into the 'symbol_impls' + table. The actual location_class value is stored there, alongside any per-class ops vectors. */ - unsigned int m_aclass_index : SYMBOL_ACLASS_BITS; + unsigned int m_loc_class_index : SYMBOL_LOC_CLASS_BITS; /* If non-zero then symbol is objfile-owned, use owner.symtab. Otherwise symbol is arch-owned, use owner.arch. */ @@ -1575,13 +1575,13 @@ symbol::value_block () const return m_value.block; } -extern int register_symbol_computed_impl (enum address_class, +extern int register_symbol_computed_impl (location_class, const struct symbol_computed_ops *); -extern int register_symbol_block_impl (enum address_class aclass, +extern int register_symbol_block_impl (location_class loc_class, const struct symbol_block_ops *ops); -extern int register_symbol_register_impl (enum address_class, +extern int register_symbol_register_impl (location_class, const struct symbol_register_ops *); /* An instance of this type is used to represent a C++ template diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c index 89f741466a6..58aad4430c7 100644 --- a/gdb/tracepoint.c +++ b/gdb/tracepoint.c @@ -689,14 +689,14 @@ validate_actionline (const char *line, tracepoint *t) (exp->op.get ())); sym = vvop->get_symbol (); - if (sym->aclass () == LOC_CONST) + if (sym->loc_class () == LOC_CONST) { error (_("constant `%s' (value %s) " "will not be collected."), sym->print_name (), plongest (sym->value_longest ())); } - else if (sym->aclass () == LOC_OPTIMIZED_OUT) + else if (sym->loc_class () == LOC_OPTIMIZED_OUT) { error (_("`%s' is optimized away " "and cannot be collected."), @@ -916,11 +916,11 @@ collection_list::collect_symbol (struct symbol *sym, int treat_as_expr = 0; len = check_typedef (sym->type ())->length (); - switch (sym->aclass ()) + switch (sym->loc_class ()) { default: gdb_printf ("%s: don't know symbol class %d\n", - sym->print_name (), sym->aclass ()); + sym->print_name (), sym->loc_class ()); break; case LOC_CONST: gdb_printf ("constant %s (value %s) will not be collected.\n", @@ -2508,12 +2508,12 @@ info_scope_command (const char *args_in, int from_tty) gdb_stdout); else { - switch (sym->aclass ()) + switch (sym->loc_class ()) { default: case LOC_UNDEF: /* Messed up symbol? */ gdb_printf ("a bogus symbol, class %d.\n", - sym->aclass ()); + sym->loc_class ()); count--; /* Don't count this one. */ continue; case LOC_CONST: diff --git a/gdb/typeprint.c b/gdb/typeprint.c index ef0c5aadb9e..8f2836a610d 100644 --- a/gdb/typeprint.c +++ b/gdb/typeprint.c @@ -219,7 +219,7 @@ typedef_hash_table::add_template_parameters (struct type *t) struct decl_field *tf; /* We only want type-valued template parameters in the hash. */ - if (TYPE_TEMPLATE_ARGUMENT (t, i)->aclass () != LOC_TYPEDEF) + if (TYPE_TEMPLATE_ARGUMENT (t, i)->loc_class () != LOC_TYPEDEF) continue; tf = XOBNEW (&m_storage, struct decl_field); diff --git a/gdb/valops.c b/gdb/valops.c index c260a79b46d..85d69fb11f2 100644 --- a/gdb/valops.c +++ b/gdb/valops.c @@ -3822,7 +3822,7 @@ value_maybe_namespace_elt (const struct type *curtype, if (sym.symbol == NULL) return NULL; else if ((noside == EVAL_AVOID_SIDE_EFFECTS) - && (sym.symbol->aclass () == LOC_TYPEDEF)) + && (sym.symbol->loc_class () == LOC_TYPEDEF)) result = value::allocate (sym.symbol->type ()); else result = value_of_variable (sym.symbol, sym.block); diff --git a/gdb/xcoffread.c b/gdb/xcoffread.c index 70585b36d20..6528cab633a 100644 --- a/gdb/xcoffread.c +++ b/gdb/xcoffread.c @@ -1491,7 +1491,7 @@ process_xcoff_symbol (struct xcoff_symbol *cs, struct objfile *objfile) sym->set_type (builtin_type (objfile)->nodebug_text_symbol); sym->set_domain (FUNCTION_DOMAIN); - sym->set_aclass_index (LOC_BLOCK); + sym->set_loc_class_index (LOC_BLOCK); sym2 = new (&objfile->objfile_obstack) symbol (*sym); if (cs->c_sclass == C_EXT || C_WEAKEXT)