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 <kevinb@redhat.com>
This commit is contained in:
Simon Marchi
2025-08-14 16:14:06 -04:00
parent 1d5f884e50
commit 4260abb7a7
48 changed files with 331 additions and 342 deletions

View File

@@ -1338,7 +1338,7 @@ write_object_renaming (struct parser_state *par_state,
SEARCH_VFT); SEARCH_VFT);
if (sym_info.symbol == NULL) if (sym_info.symbol == NULL)
error (_("Could not find renamed variable: %s"), ada_decode (name).c_str ()); 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 /* We have a renaming of an old-style renaming symbol. Don't
trust the block information. */ trust the block information. */
sym_info.block = orig_left_context; sym_info.block = orig_left_context;
@@ -1408,7 +1408,7 @@ write_object_renaming (struct parser_state *par_state,
SEARCH_VFT); SEARCH_VFT);
if (index_sym_info.symbol == NULL) if (index_sym_info.symbol == NULL)
error (_("Could not find %s"), index_name); 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 is an old-style renaming symbol. */
index_sym_info.block = orig_left_context; index_sym_info.block = orig_left_context;
write_var_from_sym (par_state, index_sym_info); 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); = ada_lookup_symbol_list (name, context, SEARCH_FUNCTION_DOMAIN);
if (context == NULL 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); symtab = lookup_symtab (current_program_space, name);
else else
symtab = NULL; symtab = NULL;
if (symtab != NULL) if (symtab != NULL)
result = symtab->compunit ()->blockvector ()->static_block (); 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) if (context == NULL)
error (_("No file or function \"%s\"."), raw_name); error (_("No file or function \"%s\"."), raw_name);
@@ -1511,7 +1511,7 @@ select_possible_type_sym (const std::vector<struct block_symbol> &syms)
preferred_index = -1; preferred_type = NULL; preferred_index = -1; preferred_type = NULL;
for (i = 0; i < syms.size (); i += 1) for (i = 0; i < syms.size (); i += 1)
switch (syms[i].symbol->aclass ()) switch (syms[i].symbol->loc_class ())
{ {
case LOC_TYPEDEF: case LOC_TYPEDEF:
if (ada_prefer_type (syms[i].symbol->type (), preferred_type)) 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__"); strcpy (expanded_name, "standard__");
strcat (expanded_name, name); strcat (expanded_name, name);
sym = ada_lookup_symbol (expanded_name, NULL, SEARCH_TYPE_DOMAIN).symbol; 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 (); type = sym->type ();
} }
@@ -1966,7 +1966,7 @@ write_name_assoc (struct parser_state *par_state, struct stoken name)
par_state->expression_context_block, par_state->expression_context_block,
SEARCH_VFT); 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<ada_string_operation> (copy_name (name)); pstate->push_new<ada_string_operation> (copy_name (name));
else else
write_var_from_sym (par_state, syms[0]); write_var_from_sym (par_state, syms[0]);

View File

@@ -3637,7 +3637,7 @@ See set/show multiple-symbol."));
if (syms[i].symbol == NULL) if (syms[i].symbol == NULL)
continue; continue;
if (syms[i].symbol->aclass () == LOC_BLOCK) if (syms[i].symbol->loc_class () == LOC_BLOCK)
{ {
struct symtab_and_line sal = struct symtab_and_line sal =
find_function_start_sal (syms[i].symbol, 1); find_function_start_sal (syms[i].symbol, 1);
@@ -3659,7 +3659,7 @@ See set/show multiple-symbol."));
else else
{ {
int is_enumeral = 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 () != NULL
&& syms[i].symbol->type ()->code () == TYPE_CODE_ENUM); && syms[i].symbol->type ()->code () == TYPE_CODE_ENUM);
struct symtab *symtab = NULL; struct symtab *symtab = NULL;
@@ -3822,7 +3822,7 @@ ada_resolve_variable (struct symbol *sym, const struct block *block,
candidates.end (), candidates.end (),
[] (block_symbol &bsym) [] (block_symbol &bsym)
{ {
switch (bsym.symbol->aclass ()) switch (bsym.symbol->loc_class ())
{ {
case LOC_REGISTER: case LOC_REGISTER:
case LOC_ARG: case LOC_ARG:
@@ -3845,7 +3845,7 @@ ada_resolve_variable (struct symbol *sym, const struct block *block,
candidates.end (), candidates.end (),
[] (block_symbol &bsym) [] (block_symbol &bsym)
{ {
return bsym.symbol->aclass () == LOC_TYPEDEF; return bsym.symbol->loc_class () == LOC_TYPEDEF;
}), }),
candidates.end ()); candidates.end ());
} }
@@ -4000,7 +4000,7 @@ ada_args_match (struct symbol *func, struct value **actuals, int n_actuals)
int i; int i;
struct type *func_type = func->type (); struct type *func_type = func->type ();
if (func->aclass () == LOC_CONST if (func->loc_class () == LOC_CONST
&& func_type->code () == TYPE_CODE_ENUM) && func_type->code () == TYPE_CODE_ENUM)
return (n_actuals == 0); return (n_actuals == 0);
else if (func_type == NULL || func_type->code () != TYPE_CODE_FUNC) else if (func_type == NULL || func_type->code () != TYPE_CODE_FUNC)
@@ -4310,7 +4310,7 @@ ada_parse_renaming (struct symbol *sym,
if (sym == NULL) if (sym == NULL)
return ADA_NOT_RENAMING; return ADA_NOT_RENAMING;
switch (sym->aclass ()) switch (sym->loc_class ())
{ {
default: default:
return ADA_NOT_RENAMING; return ADA_NOT_RENAMING;
@@ -4776,7 +4776,7 @@ is_nonfunction (const std::vector<struct block_symbol> &syms)
for (const block_symbol &sym : syms) for (const block_symbol &sym : syms)
if (sym.symbol->type ()->code () != TYPE_CODE_FUNC if (sym.symbol->type ()->code () != TYPE_CODE_FUNC
&& (sym.symbol->type ()->code () != TYPE_CODE_ENUM && (sym.symbol->type ()->code () != TYPE_CODE_ENUM
|| sym.symbol->aclass () != LOC_CONST)) || sym.symbol->loc_class () != LOC_CONST))
return 1; return 1;
return 0; return 0;
@@ -4811,10 +4811,10 @@ lesseq_defined_than (struct symbol *sym0, struct symbol *sym1)
if (sym0 == sym1) if (sym0 == sym1)
return 1; return 1;
if (sym0->domain () != sym1->domain () if (sym0->domain () != sym1->domain ()
|| sym0->aclass () != sym1->aclass ()) || sym0->loc_class () != sym1->loc_class ())
return 0; return 0;
switch (sym0->aclass ()) switch (sym0->loc_class ())
{ {
case LOC_UNDEF: case LOC_UNDEF:
return 1; return 1;
@@ -5069,7 +5069,7 @@ remove_extra_symbols (std::vector<struct block_symbol> &syms)
should be identical. */ should be identical. */
else if (syms[i].symbol->linkage_name () != NULL 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 ())) && is_nondebugging_type (syms[i].symbol->type ()))
{ {
for (j = 0; !remove_p && j < syms.size (); j += 1) for (j = 0; !remove_p && j < syms.size (); j += 1)
@@ -5078,8 +5078,8 @@ remove_extra_symbols (std::vector<struct block_symbol> &syms)
&& syms[j].symbol->linkage_name () != NULL && syms[j].symbol->linkage_name () != NULL
&& strcmp (syms[i].symbol->linkage_name (), && strcmp (syms[i].symbol->linkage_name (),
syms[j].symbol->linkage_name ()) == 0 syms[j].symbol->linkage_name ()) == 0
&& (syms[i].symbol->aclass () && (syms[i].symbol->loc_class ()
== syms[j].symbol->aclass ()) == syms[j].symbol->loc_class ())
&& syms[i].symbol->value_address () && syms[i].symbol->value_address ()
== syms[j].symbol->value_address ()) == syms[j].symbol->value_address ())
remove_p = true; remove_p = true;
@@ -5088,12 +5088,12 @@ remove_extra_symbols (std::vector<struct block_symbol> &syms)
/* Two functions with the same block are identical. */ /* 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) for (j = 0; !remove_p && j < syms.size (); j += 1)
{ {
if (i != j if (i != j
&& syms[j].symbol->aclass () == LOC_BLOCK && syms[j].symbol->loc_class () == LOC_BLOCK
&& (syms[i].symbol->value_block () && (syms[i].symbol->value_block ()
== syms[j].symbol->value_block ())) == syms[j].symbol->value_block ()))
remove_p = true; remove_p = true;
@@ -5170,7 +5170,7 @@ is_package_name (const char *name)
static int static int
old_renaming_is_invisible (const struct symbol *sym, const char *function_name) 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; return 0;
std::string scope = xget_renaming_scope (sym->type ()); std::string scope = xget_renaming_scope (sym->type ());
@@ -5249,7 +5249,7 @@ remove_irrelevant_renamings (std::vector<struct block_symbol> *syms,
const char *name; const char *name;
const char *suffix; const char *suffix;
if (sym == NULL || sym->aclass () == LOC_TYPEDEF) if (sym == NULL || sym->loc_class () == LOC_TYPEDEF)
continue; continue;
name = sym->linkage_name (); name = sym->linkage_name ();
suffix = strstr (name, "___XR"); suffix = strstr (name, "___XR");
@@ -5374,7 +5374,7 @@ match_data::operator() (struct block_symbol *bsym)
} }
else else
{ {
if (sym->aclass () == LOC_UNRESOLVED) if (sym->loc_class () == LOC_UNRESOLVED)
return true; return true;
else if (sym->is_argument ()) else if (sym->is_argument ())
arg_sym = sym; arg_sym = sym;
@@ -5979,7 +5979,7 @@ ada_add_block_symbols (std::vector<struct block_symbol> &result,
{ {
if (sym->matches (domain)) if (sym->matches (domain))
{ {
if (sym->aclass () != LOC_UNRESOLVED) if (sym->loc_class () != LOC_UNRESOLVED)
{ {
if (sym->is_argument ()) if (sym->is_argument ())
arg_sym = sym; arg_sym = sym;
@@ -6028,7 +6028,7 @@ ada_add_block_symbols (std::vector<struct block_symbol> &result,
if (cmp == 0 if (cmp == 0
&& is_name_suffix (sym->linkage_name () + name_len + 5)) && is_name_suffix (sym->linkage_name () + name_len + 5))
{ {
if (sym->aclass () != LOC_UNRESOLVED) if (sym->loc_class () != LOC_UNRESOLVED)
{ {
if (sym->is_argument ()) if (sym->is_argument ())
arg_sym = sym; 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. */ /* 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)"), 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, sym = standard_lookup (einfo->catch_handlers_sym, NULL,
SEARCH_FUNCTION_DOMAIN); 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. */ /* 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)"), error (_("Symbol \"%s\" is not a function (class = %d)"),
sym->linkage_name (), sym->aclass ()); sym->linkage_name (), sym->loc_class ());
return 1; 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"), throw_error (NOT_FOUND_ERROR, _("Catchpoint symbol not found: %s"),
sym_name); 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); error (_("Unable to insert catchpoint. %s is not a function."), sym_name);
return find_function_start_sal (sym, 1); 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 (); const char *type_name = sym->type ()->name ();
return (sym->aclass () != LOC_TYPEDEF return (sym->loc_class () != LOC_TYPEDEF
&& sym->aclass () != LOC_BLOCK && sym->loc_class () != LOC_BLOCK
&& sym->aclass () != LOC_CONST && sym->loc_class () != LOC_CONST
&& sym->aclass () != LOC_UNRESOLVED && sym->loc_class () != LOC_UNRESOLVED
&& type_name != NULL && strcmp (type_name, "exception") == 0); && 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)) for (struct symbol *sym : block_iterator_range (block))
{ {
switch (sym->aclass ()) switch (sym->loc_class ())
{ {
case LOC_TYPEDEF: case LOC_TYPEDEF:
case LOC_BLOCK: case LOC_BLOCK:

View File

@@ -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); return computed_ops->tracepoint_var_ref (var, ax, value);
/* I'm imitating the code in read_var_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. */ case LOC_CONST: /* A constant, like an enum value. */
ax_const_l (ax, (LONGEST) var->value_longest ()); ax_const_l (ax, (LONGEST) var->value_longest ());

View File

@@ -618,7 +618,7 @@ block_iterator_next (struct block_iterator *iterator)
bool bool
best_symbol (struct symbol *a, const domain_search_flags domain) best_symbol (struct symbol *a, const domain_search_flags domain)
{ {
if (a->aclass () == LOC_UNRESOLVED) if (a->loc_class () == LOC_UNRESOLVED)
return false; return false;
if ((domain & SEARCH_VAR_DOMAIN) != 0) 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)) if (b->matches (domain) && !a->matches (domain))
return b; return b;
if (a->aclass () != LOC_UNRESOLVED && b->aclass () == LOC_UNRESOLVED) if (a->loc_class () != LOC_UNRESOLVED && b->loc_class () == LOC_UNRESOLVED)
return a; 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 b;
return a; return a;

View File

@@ -3046,7 +3046,7 @@ classify_name (struct parser_state *par_state, const struct block *block,
par_state->language ()->name_of_this () par_state->language ()->name_of_this ()
? &is_a_field_of_this : NULL); ? &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.sym = bsym;
yylval.ssym.is_a_field_of_this = is_a_field_of_this.type != NULL; 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 (); yylval.tsym.type = bsym.symbol->type ();
return TYPENAME; return TYPENAME;
@@ -3189,7 +3189,7 @@ classify_inner_name (struct parser_state *par_state,
return ERROR; return ERROR;
} }
switch (yylval.ssym.sym.symbol->aclass ()) switch (yylval.ssym.sym.symbol->loc_class ())
{ {
case LOC_BLOCK: case LOC_BLOCK:
case LOC_LABEL: case LOC_LABEL:

View File

@@ -814,7 +814,7 @@ c_type_print_template_args (const struct type_print_options *flags,
{ {
struct symbol *sym = TYPE_TEMPLATE_ARGUMENT (type, i); struct symbol *sym = TYPE_TEMPLATE_ARGUMENT (type, i);
if (sym->aclass () != LOC_TYPEDEF) if (sym->loc_class () != LOC_TYPEDEF)
continue; continue;
if (first) if (first)

View File

@@ -1567,7 +1567,7 @@ patch_opaque_types (struct symtab *s)
Remove syms from the chain when their types are stored, Remove syms from the chain when their types are stored,
but search the whole chain, as there may be several syms but search the whole chain, as there may be several syms
from different files with the same name. */ 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->domain () == TYPE_DOMAIN
&& real_sym->type ()->code () == TYPE_CODE_PTR && real_sym->type ()->code () == TYPE_CODE_PTR
&& real_sym->type ()->target_type ()->length () != 0) && real_sym->type ()->target_type ()->length () != 0)
@@ -1614,7 +1614,7 @@ static const struct symbol_register_ops coff_register_funcs = {
coff_reg_to_regnum coff_reg_to_regnum
}; };
/* The "aclass" index for computed COFF symbols. */ /* The "loc_class" index for computed COFF symbols. */
static int coff_register_index; 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, (lookup_function_type (decode_function_type (cs, cs->c_type,
aux, objfile))); 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 if (cs->c_sclass == C_STAT || cs->c_sclass == C_THUMBSTAT
|| cs->c_sclass == C_THUMBSTATFUNC) || cs->c_sclass == C_THUMBSTATFUNC)
add_symbol_to_list (sym, get_file_symbols ()); add_symbol_to_list (sym, get_file_symbols ());
@@ -1663,14 +1663,14 @@ process_coff_symbol (struct coff_symbol *cs,
break; break;
case C_AUTO: case C_AUTO:
sym->set_aclass_index (LOC_LOCAL); sym->set_loc_class_index (LOC_LOCAL);
add_symbol_to_list (sym, get_local_symbols ()); add_symbol_to_list (sym, get_local_symbols ());
break; break;
case C_THUMBEXT: case C_THUMBEXT:
case C_THUMBEXTFUNC: case C_THUMBEXTFUNC:
case C_EXT: 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 sym->set_value_address ((CORE_ADDR) cs->c_value
+ objfile->section_offsets[SECT_OFF_TEXT (objfile)]); + objfile->section_offsets[SECT_OFF_TEXT (objfile)]);
add_symbol_to_list (sym, get_global_symbols ()); add_symbol_to_list (sym, get_global_symbols ());
@@ -1679,7 +1679,7 @@ process_coff_symbol (struct coff_symbol *cs,
case C_THUMBSTAT: case C_THUMBSTAT:
case C_THUMBSTATFUNC: case C_THUMBSTATFUNC:
case C_STAT: 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 sym->set_value_address ((CORE_ADDR) cs->c_value
+ objfile->section_offsets[SECT_OFF_TEXT (objfile)]); + objfile->section_offsets[SECT_OFF_TEXT (objfile)]);
if (within_function) if (within_function)
@@ -1698,7 +1698,7 @@ process_coff_symbol (struct coff_symbol *cs,
case C_GLBLREG: case C_GLBLREG:
#endif #endif
case C_REG: 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); sym->set_value_longest (cs->c_value);
add_symbol_to_list (sym, get_local_symbols ()); add_symbol_to_list (sym, get_local_symbols ());
break; break;
@@ -1708,20 +1708,20 @@ process_coff_symbol (struct coff_symbol *cs,
break; break;
case C_ARG: case C_ARG:
sym->set_aclass_index (LOC_ARG); sym->set_loc_class_index (LOC_ARG);
sym->set_is_argument (1); sym->set_is_argument (1);
add_symbol_to_list (sym, get_local_symbols ()); add_symbol_to_list (sym, get_local_symbols ());
break; break;
case C_REGPARM: 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_is_argument (1);
sym->set_value_longest (cs->c_value); sym->set_value_longest (cs->c_value);
add_symbol_to_list (sym, get_local_symbols ()); add_symbol_to_list (sym, get_local_symbols ());
break; break;
case C_TPDEF: case C_TPDEF:
sym->set_aclass_index (LOC_TYPEDEF); sym->set_loc_class_index (LOC_TYPEDEF);
sym->set_domain (TYPE_DOMAIN); sym->set_domain (TYPE_DOMAIN);
/* If type has no name, give it one. */ /* If type has no name, give it one. */
@@ -1776,7 +1776,7 @@ process_coff_symbol (struct coff_symbol *cs,
case C_STRTAG: case C_STRTAG:
case C_UNTAG: case C_UNTAG:
case C_ENTAG: case C_ENTAG:
sym->set_aclass_index (LOC_TYPEDEF); sym->set_loc_class_index (LOC_TYPEDEF);
sym->set_domain (STRUCT_DOMAIN); sym->set_domain (STRUCT_DOMAIN);
/* Some compilers try to be helpful by inventing "fake" /* 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); name = obstack_strdup (&objfile->objfile_obstack, name);
sym->set_linkage_name (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_domain (VAR_DOMAIN);
sym->set_value_longest (ms->c_value); sym->set_value_longest (ms->c_value);
add_symbol_to_list (sym, symlist); add_symbol_to_list (sym, symlist);

View File

@@ -61,7 +61,7 @@ convert_one_symbol (compile_c_instance *context,
context->error_symbol_once (sym.symbol); context->error_symbol_once (sym.symbol);
if (sym.symbol->aclass () == LOC_LABEL) if (sym.symbol->loc_class () == LOC_LABEL)
sym_type = 0; sym_type = 0;
else else
sym_type = context->convert_type (sym.symbol->type ()); sym_type = context->convert_type (sym.symbol->type ());
@@ -79,7 +79,7 @@ convert_one_symbol (compile_c_instance *context,
CORE_ADDR addr = 0; CORE_ADDR addr = 0;
gdb::unique_xmalloc_ptr<char> symbol_name; gdb::unique_xmalloc_ptr<char> symbol_name;
switch (sym.symbol->aclass ()) switch (sym.symbol->loc_class ())
{ {
case LOC_TYPEDEF: case LOC_TYPEDEF:
kind = GCC_C_SYMBOL_TYPEDEF; kind = GCC_C_SYMBOL_TYPEDEF;
@@ -536,7 +536,7 @@ generate_c_for_for_one_variable (compile_instance *compiler,
} }
else else
{ {
switch (sym->aclass ()) switch (sym->loc_class ())
{ {
case LOC_REGISTER: case LOC_REGISTER:
case LOC_ARG: case LOC_ARG:

View File

@@ -53,7 +53,7 @@ convert_one_symbol (compile_cplus_instance *instance,
instance->error_symbol_once (sym.symbol); instance->error_symbol_once (sym.symbol);
if (sym.symbol->aclass () == LOC_LABEL) if (sym.symbol->loc_class () == LOC_LABEL)
sym_type = 0; sym_type = 0;
else else
sym_type = instance->convert_type (sym.symbol->type ()); sym_type = instance->convert_type (sym.symbol->type ());
@@ -70,7 +70,7 @@ convert_one_symbol (compile_cplus_instance *instance,
std::string name; std::string name;
gdb::unique_xmalloc_ptr<char> symbol_name; gdb::unique_xmalloc_ptr<char> symbol_name;
switch (sym.symbol->aclass ()) switch (sym.symbol->loc_class ())
{ {
case LOC_TYPEDEF: case LOC_TYPEDEF:
if (sym.symbol->type ()->code () == TYPE_CODE_TYPEDEF) if (sym.symbol->type ()->code () == TYPE_CODE_TYPEDEF)

View File

@@ -1518,7 +1518,7 @@ cp_lookup_rtti_type (const char *name, const struct block *block)
return NULL; 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); warning (_("RTTI symbol for class '%s' is not a type"), name);
return NULL; return NULL;

View File

@@ -328,7 +328,7 @@ set_symbol_address (struct objfile *of, struct symbol *sym, const char *name)
if (msym.minsym != NULL) if (msym.minsym != NULL)
{ {
sym->set_value_address (msym.value_address ()); 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 ()); 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->set_language (language_c, &ccp->of->objfile_obstack);
sym->compute_and_set_names (name, false, ccp->of->per_bfd); 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_domain (VAR_DOMAIN);
sym->set_type (fip->ptype); sym->set_type (fip->ptype);
add_symbol_to_list (sym, ccp->builder->get_global_symbols ()); 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->set_language (language_c, &objfile->objfile_obstack);
sym->compute_and_set_names (name, false, objfile->per_bfd); sym->compute_and_set_names (name, false, objfile->per_bfd);
sym->set_domain (VAR_DOMAIN); sym->set_domain (VAR_DOMAIN);
sym->set_aclass_index (LOC_OPTIMIZED_OUT); sym->set_loc_class_index (LOC_OPTIMIZED_OUT);
if (type != nullptr) if (type != nullptr)
sym->set_type (type); 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_STRUCT:
case CTF_K_UNION: case CTF_K_UNION:
case CTF_K_ENUM: case CTF_K_ENUM:
sym->set_aclass_index (LOC_TYPEDEF); sym->set_loc_class_index (LOC_TYPEDEF);
sym->set_domain (STRUCT_DOMAIN); sym->set_domain (STRUCT_DOMAIN);
break; break;
case CTF_K_FUNCTION: 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 ()); set_symbol_address (objfile, sym, sym->linkage_name ());
break; break;
case CTF_K_CONST: 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_TYPEDEF:
case CTF_K_INTEGER: case CTF_K_INTEGER:
case CTF_K_FLOAT: case CTF_K_FLOAT:
sym->set_aclass_index (LOC_TYPEDEF); sym->set_loc_class_index (LOC_TYPEDEF);
sym->set_domain (TYPE_DOMAIN); sym->set_domain (TYPE_DOMAIN);
break; break;
case CTF_K_POINTER: 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++); OBJSTAT (ccp->of, n_syms++);
sym->set_type (type); sym->set_type (type);
sym->set_domain (VAR_DOMAIN); 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); sym->compute_and_set_names (name, false, ccp->of->per_bfd);
add_symbol_to_list (sym, ccp->builder->get_file_symbols ()); add_symbol_to_list (sym, ccp->builder->get_file_symbols ());
break; break;
@@ -1205,7 +1205,7 @@ add_stt_entries (struct ctf_context *ccp, int functions)
OBJSTAT (ccp->of, n_syms++); OBJSTAT (ccp->of, n_syms++);
sym->set_type (type); sym->set_type (type);
sym->set_domain (VAR_DOMAIN); 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); sym->compute_and_set_names (tname, false, ccp->of->per_bfd);
add_symbol_to_list (sym, ccp->builder->get_global_symbols ()); add_symbol_to_list (sym, ccp->builder->get_global_symbols ());
set_symbol_address (ccp->of, sym, tname); 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) while ((tid = ctf_symbol_next (cfp, &i, &tname, functions)) != CTF_ERR)
{ {
uint32_t kind = ctf_type_kind (cfp, tid); uint32_t kind = ctf_type_kind (cfp, tid);
address_class aclass; location_class loc_class;
domain_enum tdomain; domain_enum tdomain;
switch (kind) switch (kind)
{ {
@@ -1324,14 +1324,14 @@ ctf_psymtab_add_stt_entries (ctf_dict_t *cfp, ctf_psymtab *pst,
} }
if (kind == CTF_K_FUNCTION) if (kind == CTF_K_FUNCTION)
aclass = LOC_STATIC; loc_class = LOC_STATIC;
else if (kind == CTF_K_CONST) else if (kind == CTF_K_CONST)
aclass = LOC_CONST; loc_class = LOC_CONST;
else else
aclass = LOC_TYPEDEF; loc_class = LOC_TYPEDEF;
pst->add_psymbol (tname, true, pst->add_psymbol (tname, true,
tdomain, aclass, -1, tdomain, loc_class, -1,
psymbol_placement::GLOBAL, psymbol_placement::GLOBAL,
unrelocated_addr (0), unrelocated_addr (0),
language_c, pst->context.partial_symtabs, of); 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; ccp = (struct ctf_context *) arg;
domain_enum domain = UNDEF_DOMAIN; domain_enum domain = UNDEF_DOMAIN;
enum address_class aclass = LOC_UNDEF; location_class loc_class = LOC_UNDEF;
kind = ctf_type_kind (ccp->fp, tid); kind = ctf_type_kind (ccp->fp, tid);
switch (kind) switch (kind)
{ {
@@ -1475,29 +1475,29 @@ ctf_psymtab_type_cb (ctf_id_t tid, void *arg)
case CTF_K_STRUCT: case CTF_K_STRUCT:
case CTF_K_UNION: case CTF_K_UNION:
domain = STRUCT_DOMAIN; domain = STRUCT_DOMAIN;
aclass = LOC_TYPEDEF; loc_class = LOC_TYPEDEF;
break; break;
case CTF_K_FUNCTION: case CTF_K_FUNCTION:
case CTF_K_FORWARD: case CTF_K_FORWARD:
domain = VAR_DOMAIN; domain = VAR_DOMAIN;
aclass = LOC_STATIC; loc_class = LOC_STATIC;
section = SECT_OFF_TEXT (ccp->of); section = SECT_OFF_TEXT (ccp->of);
break; break;
case CTF_K_CONST: case CTF_K_CONST:
domain = VAR_DOMAIN; domain = VAR_DOMAIN;
aclass = LOC_STATIC; loc_class = LOC_STATIC;
break; break;
case CTF_K_TYPEDEF: case CTF_K_TYPEDEF:
case CTF_K_POINTER: case CTF_K_POINTER:
case CTF_K_VOLATILE: case CTF_K_VOLATILE:
case CTF_K_RESTRICT: case CTF_K_RESTRICT:
domain = VAR_DOMAIN; domain = VAR_DOMAIN;
aclass = LOC_TYPEDEF; loc_class = LOC_TYPEDEF;
break; break;
case CTF_K_INTEGER: case CTF_K_INTEGER:
case CTF_K_FLOAT: case CTF_K_FLOAT:
domain = VAR_DOMAIN; domain = VAR_DOMAIN;
aclass = LOC_TYPEDEF; loc_class = LOC_TYPEDEF;
break; break;
case CTF_K_ARRAY: case CTF_K_ARRAY:
case CTF_K_UNKNOWN: case CTF_K_UNKNOWN:
@@ -1509,7 +1509,7 @@ ctf_psymtab_type_cb (ctf_id_t tid, void *arg)
return 0; return 0;
ccp->pst->add_psymbol (name, false, ccp->pst->add_psymbol (name, false,
domain, aclass, section, domain, loc_class, section,
psymbol_placement::STATIC, psymbol_placement::STATIC,
unrelocated_addr (0), unrelocated_addr (0),
language_c, ccp->partial_symtabs, ccp->of); language_c, ccp->partial_symtabs, ccp->of);

View File

@@ -444,7 +444,7 @@ PrimaryExpression:
sym = lookup_symbol (copy.c_str (), sym = lookup_symbol (copy.c_str (),
pstate->expression_context_block, pstate->expression_context_block,
SEARCH_VFT, &is_a_field_of_this); 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)) if (symbol_read_needs_frame (sym.symbol))
pstate->block_tracker->update (sym); 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); std::string copy = copy_name (yylval.sval);
sym = lookup_symbol (copy.c_str (), block, SEARCH_VFT, &is_a_field_of_this); 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 (); yylval.tsym.type = sym.symbol->type ();
return TYPENAME; return TYPENAME;
@@ -1383,7 +1383,7 @@ classify_inner_name (struct parser_state *par_state,
if (yylval.ssym.sym.symbol == NULL) if (yylval.ssym.sym.symbol == NULL)
return ERROR; 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 (); yylval.tsym.type = yylval.ssym.sym.symbol->type ();
return TYPENAME; return TYPENAME;

View File

@@ -109,7 +109,7 @@ ada_alias_get_block_value (const struct symbol *sym)
if (real_symbol.symbol == nullptr) if (real_symbol.symbol == nullptr)
error (_("could not find alias '%s' for function '%s'"), error (_("could not find alias '%s' for function '%s'"),
name, sym->print_name ()); 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"), error (_("alias '%s' for function '%s' is not a function"),
name, sym->print_name ()); name, sym->print_name ());

View File

@@ -147,7 +147,7 @@ static const registry<bfd>::key<dwarf2_per_bfd> dwarf2_per_bfd_bfd_data_key;
static const registry<objfile>::key<dwarf2_per_bfd> static const registry<objfile>::key<dwarf2_per_bfd>
dwarf2_per_bfd_objfile_data_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_locexpr_index;
static int dwarf2_loclist_index; static int dwarf2_loclist_index;
@@ -4261,7 +4261,7 @@ fixup_go_packaging (struct dwarf2_cu *cu)
struct symbol *sym = list->symbol[i]; struct symbol *sym = list->symbol[i];
if (sym->language () == language_go if (sym->language () == language_go
&& sym->aclass () == LOC_BLOCK) && sym->loc_class () == LOC_BLOCK)
{ {
gdb::unique_xmalloc_ptr<char> this_package_name gdb::unique_xmalloc_ptr<char> this_package_name
= go_symbol_package_name (sym); = 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->set_language (language_go, &objfile->objfile_obstack);
sym->compute_and_set_names (saved_package_name, false, objfile->per_bfd); sym->compute_and_set_names (saved_package_name, false, objfile->per_bfd);
sym->set_domain (TYPE_DOMAIN); sym->set_domain (TYPE_DOMAIN);
sym->set_aclass_index (LOC_TYPEDEF); sym->set_loc_class_index (LOC_TYPEDEF);
sym->set_type (type); sym->set_type (type);
add_symbol_to_list (sym, cu->get_builder ()->get_global_symbols ()); 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); type = die_type (d, imported_cu);
struct symbol *sym = new_symbol (die, type, cu); struct symbol *sym = new_symbol (die, type, cu);
attr = dwarf2_attr (d, DW_AT_location, imported_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) if (attr != nullptr)
var_decode_location (attr, sym, cu); var_decode_location (attr, sym, cu);
return true; return true;
@@ -12412,7 +12412,7 @@ mark_common_block_symbol_computed (struct symbol *sym,
gdb_assert (ptr - baton->data == baton->size); gdb_assert (ptr - baton->data == baton->size);
SYMBOL_LOCATION_BATON (sym) = baton; 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 /* 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. */ variable has been optimized away. */
if (attr->form_is_block () && attr->as_block ()->size == 0) 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; return;
} }
@@ -16689,7 +16689,7 @@ var_decode_location (struct attribute *attr, struct symbol *sym,
else else
tem = read_addr_index_from_leb128 (cu, block->data + 1, &dummy); tem = read_addr_index_from_leb128 (cu, block->data + 1, &dummy);
sym->set_value_address ((CORE_ADDR) tem); 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); fixup_symbol_section (sym, objfile);
sym->set_value_address sym->set_value_address
(sym->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); = new (&cu->per_objfile->objfile->objfile_obstack) symbol (*orig);
copy->set_linkage_name (new_name); copy->set_linkage_name (new_name);
SYMBOL_LOCATION_BATON (copy) = (void *) orig_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_block_index
: ada_imported_index); : ada_imported_index);
add_symbol_to_list (copy, list_to_add); 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. /* Default assumptions.
Use the passed type or decode it from the die. */ Use the passed type or decode it from the die. */
sym->set_domain (UNDEF_DOMAIN); sym->set_domain (UNDEF_DOMAIN);
sym->set_aclass_index (LOC_OPTIMIZED_OUT); sym->set_loc_class_index (LOC_OPTIMIZED_OUT);
if (type != NULL) if (type != NULL)
sym->set_type (type); sym->set_type (type);
else 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 ()); CORE_ADDR addr = per_objfile->relocate (attr->as_address ());
sym->set_section_index (SECT_OFF_TEXT (objfile)); sym->set_section_index (SECT_OFF_TEXT (objfile));
sym->set_value_address (addr); sym->set_value_address (addr);
sym->set_aclass_index (LOC_LABEL); sym->set_loc_class_index (LOC_LABEL);
} }
else 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_type (builtin_type (objfile)->builtin_core_addr);
sym->set_domain (LABEL_DOMAIN); sym->set_domain (LABEL_DOMAIN);
list_to_add = cu->list_in_scope; 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 /* SYMBOL_BLOCK_VALUE (sym) will be filled in later by
finish_block. */ finish_block. */
sym->set_domain (FUNCTION_DOMAIN); 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 /* DW_TAG_entry_point provides an additional entry_point to an
existing sub_program. Therefore, we inherit the "external" existing sub_program. Therefore, we inherit the "external"
attribute from the sub_program to which the entry_point 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 /* SYMBOL_BLOCK_VALUE (sym) will be filled in later by
finish_block. */ finish_block. */
sym->set_domain (FUNCTION_DOMAIN); 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); attr2 = dwarf2_attr (die, DW_AT_external, cu);
if ((attr2 != nullptr && attr2->as_boolean ()) if ((attr2 != nullptr && attr2->as_boolean ())
|| cu->lang () == language_ada || 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 /* For Import, create a symbol using the source
name, and have it refer to the linkage name. */ name, and have it refer to the linkage name. */
SYMBOL_LOCATION_BATON (sym) = (void *) linkagename; SYMBOL_LOCATION_BATON (sym) = (void *) linkagename;
sym->set_aclass_index (ada_block_index); sym->set_loc_class_index (ada_block_index);
} }
else 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 /* SYMBOL_BLOCK_VALUE (sym) will be filled in later by
finish_block. */ finish_block. */
sym->set_domain (FUNCTION_DOMAIN); sym->set_domain (FUNCTION_DOMAIN);
sym->set_aclass_index (LOC_BLOCK); sym->set_loc_class_index (LOC_BLOCK);
sym->set_is_inlined (1); sym->set_is_inlined (1);
list_to_add = cu->list_in_scope; list_to_add = cu->list_in_scope;
break; 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) && die->parent->tag == DW_TAG_common_block)
attr2 = NULL; attr2 = NULL;
if (sym->aclass () == LOC_STATIC if (sym->loc_class () == LOC_STATIC
&& sym->value_address () == 0 && sym->value_address () == 0
&& !per_objfile->per_bfd->has_section_at_zero) && !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 ()) else if (attr2 != nullptr && attr2->as_boolean ())
{ {
if (sym->aclass () == LOC_STATIC if (sym->loc_class () == LOC_STATIC
&& (objfile->flags & OBJF_MAINLINE) == 0 && (objfile->flags & OBJF_MAINLINE) == 0
&& per_objfile->per_bfd->can_copy) && 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->get_builder ()->get_global_symbols ()
: cu->list_in_scope); : cu->list_in_scope);
SYMBOL_LOCATION_BATON (sym) = (void *) linkagename; 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 () else if (attr2 != nullptr && attr2->as_boolean ()
&& dwarf2_attr (die, DW_AT_type, cu) != NULL) && 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->get_builder ()->get_global_symbols ()
: cu->list_in_scope); : cu->list_in_scope);
sym->set_aclass_index (LOC_UNRESOLVED); sym->set_loc_class_index (LOC_UNRESOLVED);
} }
else if (!die_is_declaration (die, cu)) else if (!die_is_declaration (die, cu))
{ {
/* Use the default LOC_OPTIMIZED_OUT class. */ /* 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) if (!suppress_add)
list_to_add = cu->list_in_scope; 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, there's a special hack for C++ in the matching code,
so we don't need to enter a separate typedef for the so we don't need to enter a separate typedef for the
tag. */ tag. */
sym->set_aclass_index (LOC_TYPEDEF); sym->set_loc_class_index (LOC_TYPEDEF);
sym->set_domain (STRUCT_DOMAIN); sym->set_domain (STRUCT_DOMAIN);
} }
else else
{ {
/* Other languages don't have a tag namespace. */ /* 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); 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_base_type:
case DW_TAG_subrange_type: case DW_TAG_subrange_type:
case DW_TAG_generic_subrange: case DW_TAG_generic_subrange:
sym->set_aclass_index (LOC_TYPEDEF); sym->set_loc_class_index (LOC_TYPEDEF);
sym->set_domain (TYPE_DOMAIN); sym->set_domain (TYPE_DOMAIN);
list_to_add = cu->list_in_scope; list_to_add = cu->list_in_scope;
break; 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_imported_declaration:
case DW_TAG_namespace: case DW_TAG_namespace:
sym->set_domain (TYPE_DOMAIN); 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 (); list_to_add = cu->get_builder ()->get_global_symbols ();
break; break;
case DW_TAG_module: case DW_TAG_module:
sym->set_aclass_index (LOC_TYPEDEF); sym->set_loc_class_index (LOC_TYPEDEF);
sym->set_domain (MODULE_DOMAIN); sym->set_domain (MODULE_DOMAIN);
list_to_add = cu->get_builder ()->get_global_symbols (); list_to_add = cu->get_builder ()->get_global_symbols ();
break; break;
case DW_TAG_common_block: 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); sym->set_domain (COMMON_BLOCK_DOMAIN);
list_to_add = cu->list_in_scope; list_to_add = cu->list_in_scope;
break; break;
case DW_TAG_namelist: case DW_TAG_namelist:
sym->set_aclass_index (LOC_STATIC); sym->set_loc_class_index (LOC_STATIC);
sym->set_domain (VAR_DOMAIN); sym->set_domain (VAR_DOMAIN);
list_to_add = cu->list_in_scope; list_to_add = cu->list_in_scope;
break; break;
@@ -17396,17 +17396,17 @@ dwarf2_const_value (const struct attribute *attr, struct symbol *sym,
if (baton != NULL) if (baton != NULL)
{ {
SYMBOL_LOCATION_BATON (sym) = baton; SYMBOL_LOCATION_BATON (sym) = baton;
sym->set_aclass_index (dwarf2_locexpr_index); sym->set_loc_class_index (dwarf2_locexpr_index);
} }
else if (bytes != NULL) else if (bytes != NULL)
{ {
sym->set_value_bytes (bytes); sym->set_value_bytes (bytes);
sym->set_aclass_index (LOC_CONST_BYTES); sym->set_loc_class_index (LOC_CONST_BYTES);
} }
else else
{ {
sym->set_value_longest (value); 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: case DW_OP_deref:
/* If we're not the last op, then we definitely can't encode /* 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 global symbols, although the variable's address will be bogus
in the psymtab. */ in the psymtab. */
if (i < size) if (i < size)
@@ -19219,7 +19219,7 @@ dwarf2_symbol_mark_computed (const struct attribute *attr, struct symbol *sym,
complaint (_("Location list used without " complaint (_("Location list used without "
"specifying the CU base address.")); "specifying the CU base address."));
sym->set_aclass_index ((is_block sym->set_loc_class_index ((is_block
? dwarf2_loclist_block_index ? dwarf2_loclist_block_index
: dwarf2_loclist_index)); : dwarf2_loclist_index));
SYMBOL_LOCATION_BATON (sym) = baton; SYMBOL_LOCATION_BATON (sym) = baton;
@@ -19252,7 +19252,7 @@ dwarf2_symbol_mark_computed (const struct attribute *attr, struct symbol *sym,
baton->size = 0; baton->size = 0;
} }
sym->set_aclass_index ((is_block sym->set_loc_class_index ((is_block
? dwarf2_locexpr_block_index ? dwarf2_locexpr_block_index
: dwarf2_locexpr_index)); : dwarf2_locexpr_index));
SYMBOL_LOCATION_BATON (sym) = baton; SYMBOL_LOCATION_BATON (sym) = baton;

View File

@@ -2678,11 +2678,11 @@ var_value_operation::evaluate_for_address (struct expression *exp,
if (noside == EVAL_AVOID_SIDE_EFFECTS) if (noside == EVAL_AVOID_SIDE_EFFECTS)
{ {
struct type *type = lookup_pointer_type (var->type ()); 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 if (loc_class == LOC_CONST
|| sym_class == LOC_CONST_BYTES || loc_class == LOC_CONST_BYTES
|| sym_class == LOC_REGISTER) || loc_class == LOC_REGISTER)
error (_("Attempt to take address of register or constant.")); error (_("Attempt to take address of register or constant."));
return value::zero (type, not_lval); return value::zero (type, not_lval);

View File

@@ -476,11 +476,11 @@ check_constant (const gdb_mpz &cst)
static inline bool static inline bool
check_constant (struct symbol *sym) check_constant (struct symbol *sym)
{ {
enum address_class sc = sym->aclass (); location_class lc = sym->loc_class ();
return (sc == LOC_BLOCK return (lc == LOC_BLOCK
|| sc == LOC_CONST || lc == LOC_CONST
|| sc == LOC_CONST_BYTES || lc == LOC_CONST_BYTES
|| sc == LOC_LABEL); || lc == LOC_LABEL);
} }
static inline bool static inline bool

View File

@@ -1663,7 +1663,7 @@ yylex (void)
{ {
result = lookup_symbol (tmp.c_str (), pstate->expression_context_block, result = lookup_symbol (tmp.c_str (), pstate->expression_context_block,
domain, NULL); 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 (); yylval.tsym.type = result.symbol->type ();
return TYPENAME; return TYPENAME;

View File

@@ -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 (); const struct common_block *common = sym->value_common_block ();
size_t index; size_t index;
gdb_assert (sym->aclass () == LOC_COMMON_BLOCK); gdb_assert (sym->loc_class () == LOC_COMMON_BLOCK);
if (comname && (!sym->linkage_name () if (comname && (!sym->linkage_name ()
|| strcmp (comname, sym->linkage_name ()) != 0)) || strcmp (comname, sym->linkage_name ()) != 0))

View File

@@ -124,7 +124,7 @@ symbol_read_needs (struct symbol *sym)
computed_ops != nullptr) computed_ops != nullptr)
return computed_ops->get_symbol_read_needs (sym); 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 /* All cases listed explicitly so that gcc -Wall will detect it if
we failed to consider one. */ 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 ()) if (const symbol_computed_ops *computed_ops = var->computed_ops ())
return computed_ops->read_variable (var, frame); return computed_ops->read_variable (var, frame);
switch (var->aclass ()) switch (var->loc_class ())
{ {
case LOC_CONST: case LOC_CONST:
if (is_dynamic_type (type)) 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 (); const symbol_register_ops *reg_ops = var->register_ops ();
int regno = reg_ops->register_number (var, get_frame_arch (frame)); 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 addr = value_as_address
(value_from_register (lookup_pointer_type (type), regno, frame)); (value_from_register (lookup_pointer_type (type), regno, frame));
else else

View File

@@ -2617,7 +2617,7 @@ inside_main_func (const frame_info_ptr &this_frame)
SEARCH_FUNCTION_DOMAIN, nullptr); SEARCH_FUNCTION_DOMAIN, nullptr);
/* This lookup should always yield a block-valued symbol. */ /* 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 (); const struct block *block = bs.symbol->value_block ();
gdb_assert (block != nullptr); gdb_assert (block != nullptr);

View File

@@ -1290,7 +1290,7 @@ package_name_p (const char *name, const struct block *block)
&is_a_field_of_this).symbol; &is_a_field_of_this).symbol;
if (sym if (sym
&& sym->aclass () == LOC_TYPEDEF && sym->loc_class () == LOC_TYPEDEF
&& sym->type ()->code () == TYPE_CODE_MODULE) && sym->type ()->code () == TYPE_CODE_MODULE)
return 1; return 1;

View File

@@ -405,7 +405,7 @@ gdbscm_symbol_addr_class (SCM self)
= syscm_get_valid_symbol_smob_arg_unsafe (self, SCM_ARG1, FUNC_NAME); = syscm_get_valid_symbol_smob_arg_unsafe (self, SCM_ARG1, FUNC_NAME);
const struct symbol *symbol = s_smob->symbol; const struct symbol *symbol = s_smob->symbol;
return scm_from_int (symbol->aclass ()); return scm_from_int (symbol->loc_class ());
} }
/* (symbol-argument? <gdb:symbol>) -> boolean */ /* (symbol-argument? <gdb:symbol>) -> boolean */
@@ -428,11 +428,9 @@ gdbscm_symbol_constant_p (SCM self)
symbol_smob *s_smob symbol_smob *s_smob
= syscm_get_valid_symbol_smob_arg_unsafe (self, SCM_ARG1, FUNC_NAME); = syscm_get_valid_symbol_smob_arg_unsafe (self, SCM_ARG1, FUNC_NAME);
const struct symbol *symbol = s_smob->symbol; 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 (loc_class == LOC_CONST || loc_class == LOC_CONST_BYTES);
return scm_from_bool (theclass == LOC_CONST || theclass == LOC_CONST_BYTES);
} }
/* (symbol-function? <gdb:symbol>) -> boolean */ /* (symbol-function? <gdb:symbol>) -> boolean */
@@ -443,11 +441,9 @@ gdbscm_symbol_function_p (SCM self)
symbol_smob *s_smob symbol_smob *s_smob
= syscm_get_valid_symbol_smob_arg_unsafe (self, SCM_ARG1, FUNC_NAME); = syscm_get_valid_symbol_smob_arg_unsafe (self, SCM_ARG1, FUNC_NAME);
const struct symbol *symbol = s_smob->symbol; 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 (loc_class == LOC_BLOCK);
return scm_from_bool (theclass == LOC_BLOCK);
} }
/* (symbol-variable? <gdb:symbol>) -> boolean */ /* (symbol-variable? <gdb:symbol>) -> boolean */
@@ -458,14 +454,12 @@ gdbscm_symbol_variable_p (SCM self)
symbol_smob *s_smob symbol_smob *s_smob
= syscm_get_valid_symbol_smob_arg_unsafe (self, SCM_ARG1, FUNC_NAME); = syscm_get_valid_symbol_smob_arg_unsafe (self, SCM_ARG1, FUNC_NAME);
const struct symbol *symbol = s_smob->symbol; 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 (!symbol->is_argument () return scm_from_bool (!symbol->is_argument ()
&& (theclass == LOC_LOCAL || theclass == LOC_REGISTER && (loc_class == LOC_LOCAL || loc_class == LOC_REGISTER
|| theclass == LOC_STATIC || theclass == LOC_COMPUTED || loc_class == LOC_STATIC || loc_class == LOC_COMPUTED
|| theclass == LOC_OPTIMIZED_OUT)); || loc_class == LOC_OPTIMIZED_OUT));
} }
/* (symbol-needs-frame? <gdb:symbol>) -> boolean /* (symbol-needs-frame? <gdb:symbol>) -> boolean
@@ -526,7 +520,7 @@ gdbscm_symbol_value (SCM self, SCM rest)
if (!gdbscm_is_false (frame_scm)) if (!gdbscm_is_false (frame_scm))
f_smob = frscm_get_frame_smob_arg_unsafe (frame_scm, frame_pos, FUNC_NAME); 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, gdbscm_out_of_range_error (FUNC_NAME, SCM_ARG1, self,
_("cannot get the value of a typedef")); _("cannot get the value of a typedef"));

View File

@@ -989,7 +989,7 @@ prepare_one_step (thread_info *tp, struct step_command_fsm *sm)
if (inline_skipped_frames (tp) > 0) if (inline_skipped_frames (tp) > 0)
{ {
const symbol *sym = inline_skipped_symbol (tp); const symbol *sym = inline_skipped_symbol (tp);
if (sym->aclass () == LOC_BLOCK) if (sym->loc_class () == LOC_BLOCK)
{ {
const block *block = sym->value_block (); const block *block = sym->value_block ();
if (block->end () < tp->control.step_range_end) if (block->end () < tp->control.step_range_end)

View File

@@ -584,7 +584,7 @@ finalize_symtab (struct gdb_symtab *stab, struct objfile *objfile)
/* The name. */ /* The name. */
block_name->set_domain (FUNCTION_DOMAIN); 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_symtab (filetab);
block_name->set_type (lookup_function_type (block_type)); block_name->set_type (lookup_function_type (block_type));
block_name->set_value_block (new_block); block_name->set_value_block (new_block);

View File

@@ -976,7 +976,7 @@ language_arch_info::type_and_symbol::alloc_type_symbol
symbol->set_section_index (0); symbol->set_section_index (0);
symbol->set_type (type); symbol->set_type (type);
symbol->set_domain (TYPE_DOMAIN); symbol->set_domain (TYPE_DOMAIN);
symbol->set_aclass_index (LOC_TYPEDEF); symbol->set_loc_class_index (LOC_TYPEDEF);
return symbol; return symbol;
} }

View File

@@ -230,7 +230,7 @@ collect_info::add_symbol (block_symbol *bsym)
{ {
/* In list mode, add all matching symbols, regardless of class. /* In list mode, add all matching symbols, regardless of class.
This allows the user to type "list a_global_variable". */ 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); this->result.symbols->push_back (*bsym);
/* Continue iterating. */ /* 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. */ line 16 will also result in a breakpoint in main, at line 17. */
if (!was_exact if (!was_exact
&& sym != nullptr && sym != nullptr
&& sym->aclass () == LOC_BLOCK && sym->loc_class () == LOC_BLOCK
&& sal.pc == sym->value_block ()->entry_pc () && sal.pc == sym->value_block ()->entry_pc ()
&& val.line < sym->line ()) && val.line < sym->line ())
continue; continue;
@@ -2224,7 +2224,7 @@ convert_linespec_to_sals (struct linespec_state *state, linespec *ls)
if (state->funfirstline if (state->funfirstline
&& !ls->minimal_symbols.empty () && !ls->minimal_symbols.empty ()
&& sym.symbol->aclass () == LOC_BLOCK) && sym.symbol->loc_class () == LOC_BLOCK)
{ {
const CORE_ADDR addr const CORE_ADDR addr
= sym.symbol->value_block ()->entry_pc (); = sym.symbol->value_block ()->entry_pc ();
@@ -3361,7 +3361,7 @@ decode_compound_collector::operator () (block_symbol *bsym)
struct type *t; struct type *t;
struct symbol *sym = bsym->symbol; struct symbol *sym = bsym->symbol;
if (sym->aclass () != LOC_TYPEDEF) if (sym->loc_class () != LOC_TYPEDEF)
return true; /* Continue iterating. */ return true; /* Continue iterating. */
t = sym->type (); t = sym->type ();
@@ -4316,14 +4316,14 @@ static bool
symbol_to_sal (struct symtab_and_line *result, symbol_to_sal (struct symtab_and_line *result,
bool funfirstline, struct symbol *sym) bool funfirstline, struct symbol *sym)
{ {
if (sym->aclass () == LOC_BLOCK) if (sym->loc_class () == LOC_BLOCK)
{ {
*result = find_function_start_sal (sym, funfirstline); *result = find_function_start_sal (sym, funfirstline);
return true; return true;
} }
else else
{ {
if (sym->aclass () == LOC_LABEL && sym->value_address () != 0) if (sym->loc_class () == LOC_LABEL && sym->value_address () != 0)
{ {
*result = {}; *result = {};
result->symtab = sym->symtab (); result->symtab = sym->symtab ();

View File

@@ -507,7 +507,7 @@ fblock : block COLONCOLON BLOCKNAME
{ struct symbol *tem { struct symbol *tem
= lookup_symbol (copy_name ($3).c_str (), $1, = lookup_symbol (copy_name ($3).c_str (), $1,
SEARCH_VFT, 0).symbol; SEARCH_VFT, 0).symbol;
if (!tem || tem->aclass () != LOC_BLOCK) if (!tem || tem->loc_class () != LOC_BLOCK)
error (_("No function \"%s\" in specified context."), error (_("No function \"%s\" in specified context."),
copy_name ($3).c_str ()); copy_name ($3).c_str ());
$$ = tem; $$ = tem;
@@ -928,7 +928,7 @@ yylex (void)
sym = lookup_symbol (tmp.c_str (), pstate->expression_context_block, sym = lookup_symbol (tmp.c_str (), pstate->expression_context_block,
SEARCH_VFT, 0).symbol; SEARCH_VFT, 0).symbol;
if (sym && sym->aclass () == LOC_BLOCK) if (sym && sym->loc_class () == LOC_BLOCK)
return BLOCKNAME; return BLOCKNAME;
if (lookup_typename (pstate->language (), if (lookup_typename (pstate->language (),
tmp.c_str (), pstate->expression_context_block, 1)) tmp.c_str (), pstate->expression_context_block, 1))
@@ -936,7 +936,7 @@ yylex (void)
if(sym) if(sym)
{ {
switch(sym->aclass ()) switch(sym->loc_class ())
{ {
case LOC_STATIC: case LOC_STATIC:
case LOC_REGISTER: case LOC_REGISTER:

View File

@@ -248,7 +248,7 @@ static struct type *parse_type (int, union aux_ext *, unsigned int, int *,
int, const char *); int, const char *);
static struct symbol *mylookup_symbol (const char *, const struct block *, 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 *); static void sort_blocks (struct symtab *);
@@ -550,7 +550,7 @@ static const struct symbol_register_ops mdebug_register_funcs = {
mdebug_reg_to_regnum 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_register_index;
static int mdebug_regparm_index; static int mdebug_regparm_index;
@@ -559,11 +559,11 @@ static int mdebug_regparm_index;
static void static void
add_data_symbol (SYMR *sh, union aux_ext *ax, int bigend, 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) struct objfile *objfile, const char *name)
{ {
s->set_domain (VAR_DOMAIN); 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); add_symbol (s, top_stack->cur_st, b);
/* Type could be missing if file is compiled without debugging info. */ /* 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: case scRegister:
/* Pass by value in register. */ /* Pass by value in register. */
s->set_aclass_index (mdebug_register_index); s->set_loc_class_index (mdebug_register_index);
break; break;
case scVar: case scVar:
/* Pass by reference on stack. */ /* Pass by reference on stack. */
s->set_aclass_index (LOC_REF_ARG); s->set_loc_class_index (LOC_REF_ARG);
break; break;
case scVarRegister: case scVarRegister:
/* Pass by reference in register. */ /* Pass by reference in register. */
s->set_aclass_index (mdebug_regparm_index); s->set_loc_class_index (mdebug_regparm_index);
break; break;
default: default:
/* Pass by value on stack. */ /* Pass by value on stack. */
s->set_aclass_index (LOC_ARG); s->set_loc_class_index (LOC_ARG);
break; break;
} }
s->set_value_longest (svalue); 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. */ case stLabel: /* label, goes into current block. */
s = new_symbol (name); s = new_symbol (name);
s->set_domain (LABEL_DOMAIN); /* So that it can be used */ 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_section_index (section_index);
s->set_value_address (sh->value); s->set_value_address (sh->value);
s->set_type (builtin_type (objfile)->builtin_int); 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 = new_symbol (name);
s->set_domain (FUNCTION_DOMAIN); s->set_domain (FUNCTION_DOMAIN);
s->set_aclass_index (LOC_BLOCK); s->set_loc_class_index (LOC_BLOCK);
s->set_section_index (section_index); s->set_section_index (section_index);
/* Type of the return value. */ /* Type of the return value. */
if (SC_IS_UNDEF (sh->sc) || sh->sc == scNil) 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 enum_sym->set_linkage_name
(obstack_strdup (&mdebugread_objfile->objfile_obstack, (obstack_strdup (&mdebugread_objfile->objfile_obstack,
f->name ())); 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_type (t);
enum_sym->set_domain (VAR_DOMAIN); enum_sym->set_domain (VAR_DOMAIN);
enum_sym->set_value_longest (tsym.value); 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 = new_symbol (name);
s->set_domain (STRUCT_DOMAIN); 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_value_longest (0);
s->set_type (t); s->set_type (t);
add_symbol (s, top_stack->cur_st, top_stack->cur_block); 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. */ /* Make up special symbol to contain procedure specific info. */
s = new_symbol (MDEBUG_EFI_SYMBOL_NAME); s = new_symbol (MDEBUG_EFI_SYMBOL_NAME);
s->set_domain (LABEL_DOMAIN); 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); s->set_type (builtin_type (mdebugread_objfile)->builtin_void);
e = OBSTACK_ZALLOC (&mdebugread_objfile->objfile_obstack, e = OBSTACK_ZALLOC (&mdebugread_objfile->objfile_obstack,
mdebug_extra_func_info); mdebug_extra_func_info);
@@ -1297,7 +1297,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend,
break; break;
s = new_symbol (name); s = new_symbol (name);
s->set_domain (TYPE_DOMAIN); 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_value_block (top_stack->cur_block);
s->set_type (t); s->set_type (t);
add_symbol (s, top_stack->cur_st, top_stack->cur_block); 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;) for (cur_sdx = 0; cur_sdx < fh->csym;)
{ {
char *sym_name; char *sym_name;
enum address_class theclass; location_class loc_class;
unrelocated_addr minsym_value; unrelocated_addr minsym_value;
int section = -1; int section = -1;
@@ -3526,7 +3526,7 @@ parse_partial_symbols (minimal_symbol_reader &reader,
reader.record_with_info (sym_name, minsym_value, reader.record_with_info (sym_name, minsym_value,
mst_file_bss, mst_file_bss,
SECT_OFF_BSS (objfile)); SECT_OFF_BSS (objfile));
theclass = LOC_STATIC; loc_class = LOC_STATIC;
break; break;
case stIndirect: /* Irix5 forward declaration */ case stIndirect: /* Irix5 forward declaration */
@@ -3538,11 +3538,11 @@ parse_partial_symbols (minimal_symbol_reader &reader,
structs from alpha and mips cc. */ structs from alpha and mips cc. */
if (sh.iss == 0 || has_opaque_xref (fh, &sh)) if (sh.iss == 0 || has_opaque_xref (fh, &sh))
goto skip; goto skip;
theclass = LOC_TYPEDEF; loc_class = LOC_TYPEDEF;
break; break;
case stConstant: /* Constant decl */ case stConstant: /* Constant decl */
theclass = LOC_CONST; loc_class = LOC_CONST;
break; break;
case stUnion: case stUnion:
@@ -3600,7 +3600,7 @@ parse_partial_symbols (minimal_symbol_reader &reader,
} }
/* Use this gdb symbol. */ /* Use this gdb symbol. */
pst->add_psymbol (sym_name, true, pst->add_psymbol (sym_name, true,
VAR_DOMAIN, theclass, section, VAR_DOMAIN, loc_class, section,
psymbol_placement::STATIC, psymbol_placement::STATIC,
unrelocated_addr (sh.value), unrelocated_addr (sh.value),
psymtab_language, psymtab_language,
@@ -3616,7 +3616,7 @@ parse_partial_symbols (minimal_symbol_reader &reader,
PST_PRIVATE (save_pst)->extern_tab = ext_ptr; PST_PRIVATE (save_pst)->extern_tab = ext_ptr;
for (; --cur_sdx >= 0; ext_ptr++) for (; --cur_sdx >= 0; ext_ptr++)
{ {
enum address_class theclass; location_class loc_class;
SYMR *psh; SYMR *psh;
CORE_ADDR svalue; CORE_ADDR svalue;
int section; int section;
@@ -3663,7 +3663,7 @@ parse_partial_symbols (minimal_symbol_reader &reader,
Ignore them, as parse_external will ignore them too. */ Ignore them, as parse_external will ignore them too. */
continue; continue;
case stLabel: case stLabel:
theclass = LOC_LABEL; loc_class = LOC_LABEL;
break; break;
default: default:
unknown_ext_complaint (debug_info->ssext + psh->iss); 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)) if (SC_IS_COMMON (psh->sc))
continue; continue;
theclass = LOC_STATIC; loc_class = LOC_STATIC;
break; break;
} }
char *sym_name = debug_info->ssext + psh->iss; char *sym_name = debug_info->ssext + psh->iss;
pst->add_psymbol (sym_name, true, pst->add_psymbol (sym_name, true,
VAR_DOMAIN, theclass, VAR_DOMAIN, loc_class,
section, section,
psymbol_placement::GLOBAL, psymbol_placement::GLOBAL,
unrelocated_addr (svalue), 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); struct symbol *s = new_symbol (MDEBUG_EFI_SYMBOL_NAME);
s->set_domain (LABEL_DOMAIN); 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_type (builtin_type (objfile)->builtin_void);
s->set_value_bytes ((gdb_byte *) e); s->set_value_bytes ((gdb_byte *) e);
e->pdr.framereg = -1; e->pdr.framereg = -1;
@@ -4464,7 +4464,7 @@ cross_ref (int fd, union aux_ext *ax, struct type **tpp,
static struct symbol * static struct symbol *
mylookup_symbol (const char *name, const struct block *block, 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; int inc;
@@ -4473,14 +4473,14 @@ mylookup_symbol (const char *name, const struct block *block,
{ {
if (sym->linkage_name ()[0] == inc if (sym->linkage_name ()[0] == inc
&& sym->domain () == domain && sym->domain () == domain
&& sym->aclass () == theclass && sym->loc_class () == loc_class
&& strcmp (sym->linkage_name (), name) == 0) && strcmp (sym->linkage_name (), name) == 0)
return sym; return sym;
} }
block = block->superblock (); block = block->superblock ();
if (block) if (block)
return mylookup_symbol (name, block, domain, theclass); return mylookup_symbol (name, block, domain, loc_class);
return 0; return 0;
} }

View File

@@ -604,7 +604,7 @@ list_args_or_locals (const frame_print_options &fp_opts,
{ {
int print_me = 0; int print_me = 0;
switch (sym->aclass ()) switch (sym->loc_class ())
{ {
default: default:
case LOC_UNDEF: /* catches errors */ case LOC_UNDEF: /* catches errors */

View File

@@ -487,7 +487,7 @@ msymbol_is_micromips (struct minimal_symbol *msym)
static void static void
mips_make_symbol_special (struct symbol *sym, struct objfile *objfile) 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. */ /* We are in symbol reading so it is OK to cast away constness. */
struct block *block = (struct block *) sym->value_block (); struct block *block = (struct block *) sym->value_block ();

View File

@@ -521,8 +521,8 @@ relocate_one_symbol (struct symbol *sym, struct objfile *objfile,
any symbols in STRUCT_DOMAIN or UNDEF_DOMAIN. any symbols in STRUCT_DOMAIN or UNDEF_DOMAIN.
But I'm leaving out that test, on the theory that But I'm leaving out that test, on the theory that
they can't possibly pass the tests below. */ they can't possibly pass the tests below. */
if ((sym->aclass () == LOC_LABEL if ((sym->loc_class () == LOC_LABEL
|| sym->aclass () == LOC_STATIC) || sym->loc_class () == LOC_STATIC)
&& sym->section_index () >= 0) && sym->section_index () >= 0)
sym->set_value_address (sym->value_address () sym->set_value_address (sym->value_address ()
+ delta[sym->section_index ()]); + delta[sym->section_index ()]);

View File

@@ -1519,7 +1519,7 @@ yylex (void)
/* Call lookup_symtab, not lookup_partial_symtab, in case there are /* Call lookup_symtab, not lookup_partial_symtab, in case there are
no psymtabs (coff, xcoff, or some future change to blow away the no psymtabs (coff, xcoff, or some future change to blow away the
psymtabs once once symbols are read). */ 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 ())) || lookup_symtab (current_program_space, tmp.c_str ()))
{ {
yylval.ssym.sym.symbol = sym; yylval.ssym.sym.symbol = sym;
@@ -1528,7 +1528,7 @@ yylex (void)
free (uptokstart); free (uptokstart);
return BLOCKNAME; return BLOCKNAME;
} }
if (sym && sym->aclass () == LOC_TYPEDEF) if (sym && sym->loc_class () == LOC_TYPEDEF)
{ {
#if 1 #if 1
/* Despite the following flaw, we need to keep this code enabled. /* Despite the following flaw, we need to keep this code enabled.
@@ -1597,7 +1597,7 @@ yylex (void)
SEARCH_VFT, NULL).symbol; SEARCH_VFT, NULL).symbol;
if (cur_sym) if (cur_sym)
{ {
if (cur_sym->aclass () == LOC_TYPEDEF) if (cur_sym->loc_class () == LOC_TYPEDEF)
{ {
best_sym = cur_sym; best_sym = cur_sym;
pstate->lexptr = p; pstate->lexptr = p;

View File

@@ -1655,7 +1655,7 @@ info_address_command (const char *exp, int from_tty)
return; return;
} }
switch (sym->aclass ()) switch (sym->loc_class ())
{ {
case LOC_CONST: case LOC_CONST:
case LOC_CONST_BYTES: case LOC_CONST_BYTES:

View File

@@ -228,7 +228,7 @@ find_pc_sect_psymbol (struct objfile *objfile,
for (const partial_symbol *p : psymtab->global_psymbols) for (const partial_symbol *p : psymtab->global_psymbols)
{ {
if (p->domain == VAR_DOMAIN if (p->domain == VAR_DOMAIN
&& p->aclass == LOC_BLOCK && p->loc_class == LOC_BLOCK
&& pc >= p->address (objfile) && pc >= p->address (objfile)
&& (p->address (objfile) > best_pc && (p->address (objfile) > best_pc
|| (psymtab->text_low (objfile) == 0 || (psymtab->text_low (objfile) == 0
@@ -248,7 +248,7 @@ find_pc_sect_psymbol (struct objfile *objfile,
for (const partial_symbol *p : psymtab->static_psymbols) for (const partial_symbol *p : psymtab->static_psymbols)
{ {
if (p->domain == VAR_DOMAIN if (p->domain == VAR_DOMAIN
&& p->aclass == LOC_BLOCK && p->loc_class == LOC_BLOCK
&& pc >= p->address (objfile) && pc >= p->address (objfile)
&& (p->address (objfile) > best_pc && (p->address (objfile) > best_pc
|| (psymtab->text_low (objfile) == 0 || (psymtab->text_low (objfile) == 0
@@ -537,7 +537,7 @@ print_partial_symbols (struct gdbarch *gdbarch, struct objfile *objfile,
gdb_puts ("<invalid domain>, ", outfile); gdb_puts ("<invalid domain>, ", outfile);
break; break;
} }
switch (p->aclass) switch (p->loc_class)
{ {
case LOC_UNDEF: case LOC_UNDEF:
gdb_puts ("undefined", outfile); gdb_puts ("undefined", outfile);
@@ -1022,12 +1022,12 @@ psymbol_bcache::hash (const void *addr, int length)
struct partial_symbol *psymbol = (struct partial_symbol *) addr; struct partial_symbol *psymbol = (struct partial_symbol *) addr;
unsigned int lang = psymbol->ginfo.language (); unsigned int lang = psymbol->ginfo.language ();
unsigned int domain = psymbol->domain; 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 (&psymbol->ginfo.m_value, sizeof (psymbol->ginfo.m_value), h);
h = fast_hash (&lang, sizeof (unsigned int), h); h = fast_hash (&lang, sizeof (unsigned int), h);
h = fast_hash (&domain, 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 /* Note that psymbol names are interned via compute_and_set_names, so
there's no need to hash the contents of the name here. */ 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); 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 sizeof (sym1->ginfo.m_value)) == 0
&& sym1->ginfo.language () == sym2->ginfo.language () && sym1->ginfo.language () == sym2->ginfo.language ()
&& sym1->domain == sym2->domain && sym1->domain == sym2->domain
&& sym1->aclass == sym2->aclass && sym1->loc_class == sym2->loc_class
/* Note that psymbol names are interned via /* Note that psymbol names are interned via
compute_and_set_names, so there's no need to compare the compute_and_set_names, so there's no need to compare the
contents of the name here. */ contents of the name here. */
@@ -1085,7 +1085,7 @@ partial_symtab::add_psymbol (const partial_symbol &psymbol,
void void
partial_symtab::add_psymbol (std::string_view name, bool copy_name, partial_symtab::add_psymbol (std::string_view name, bool copy_name,
domain_enum domain, domain_enum domain,
enum address_class theclass, location_class loc_class,
int section, int section,
psymbol_placement where, psymbol_placement where,
unrelocated_addr coreaddr, unrelocated_addr coreaddr,
@@ -1099,7 +1099,7 @@ partial_symtab::add_psymbol (std::string_view name, bool copy_name,
psymbol.set_unrelocated_address (coreaddr); psymbol.set_unrelocated_address (coreaddr);
psymbol.ginfo.set_section_index (section); psymbol.ginfo.set_section_index (section);
psymbol.domain = domain; psymbol.domain = domain;
psymbol.aclass = theclass; psymbol.loc_class = loc_class;
psymbol.ginfo.set_language (language, partial_symtabs->obstack ()); psymbol.ginfo.set_language (language, partial_symtabs->obstack ());
psymbol.ginfo.compute_and_set_names (name, copy_name, objfile->per_bfd); 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 /* Skip symbols for inlined functions without address. These may
or may not have a match in the full symtab. */ 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) && psym->ginfo.value_address () == 0)
continue; continue;

View File

@@ -184,10 +184,10 @@ struct partial_symbol
ENUM_BITFIELD(domain_enum) domain : SYMBOL_DOMAIN_BITS; ENUM_BITFIELD(domain_enum) domain : SYMBOL_DOMAIN_BITS;
/* Address class (for info_symbols). Note that we don't allow /* 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. */ 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 /* 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 If COPY_NAME is true, make a copy of NAME, otherwise use the passed
reference. 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. 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, void add_psymbol (std::string_view name,
bool copy_name, domain_enum domain, bool copy_name, domain_enum domain,
enum address_class theclass, location_class loc_class,
int section, int section,
psymbol_placement where, psymbol_placement where,
unrelocated_addr coreaddr, unrelocated_addr coreaddr,

View File

@@ -168,7 +168,7 @@ mi_should_print (struct symbol *sym, enum mi_print_types type)
{ {
int print_me = 0; int print_me = 0;
switch (sym->aclass ()) switch (sym->loc_class ())
{ {
default: default:
case LOC_UNDEF: /* catches errors */ case LOC_UNDEF: /* catches errors */

View File

@@ -126,7 +126,7 @@ sympy_get_addr_class (PyObject *self, void *closure)
SYMPY_REQUIRE_VALID (self, symbol); 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 /* Implement gdb.Symbol.domain attribute. Return the domain as an
@@ -156,42 +156,39 @@ static PyObject *
sympy_is_constant (PyObject *self, void *closure) sympy_is_constant (PyObject *self, void *closure)
{ {
struct symbol *symbol = NULL; struct symbol *symbol = NULL;
enum address_class theclass;
SYMPY_REQUIRE_VALID (self, symbol); 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 * static PyObject *
sympy_is_function (PyObject *self, void *closure) sympy_is_function (PyObject *self, void *closure)
{ {
struct symbol *symbol = NULL; struct symbol *symbol = NULL;
enum address_class theclass;
SYMPY_REQUIRE_VALID (self, symbol); 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 * static PyObject *
sympy_is_variable (PyObject *self, void *closure) sympy_is_variable (PyObject *self, void *closure)
{ {
struct symbol *symbol = NULL; struct symbol *symbol = NULL;
enum address_class theclass;
SYMPY_REQUIRE_VALID (self, symbol); SYMPY_REQUIRE_VALID (self, symbol);
theclass = symbol->aclass (); location_class loc_class = symbol->loc_class ();
return PyBool_FromLong (!symbol->is_argument () return PyBool_FromLong (!symbol->is_argument ()
&& (theclass == LOC_LOCAL || theclass == LOC_REGISTER && (loc_class == LOC_LOCAL || loc_class == LOC_REGISTER
|| theclass == LOC_STATIC || theclass == LOC_COMPUTED || loc_class == LOC_STATIC || loc_class == LOC_COMPUTED
|| theclass == LOC_OPTIMIZED_OUT)); || loc_class == LOC_OPTIMIZED_OUT));
} }
/* Implementation of Symbol.is_artificial. */ /* Implementation of Symbol.is_artificial. */
@@ -279,7 +276,7 @@ sympy_value (PyObject *self, PyObject *args)
} }
SYMPY_REQUIRE_VALID (self, symbol); 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"); PyErr_SetString (PyExc_TypeError, "cannot get the value of a typedef");
return NULL; return NULL;

View File

@@ -1045,9 +1045,9 @@ typy_template_argument (PyObject *self, PyObject *args)
} }
sym = TYPE_TEMPLATE_ARGUMENT (type, argno); sym = TYPE_TEMPLATE_ARGUMENT (type, argno);
if (sym->aclass () == LOC_TYPEDEF) if (sym->loc_class () == LOC_TYPEDEF)
return type_to_type_object (sym->type ()); 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, PyErr_Format (PyExc_RuntimeError,
_("Template argument is optimized out")); _("Template argument is optimized out"));

View File

@@ -1232,14 +1232,14 @@ rust_parser::name_to_operation (const std::string &name)
struct block_symbol sym = lookup_symbol (name.c_str (), struct block_symbol sym = lookup_symbol (name.c_str (),
pstate->expression_context_block, pstate->expression_context_block,
SEARCH_VFT); SEARCH_VFT);
if (sym.symbol != nullptr && sym.symbol->aclass () != LOC_TYPEDEF) if (sym.symbol != nullptr && sym.symbol->loc_class () != LOC_TYPEDEF)
return make_operation<var_value_operation> (sym); return make_operation<var_value_operation> (sym);
struct type *type = nullptr; struct type *type = nullptr;
if (sym.symbol != nullptr) if (sym.symbol != nullptr)
{ {
gdb_assert (sym.symbol->aclass () == LOC_TYPEDEF); gdb_assert (sym.symbol->loc_class () == LOC_TYPEDEF);
type = sym.symbol->type (); type = sym.symbol->type ();
} }
if (type == nullptr) if (type == nullptr)

View File

@@ -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. */ a N_GSYM stab for it, but no regular (C_EXT) symbol. */
sym = new (&objfile->objfile_obstack) symbol; sym = new (&objfile->objfile_obstack) symbol;
sym->set_domain (VAR_DOMAIN); sym->set_domain (VAR_DOMAIN);
sym->set_aclass_index (LOC_OPTIMIZED_OUT); sym->set_loc_class_index (LOC_OPTIMIZED_OUT);
sym->set_linkage_name sym->set_linkage_name
(obstack_strndup (&objfile->objfile_obstack, name, pp - name)); (obstack_strndup (&objfile->objfile_obstack, name, pp - name));
pp += 2; pp += 2;
@@ -3123,7 +3123,7 @@ static const struct symbol_register_ops stab_register_funcs = {
stab_reg_to_regnum 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_register_index;
static int stab_regparm_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,;"). */ (where type 6 is defined by "blobs:t6=eblob1:0,blob2:1,;"). */
if (*p != '=') if (*p != '=')
{ {
sym->set_aclass_index (LOC_CONST); sym->set_loc_class_index (LOC_CONST);
sym->set_type (error_type (&p, objfile)); sym->set_type (error_type (&p, objfile));
sym->set_domain (VAR_DOMAIN); sym->set_domain (VAR_DOMAIN);
add_symbol_to_list (sym, get_file_symbols ()); 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_type (dbl_type);
sym->set_value_bytes (dbl_valu); sym->set_value_bytes (dbl_valu);
sym->set_aclass_index (LOC_CONST_BYTES); sym->set_loc_class_index (LOC_CONST_BYTES);
} }
break; break;
case 'i': 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_type (builtin_type (objfile)->builtin_long);
sym->set_value_longest (atoi (p)); sym->set_value_longest (atoi (p));
sym->set_aclass_index (LOC_CONST); sym->set_loc_class_index (LOC_CONST);
} }
break; 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_type (builtin_type (objfile)->builtin_char);
sym->set_value_longest (atoi (p)); sym->set_value_longest (atoi (p));
sym->set_aclass_index (LOC_CONST); sym->set_loc_class_index (LOC_CONST);
} }
break; break;
@@ -3327,7 +3327,7 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type,
if (quote != '\'' && quote != '"') 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_type (error_type (&p, objfile));
sym->set_domain (VAR_DOMAIN); sym->set_domain (VAR_DOMAIN);
add_symbol_to_list (sym, get_file_symbols ()); 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) 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_type (error_type (&p, objfile));
sym->set_domain (VAR_DOMAIN); sym->set_domain (VAR_DOMAIN);
add_symbol_to_list (sym, get_file_symbols ()); 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++; p++;
sym->set_value_bytes (string_value); sym->set_value_bytes (string_value);
sym->set_aclass_index (LOC_CONST_BYTES); sym->set_loc_class_index (LOC_CONST_BYTES);
} }
break; 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" e.g. "b:c=e6,0" for "const b = blob1"
(where type 6 is defined by "blobs:t6=eblob1:0,blob2:1,;"). */ (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)); sym->set_type (read_type (&p, objfile));
if (*p != ',') if (*p != ',')
@@ -3406,7 +3406,7 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type,
break; break;
default: default:
{ {
sym->set_aclass_index (LOC_CONST); sym->set_loc_class_index (LOC_CONST);
sym->set_type (error_type (&p, objfile)); 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': case 'C':
/* The name of a caught exception. */ /* The name of a caught exception. */
sym->set_type (read_type (&p, objfile)); 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_domain (VAR_DOMAIN);
sym->set_value_address (valu); sym->set_value_address (valu);
add_symbol_to_list (sym, get_local_symbols ()); 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': case 'f':
/* A static function definition. */ /* A static function definition. */
sym->set_type (read_type (&p, objfile)); 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); sym->set_domain (FUNCTION_DOMAIN);
add_symbol_to_list (sym, get_file_symbols ()); add_symbol_to_list (sym, get_file_symbols ());
/* fall into process_function_types. */ /* fall into process_function_types. */
@@ -3497,7 +3497,7 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type,
case 'F': case 'F':
/* A global function definition. */ /* A global function definition. */
sym->set_type (read_type (&p, objfile)); 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); sym->set_domain (FUNCTION_DOMAIN);
add_symbol_to_list (sym, get_global_symbols ()); add_symbol_to_list (sym, get_global_symbols ());
goto process_function_types; 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. corresponding linker definition to find the value.
These definitions appear at the end of the namelist. */ These definitions appear at the end of the namelist. */
sym->set_type (read_type (&p, objfile)); 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); sym->set_domain (VAR_DOMAIN);
/* Don't add symbol references to global_sym_chain. /* Don't add symbol references to global_sym_chain.
Symbol references don't have valid names and won't match up with 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 's':
case 'l': case 'l':
sym->set_type (read_type (&p, objfile)); 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_value_longest (valu);
sym->set_domain (VAR_DOMAIN); sym->set_domain (VAR_DOMAIN);
add_symbol_to_list (sym, get_local_symbols ()); 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 else
sym->set_type (read_type (&p, objfile)); 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_value_longest (valu);
sym->set_domain (VAR_DOMAIN); sym->set_domain (VAR_DOMAIN);
sym->set_is_argument (1); sym->set_is_argument (1);
@@ -3598,7 +3598,7 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type,
case 'R': case 'R':
/* Parameter which is in a register. */ /* Parameter which is in a register. */
sym->set_type (read_type (&p, objfile)); 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_is_argument (1);
sym->set_value_longest (valu); sym->set_value_longest (valu);
sym->set_domain (VAR_DOMAIN); sym->set_domain (VAR_DOMAIN);
@@ -3608,7 +3608,7 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type,
case 'r': case 'r':
/* Register variable (either global or local). */ /* Register variable (either global or local). */
sym->set_type (read_type (&p, objfile)); 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_value_longest (valu);
sym->set_domain (VAR_DOMAIN); sym->set_domain (VAR_DOMAIN);
if (within_function) if (within_function)
@@ -3640,12 +3640,12 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type,
struct symbol *prev_sym; struct symbol *prev_sym;
prev_sym = local_symbols->symbol[local_symbols->nsyms - 1]; prev_sym = local_symbols->symbol[local_symbols->nsyms - 1];
if ((prev_sym->aclass () == LOC_REF_ARG if ((prev_sym->loc_class () == LOC_REF_ARG
|| prev_sym->aclass () == LOC_ARG) || prev_sym->loc_class () == LOC_ARG)
&& strcmp (prev_sym->linkage_name (), && strcmp (prev_sym->linkage_name (),
sym->linkage_name ()) == 0) 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 /* Use the type from the LOC_REGISTER; that is the type
that is actually in that register. */ that is actually in that register. */
prev_sym->set_type (sym->type ()); prev_sym->set_type (sym->type ());
@@ -3663,7 +3663,7 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type,
case 'S': case 'S':
/* Static symbol at top level of file. */ /* Static symbol at top level of file. */
sym->set_type (read_type (&p, objfile)); 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_value_address (valu);
sym->set_domain (VAR_DOMAIN); sym->set_domain (VAR_DOMAIN);
add_symbol_to_list (sym, get_file_symbols ()); 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) if (nameless)
return NULL; return NULL;
sym->set_aclass_index (LOC_TYPEDEF); sym->set_loc_class_index (LOC_TYPEDEF);
sym->set_value_longest (valu); sym->set_value_longest (valu);
sym->set_domain (TYPE_DOMAIN); sym->set_domain (TYPE_DOMAIN);
/* C++ vagaries: we may have a type which is derived from /* 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 symbol *struct_sym = new (&objfile->objfile_obstack) symbol;
*struct_sym = *sym; *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_value_longest (valu);
struct_sym->set_domain (STRUCT_DOMAIN); struct_sym->set_domain (STRUCT_DOMAIN);
if (sym->type ()->name () == 0) if (sym->type ()->name () == 0)
@@ -3798,7 +3798,7 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type,
if (nameless) if (nameless)
return NULL; return NULL;
sym->set_aclass_index (LOC_TYPEDEF); sym->set_loc_class_index (LOC_TYPEDEF);
sym->set_value_longest (valu); sym->set_value_longest (valu);
sym->set_domain (STRUCT_DOMAIN); sym->set_domain (STRUCT_DOMAIN);
if (sym->type ()->name () == 0) 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; struct symbol *typedef_sym = new (&objfile->objfile_obstack) symbol;
*typedef_sym = *sym; *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_value_longest (valu);
typedef_sym->set_domain (TYPE_DOMAIN); typedef_sym->set_domain (TYPE_DOMAIN);
if (sym->type ()->name () == 0) if (sym->type ()->name () == 0)
@@ -3827,7 +3827,7 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type,
case 'V': case 'V':
/* Static symbol of local scope. */ /* Static symbol of local scope. */
sym->set_type (read_type (&p, objfile)); 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_value_address (valu);
sym->set_domain (VAR_DOMAIN); sym->set_domain (VAR_DOMAIN);
add_symbol_to_list (sym, get_local_symbols ()); 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': case 'v':
/* Reference parameter */ /* Reference parameter */
sym->set_type (read_type (&p, objfile)); 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_is_argument (1);
sym->set_value_longest (valu); sym->set_value_longest (valu);
sym->set_domain (VAR_DOMAIN); sym->set_domain (VAR_DOMAIN);
@@ -3846,7 +3846,7 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type,
case 'a': case 'a':
/* Reference parameter which is in a register. */ /* Reference parameter which is in a register. */
sym->set_type (read_type (&p, objfile)); 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_is_argument (1);
sym->set_value_longest (valu); sym->set_value_longest (valu);
sym->set_domain (VAR_DOMAIN); 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 that Pascal uses it too, but when I tried it Pascal used
"x:3" (local symbol) instead. */ "x:3" (local symbol) instead. */
sym->set_type (read_type (&p, objfile)); 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_value_longest (valu);
sym->set_domain (VAR_DOMAIN); sym->set_domain (VAR_DOMAIN);
add_symbol_to_list (sym, get_local_symbols ()); 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: default:
sym->set_type (error_type (&p, objfile)); 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_value_longest (0);
sym->set_domain (VAR_DOMAIN); sym->set_domain (VAR_DOMAIN);
add_symbol_to_list (sym, get_file_symbols ()); 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 /* We have to convert LOC_REGISTER to LOC_REGPARM_ADDR (for
variables passed in a register). */ variables passed in a register). */
if (sym->aclass () == LOC_REGISTER) if (sym->loc_class () == LOC_REGISTER)
sym->set_aclass_index (LOC_REGPARM_ADDR); sym->set_loc_class_index (LOC_REGPARM_ADDR);
/* Likewise for converting LOC_ARG to LOC_REF_ARG (for the 7th /* Likewise for converting LOC_ARG to LOC_REF_ARG (for the 7th
and subsequent arguments on SPARC, for example). */ and subsequent arguments on SPARC, for example). */
else if (sym->aclass () == LOC_ARG) else if (sym->loc_class () == LOC_ARG)
sym->set_aclass_index (LOC_REF_ARG); sym->set_loc_class_index (LOC_REF_ARG);
} }
return sym; return sym;
@@ -4139,7 +4139,7 @@ again:
{ {
struct symbol *sym = ppt->symbol[i]; struct symbol *sym = ppt->symbol[i];
if (sym->aclass () == LOC_TYPEDEF if (sym->loc_class () == LOC_TYPEDEF
&& sym->domain () == STRUCT_DOMAIN && sym->domain () == STRUCT_DOMAIN
&& (sym->type ()->code () == code) && (sym->type ()->code () == code)
&& strcmp (sym->linkage_name (), type_name) == 0) && 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_linkage_name (name);
sym->set_language (get_current_subfile ()->language, sym->set_language (get_current_subfile ()->language,
&objfile->objfile_obstack); &objfile->objfile_obstack);
sym->set_aclass_index (LOC_CONST); sym->set_loc_class_index (LOC_CONST);
sym->set_domain (VAR_DOMAIN); sym->set_domain (VAR_DOMAIN);
sym->set_value_longest (n); sym->set_value_longest (n);
if (n < 0) if (n < 0)
@@ -6727,7 +6727,7 @@ common_block_end (struct objfile *objfile)
sym = new (&objfile->objfile_obstack) symbol; sym = new (&objfile->objfile_obstack) symbol;
/* Note: common_block_name already saved on objfile_obstack. */ /* Note: common_block_name already saved on objfile_obstack. */
sym->set_linkage_name (common_block_name); 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. */ /* 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]; struct symbol *sym = ppt->symbol[i];
if (sym->aclass () == LOC_TYPEDEF if (sym->loc_class () == LOC_TYPEDEF
&& sym->domain () == STRUCT_DOMAIN && sym->domain () == STRUCT_DOMAIN
&& (sym->type ()->code () == (*type)->code ()) && (sym->type ()->code () == (*type)->code ())
&& ((*type)->instance_flags () && ((*type)->instance_flags ()
@@ -7045,7 +7045,7 @@ scan_file_globals (struct objfile *objfile)
the same symbol if there are multiple references. */ the same symbol if there are multiple references. */
if (sym) if (sym)
{ {
if (sym->aclass () == LOC_BLOCK) if (sym->loc_class () == LOC_BLOCK)
fix_common_block fix_common_block
(sym, msymbol->value_address (resolve_objfile), (sym, msymbol->value_address (resolve_objfile),
msymbol->section_index ()); msymbol->section_index ());
@@ -7091,8 +7091,8 @@ scan_file_globals (struct objfile *objfile)
prev->set_value_address (0); prev->set_value_address (0);
/* Complain about unresolved common block symbols. */ /* Complain about unresolved common block symbols. */
if (prev->aclass () == LOC_STATIC) if (prev->loc_class () == LOC_STATIC)
prev->set_aclass_index (LOC_UNRESOLVED); prev->set_loc_class_index (LOC_UNRESOLVED);
else else
complaint (_("%s: common block `%s' from " complaint (_("%s: common block `%s' from "
"global_sym_chain unresolved"), "global_sym_chain unresolved"),

View File

@@ -758,7 +758,7 @@ print_frame_args (const frame_print_options &fp_opts,
break; break;
} }
switch (sym->aclass ()) switch (sym->loc_class ())
{ {
case LOC_ARG: case LOC_ARG:
case LOC_REF_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 (), nsym = lookup_symbol_search_name (sym->search_name (),
b, SEARCH_VAR_DOMAIN).symbol; b, SEARCH_VAR_DOMAIN).symbol;
gdb_assert (nsym != NULL); gdb_assert (nsym != NULL);
if (nsym->aclass () == LOC_REGISTER if (nsym->loc_class () == LOC_REGISTER
&& !nsym->is_argument ()) && !nsym->is_argument ())
{ {
/* There is a LOC_ARG/LOC_REGISTER pair. This means /* 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)) for (struct symbol *sym : block_iterator_range (b))
{ {
switch (sym->aclass ()) switch (sym->loc_class ())
{ {
case LOC_CONST: case LOC_CONST:
case LOC_CONST_BYTES: case LOC_CONST_BYTES:

View File

@@ -537,7 +537,7 @@ print_symbol (struct gdbarch *gdbarch, struct symbol *symbol,
} }
else else
{ {
if (symbol->aclass () == LOC_TYPEDEF) if (symbol->loc_class () == LOC_TYPEDEF)
gdb_printf (outfile, "typedef "); gdb_printf (outfile, "typedef ");
if (symbol->type ()) if (symbol->type ())
{ {
@@ -552,7 +552,7 @@ print_symbol (struct gdbarch *gdbarch, struct symbol *symbol,
else else
gdb_printf (outfile, "%s ", symbol->print_name ()); gdb_printf (outfile, "%s ", symbol->print_name ());
switch (symbol->aclass ()) switch (symbol->loc_class ())
{ {
case LOC_CONST: case LOC_CONST:
gdb_printf (outfile, "const %s (%s)", gdb_printf (outfile, "const %s (%s)",
@@ -646,7 +646,7 @@ print_symbol (struct gdbarch *gdbarch, struct symbol *symbol,
default: default:
gdb_printf (outfile, "botched symbol class %x", gdb_printf (outfile, "botched symbol class %x",
symbol->aclass ()); symbol->loc_class ());
break; break;
} }
} }

View File

@@ -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 index without doing the check that is done by the wrapper macros
like SECT_OFF_TEXT. */ like SECT_OFF_TEXT. */
int fallback; int fallback;
switch (sym->aclass ()) switch (sym->loc_class ())
{ {
case LOC_STATIC: case LOC_STATIC:
fallback = objfile->sect_index_data; fallback = objfile->sect_index_data;
@@ -3038,7 +3038,7 @@ find_symbol_at_address (CORE_ADDR address)
for (struct symbol *sym : block_iterator_range (b)) for (struct symbol *sym : block_iterator_range (b))
{ {
if (sym->aclass () == LOC_STATIC if (sym->loc_class () == LOC_STATIC
&& sym->value_address () == addr) && sym->value_address () == addr)
return sym; return sym;
} }
@@ -4310,7 +4310,7 @@ find_function_alias_target (bound_minimal_symbol msymbol)
symbol *sym = find_pc_function (func_addr); symbol *sym = find_pc_function (func_addr);
if (sym != NULL if (sym != NULL
&& sym->aclass () == LOC_BLOCK && sym->loc_class () == LOC_BLOCK
&& sym->value_block ()->entry_pc () == func_addr) && sym->value_block ()->entry_pc () == func_addr)
return sym; return sym;
@@ -5021,12 +5021,12 @@ global_symbol_searcher::add_matching_symbols
if ((kind & SEARCH_VAR_DOMAIN) != 0) 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 /* LOC_CONST can be used for more than
just enums, e.g., c++ static const just enums, e.g., c++ static const
members. We only want to skip enums members. We only want to skip enums
here. */ here. */
|| (sym->aclass () == LOC_CONST || (sym->loc_class () == LOC_CONST
&& (sym->type ()->code () == TYPE_CODE_ENUM))) && (sym->type ()->code () == TYPE_CODE_ENUM)))
continue; continue;
} }
@@ -5234,7 +5234,7 @@ symbol_to_info_string (struct symbol *sym, int block)
string_file tmp_stream; string_file tmp_stream;
type_print (sym->type (), type_print (sym->type (),
(sym->aclass () == LOC_TYPEDEF (sym->loc_class () == LOC_TYPEDEF
? "" : sym->print_name ()), ? "" : sym->print_name ()),
&tmp_stream, 0); &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 the msymbol name and removes the msymbol name from the completion
tracker. */ tracker. */
if (sym->language () == language_cplus 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 /* The call to canonicalize returns the empty string if the input
string is already in canonical form, thanks to this we don't 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 lookup_name_info &lookup_name,
const char *text, const char *word) const char *text, const char *word)
{ {
if (sym->aclass () == LOC_TYPEDEF) if (sym->loc_class () == LOC_TYPEDEF)
{ {
struct type *t = sym->type (); struct type *t = sym->type ();
enum type_code c = t->code (); enum type_code c = t->code ();
@@ -5950,7 +5950,7 @@ symbol_is_function_or_method (minimal_symbol *msymbol)
bound_minimal_symbol bound_minimal_symbol
find_gnu_ifunc (const symbol *sym) find_gnu_ifunc (const symbol *sym)
{ {
if (sym->aclass () != LOC_BLOCK) if (sym->loc_class () != LOC_BLOCK)
return {}; return {};
lookup_name_info lookup_name (sym->search_name (), 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. */ /* 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. */ constant for convenience. */
#define MAX_SYMBOL_IMPLS (LOC_FINAL_VALUE + 11) #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 from 0 up to LOC_FINAL_VALUE-1 represent themselves, and subsequent
elements are those registered at gdb initialization time. */ elements are those registered at gdb initialization time. */
@@ -6648,22 +6648,22 @@ gdb::array_view<const struct symbol_impl> symbol_impls (symbol_impl);
/* Make sure we saved enough room in struct symbol. */ /* 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 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. */ of this type. */
int int
register_symbol_computed_impl (enum address_class aclass, register_symbol_computed_impl (location_class loc_class,
const struct symbol_computed_ops *ops) 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); gdb_assert (result < MAX_SYMBOL_IMPLS);
symbol_impl[result].aclass = aclass; symbol_impl[result].loc_class = loc_class;
symbol_impl[result].ops_computed = ops; symbol_impl[result].ops_computed = ops;
/* Sanity check OPS. */ /* Sanity check OPS. */
@@ -6676,20 +6676,20 @@ register_symbol_computed_impl (enum address_class aclass,
return result; 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 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. */ of this type. */
int int
register_symbol_block_impl (enum address_class aclass, register_symbol_block_impl (location_class loc_class,
const struct symbol_block_ops *ops) 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); gdb_assert (result < MAX_SYMBOL_IMPLS);
symbol_impl[result].aclass = aclass; symbol_impl[result].loc_class = loc_class;
symbol_impl[result].ops_block = ops; symbol_impl[result].ops_block = ops;
/* Sanity check OPS. */ /* Sanity check OPS. */
@@ -6700,35 +6700,33 @@ register_symbol_block_impl (enum address_class aclass,
return result; 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 LOC_REGPARM_ADDR. OPS is the register ops vector associated with
this index. This returns the new index, which should be used as 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 int
register_symbol_register_impl (enum address_class aclass, register_symbol_register_impl (location_class loc_class,
const struct symbol_register_ops *ops) 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); gdb_assert (result < MAX_SYMBOL_IMPLS);
symbol_impl[result].aclass = aclass; symbol_impl[result].loc_class = loc_class;
symbol_impl[result].ops_register = ops; symbol_impl[result].ops_register = ops;
return result; return result;
} }
/* Initialize elements of 'symbol_impl' for the constants in enum /* Initialize elements of 'symbol_impl' for the constants in enum
address_class. */ location_class. */
static void static void
initialize_ordinary_address_classes (void) initialize_ordinary_address_classes (void)
{ {
int i; for (int i = 0; i < LOC_FINAL_VALUE; ++i)
symbol_impl[i].loc_class = static_cast<location_class> (i);
for (i = 0; i < LOC_FINAL_VALUE; ++i)
symbol_impl[i].aclass = (enum address_class) i;
} }
@@ -6776,7 +6774,7 @@ CORE_ADDR
symbol::get_maybe_copied_address () const symbol::get_maybe_copied_address () const
{ {
gdb_assert (this->maybe_copied); 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 (); const char *linkage_name = this->linkage_name ();
bound_minimal_symbol minsym bound_minimal_symbol minsym

View File

@@ -967,9 +967,9 @@ to_scripting_domain (domain_search_flags val)
Throws an exception if VAL is not one of the allowable values. */ Throws an exception if VAL is not one of the allowable values. */
extern domain_search_flags from_scripting_domain (int val); 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. */ /* Not used; catches errors. */
@@ -1078,14 +1078,14 @@ enum address_class
LOC_FINAL_VALUE 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 padding for reasonable growth, and room for run-time registered address
classes. See symtab.c:MAX_SYMBOL_IMPLS. classes. See symtab.c:MAX_SYMBOL_IMPLS.
This is a #define so that we can have a assertion elsewhere to This is a #define so that we can have a assertion elsewhere to
verify that we have reserved enough space for synthetic address verify that we have reserved enough space for synthetic address
classes. */ classes. */
#define SYMBOL_ACLASS_BITS 5 #define SYMBOL_LOC_CLASS_BITS 5
static_assert (LOC_FINAL_VALUE <= (1 << SYMBOL_ACLASS_BITS)); static_assert (LOC_FINAL_VALUE <= (1 << SYMBOL_LOC_CLASS_BITS));
/* The methods needed to implement LOC_COMPUTED. These methods can /* The methods needed to implement LOC_COMPUTED. These methods can
use the symbol's .aux_value for additional per-symbol information. use the symbol's .aux_value for additional per-symbol information.
@@ -1202,7 +1202,7 @@ struct symbol_register_ops
struct symbol_impl struct symbol_impl
{ {
enum address_class aclass; location_class loc_class;
/* Used with LOC_COMPUTED. */ /* Used with LOC_COMPUTED. */
const struct symbol_computed_ops *ops_computed; const struct symbol_computed_ops *ops_computed;
@@ -1238,7 +1238,7 @@ struct symbol : public general_symbol_info, public allocate_on_obstack<symbol>
symbol () symbol ()
/* Class-initialization of bitfields is only allowed in C++20. */ /* Class-initialization of bitfields is only allowed in C++20. */
: m_domain (UNDEF_DOMAIN), : m_domain (UNDEF_DOMAIN),
m_aclass_index (0), m_loc_class_index (0),
m_is_objfile_owned (1), m_is_objfile_owned (1),
m_is_argument (0), m_is_argument (0),
m_is_inlined (0), m_is_inlined (0),
@@ -1262,14 +1262,14 @@ struct symbol : public general_symbol_info, public allocate_on_obstack<symbol>
symbol (const symbol &) = default; symbol (const symbol &) = default;
symbol &operator= (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 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 const symbol_block_ops *block_ops () const
@@ -1287,9 +1287,9 @@ struct symbol : public general_symbol_info, public allocate_on_obstack<symbol>
return this->impl ().ops_register; 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. */ /* Return true if this symbol's domain matches FLAGS. */
@@ -1480,11 +1480,11 @@ struct symbol : public general_symbol_info, public allocate_on_obstack<symbol>
ENUM_BITFIELD(domain_enum) m_domain : SYMBOL_DOMAIN_BITS; ENUM_BITFIELD(domain_enum) m_domain : SYMBOL_DOMAIN_BITS;
/* Address class. This holds an index into the 'symbol_impls' /* Location class. This holds an index into the 'symbol_impls'
table. The actual enum address_class value is stored there, table. The actual location_class value is stored there,
alongside any per-class ops vectors. */ 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. /* If non-zero then symbol is objfile-owned, use owner.symtab.
Otherwise symbol is arch-owned, use owner.arch. */ Otherwise symbol is arch-owned, use owner.arch. */
@@ -1575,13 +1575,13 @@ symbol::value_block () const
return m_value.block; 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 *); 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); 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 *); const struct symbol_register_ops *);
/* An instance of this type is used to represent a C++ template /* An instance of this type is used to represent a C++ template

View File

@@ -689,14 +689,14 @@ validate_actionline (const char *line, tracepoint *t)
(exp->op.get ())); (exp->op.get ()));
sym = vvop->get_symbol (); sym = vvop->get_symbol ();
if (sym->aclass () == LOC_CONST) if (sym->loc_class () == LOC_CONST)
{ {
error (_("constant `%s' (value %s) " error (_("constant `%s' (value %s) "
"will not be collected."), "will not be collected."),
sym->print_name (), sym->print_name (),
plongest (sym->value_longest ())); plongest (sym->value_longest ()));
} }
else if (sym->aclass () == LOC_OPTIMIZED_OUT) else if (sym->loc_class () == LOC_OPTIMIZED_OUT)
{ {
error (_("`%s' is optimized away " error (_("`%s' is optimized away "
"and cannot be collected."), "and cannot be collected."),
@@ -916,11 +916,11 @@ collection_list::collect_symbol (struct symbol *sym,
int treat_as_expr = 0; int treat_as_expr = 0;
len = check_typedef (sym->type ())->length (); len = check_typedef (sym->type ())->length ();
switch (sym->aclass ()) switch (sym->loc_class ())
{ {
default: default:
gdb_printf ("%s: don't know symbol class %d\n", gdb_printf ("%s: don't know symbol class %d\n",
sym->print_name (), sym->aclass ()); sym->print_name (), sym->loc_class ());
break; break;
case LOC_CONST: case LOC_CONST:
gdb_printf ("constant %s (value %s) will not be collected.\n", 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); gdb_stdout);
else else
{ {
switch (sym->aclass ()) switch (sym->loc_class ())
{ {
default: default:
case LOC_UNDEF: /* Messed up symbol? */ case LOC_UNDEF: /* Messed up symbol? */
gdb_printf ("a bogus symbol, class %d.\n", gdb_printf ("a bogus symbol, class %d.\n",
sym->aclass ()); sym->loc_class ());
count--; /* Don't count this one. */ count--; /* Don't count this one. */
continue; continue;
case LOC_CONST: case LOC_CONST:

View File

@@ -219,7 +219,7 @@ typedef_hash_table::add_template_parameters (struct type *t)
struct decl_field *tf; struct decl_field *tf;
/* We only want type-valued template parameters in the hash. */ /* 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; continue;
tf = XOBNEW (&m_storage, struct decl_field); tf = XOBNEW (&m_storage, struct decl_field);

View File

@@ -3822,7 +3822,7 @@ value_maybe_namespace_elt (const struct type *curtype,
if (sym.symbol == NULL) if (sym.symbol == NULL)
return NULL; return NULL;
else if ((noside == EVAL_AVOID_SIDE_EFFECTS) else if ((noside == EVAL_AVOID_SIDE_EFFECTS)
&& (sym.symbol->aclass () == LOC_TYPEDEF)) && (sym.symbol->loc_class () == LOC_TYPEDEF))
result = value::allocate (sym.symbol->type ()); result = value::allocate (sym.symbol->type ());
else else
result = value_of_variable (sym.symbol, sym.block); result = value_of_variable (sym.symbol, sym.block);

View File

@@ -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_type (builtin_type (objfile)->nodebug_text_symbol);
sym->set_domain (FUNCTION_DOMAIN); 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); sym2 = new (&objfile->objfile_obstack) symbol (*sym);
if (cs->c_sclass == C_EXT || C_WEAKEXT) if (cs->c_sclass == C_EXT || C_WEAKEXT)