SEARCH_VFT);
if (sym_info.symbol == NULL)
error (_("Could not find renamed variable: %s"), ada_decode (name).c_str ());
- else if (sym_info.symbol->aclass () == LOC_TYPEDEF)
+ else if (sym_info.symbol->loc_class () == LOC_TYPEDEF)
/* We have a renaming of an old-style renaming symbol. Don't
trust the block information. */
sym_info.block = orig_left_context;
SEARCH_VFT);
if (index_sym_info.symbol == NULL)
error (_("Could not find %s"), index_name);
- else if (index_sym_info.symbol->aclass () == LOC_TYPEDEF)
+ else if (index_sym_info.symbol->loc_class () == LOC_TYPEDEF)
/* Index is an old-style renaming symbol. */
index_sym_info.block = orig_left_context;
write_var_from_sym (par_state, index_sym_info);
= ada_lookup_symbol_list (name, context, SEARCH_FUNCTION_DOMAIN);
if (context == NULL
- && (syms.empty () || syms[0].symbol->aclass () != LOC_BLOCK))
+ && (syms.empty () || syms[0].symbol->loc_class () != LOC_BLOCK))
symtab = lookup_symtab (current_program_space, name);
else
symtab = NULL;
if (symtab != NULL)
result = symtab->compunit ()->blockvector ()->static_block ();
- else if (syms.empty () || syms[0].symbol->aclass () != LOC_BLOCK)
+ else if (syms.empty () || syms[0].symbol->loc_class () != LOC_BLOCK)
{
if (context == NULL)
error (_("No file or function \"%s\"."), raw_name);
preferred_index = -1; preferred_type = NULL;
for (i = 0; i < syms.size (); i += 1)
- switch (syms[i].symbol->aclass ())
+ switch (syms[i].symbol->loc_class ())
{
case LOC_TYPEDEF:
if (ada_prefer_type (syms[i].symbol->type (), preferred_type))
strcpy (expanded_name, "standard__");
strcat (expanded_name, name);
sym = ada_lookup_symbol (expanded_name, NULL, SEARCH_TYPE_DOMAIN).symbol;
- if (sym != NULL && sym->aclass () == LOC_TYPEDEF)
+ if (sym != NULL && sym->loc_class () == LOC_TYPEDEF)
type = sym->type ();
}
par_state->expression_context_block,
SEARCH_VFT);
- if (syms.size () != 1 || syms[0].symbol->aclass () == LOC_TYPEDEF)
+ if (syms.size () != 1 || syms[0].symbol->loc_class () == LOC_TYPEDEF)
pstate->push_new<ada_string_operation> (copy_name (name));
else
write_var_from_sym (par_state, syms[0]);
if (syms[i].symbol == NULL)
continue;
- if (syms[i].symbol->aclass () == LOC_BLOCK)
+ if (syms[i].symbol->loc_class () == LOC_BLOCK)
{
struct symtab_and_line sal =
find_function_start_sal (syms[i].symbol, 1);
else
{
int is_enumeral =
- (syms[i].symbol->aclass () == LOC_CONST
+ (syms[i].symbol->loc_class () == LOC_CONST
&& syms[i].symbol->type () != NULL
&& syms[i].symbol->type ()->code () == TYPE_CODE_ENUM);
struct symtab *symtab = NULL;
candidates.end (),
[] (block_symbol &bsym)
{
- switch (bsym.symbol->aclass ())
+ switch (bsym.symbol->loc_class ())
{
case LOC_REGISTER:
case LOC_ARG:
candidates.end (),
[] (block_symbol &bsym)
{
- return bsym.symbol->aclass () == LOC_TYPEDEF;
+ return bsym.symbol->loc_class () == LOC_TYPEDEF;
}),
candidates.end ());
}
int i;
struct type *func_type = func->type ();
- if (func->aclass () == LOC_CONST
+ if (func->loc_class () == LOC_CONST
&& func_type->code () == TYPE_CODE_ENUM)
return (n_actuals == 0);
else if (func_type == NULL || func_type->code () != TYPE_CODE_FUNC)
if (sym == NULL)
return ADA_NOT_RENAMING;
- switch (sym->aclass ())
+ switch (sym->loc_class ())
{
default:
return ADA_NOT_RENAMING;
for (const block_symbol &sym : syms)
if (sym.symbol->type ()->code () != TYPE_CODE_FUNC
&& (sym.symbol->type ()->code () != TYPE_CODE_ENUM
- || sym.symbol->aclass () != LOC_CONST))
+ || sym.symbol->loc_class () != LOC_CONST))
return 1;
return 0;
if (sym0 == sym1)
return 1;
if (sym0->domain () != sym1->domain ()
- || sym0->aclass () != sym1->aclass ())
+ || sym0->loc_class () != sym1->loc_class ())
return 0;
- switch (sym0->aclass ())
+ switch (sym0->loc_class ())
{
case LOC_UNDEF:
return 1;
should be identical. */
else if (syms[i].symbol->linkage_name () != NULL
- && syms[i].symbol->aclass () == LOC_STATIC
+ && syms[i].symbol->loc_class () == LOC_STATIC
&& is_nondebugging_type (syms[i].symbol->type ()))
{
for (j = 0; !remove_p && j < syms.size (); j += 1)
&& syms[j].symbol->linkage_name () != NULL
&& strcmp (syms[i].symbol->linkage_name (),
syms[j].symbol->linkage_name ()) == 0
- && (syms[i].symbol->aclass ()
- == syms[j].symbol->aclass ())
+ && (syms[i].symbol->loc_class ()
+ == syms[j].symbol->loc_class ())
&& syms[i].symbol->value_address ()
== syms[j].symbol->value_address ())
remove_p = true;
/* Two functions with the same block are identical. */
- else if (syms[i].symbol->aclass () == LOC_BLOCK)
+ else if (syms[i].symbol->loc_class () == LOC_BLOCK)
{
for (j = 0; !remove_p && j < syms.size (); j += 1)
{
if (i != j
- && syms[j].symbol->aclass () == LOC_BLOCK
+ && syms[j].symbol->loc_class () == LOC_BLOCK
&& (syms[i].symbol->value_block ()
== syms[j].symbol->value_block ()))
remove_p = true;
static int
old_renaming_is_invisible (const struct symbol *sym, const char *function_name)
{
- if (sym->aclass () != LOC_TYPEDEF)
+ if (sym->loc_class () != LOC_TYPEDEF)
return 0;
std::string scope = xget_renaming_scope (sym->type ());
const char *name;
const char *suffix;
- if (sym == NULL || sym->aclass () == LOC_TYPEDEF)
+ if (sym == NULL || sym->loc_class () == LOC_TYPEDEF)
continue;
name = sym->linkage_name ();
suffix = strstr (name, "___XR");
}
else
{
- if (sym->aclass () == LOC_UNRESOLVED)
+ if (sym->loc_class () == LOC_UNRESOLVED)
return true;
else if (sym->is_argument ())
arg_sym = sym;
{
if (sym->matches (domain))
{
- if (sym->aclass () != LOC_UNRESOLVED)
+ if (sym->loc_class () != LOC_UNRESOLVED)
{
if (sym->is_argument ())
arg_sym = sym;
if (cmp == 0
&& is_name_suffix (sym->linkage_name () + name_len + 5))
{
- if (sym->aclass () != LOC_UNRESOLVED)
+ if (sym->loc_class () != LOC_UNRESOLVED)
{
if (sym->is_argument ())
arg_sym = sym;
/* Make sure that the symbol we found corresponds to a function. */
- if (sym->aclass () != LOC_BLOCK)
+ if (sym->loc_class () != LOC_BLOCK)
error (_("Symbol \"%s\" is not a function (class = %d)"),
- sym->linkage_name (), sym->aclass ());
+ sym->linkage_name (), sym->loc_class ());
sym = standard_lookup (einfo->catch_handlers_sym, NULL,
SEARCH_FUNCTION_DOMAIN);
/* Make sure that the symbol we found corresponds to a function. */
- if (sym->aclass () != LOC_BLOCK)
+ if (sym->loc_class () != LOC_BLOCK)
error (_("Symbol \"%s\" is not a function (class = %d)"),
- sym->linkage_name (), sym->aclass ());
+ sym->linkage_name (), sym->loc_class ());
return 1;
}
throw_error (NOT_FOUND_ERROR, _("Catchpoint symbol not found: %s"),
sym_name);
- if (sym->aclass () != LOC_BLOCK)
+ if (sym->loc_class () != LOC_BLOCK)
error (_("Unable to insert catchpoint. %s is not a function."), sym_name);
return find_function_start_sal (sym, 1);
{
const char *type_name = sym->type ()->name ();
- return (sym->aclass () != LOC_TYPEDEF
- && sym->aclass () != LOC_BLOCK
- && sym->aclass () != LOC_CONST
- && sym->aclass () != LOC_UNRESOLVED
+ return (sym->loc_class () != LOC_TYPEDEF
+ && sym->loc_class () != LOC_BLOCK
+ && sym->loc_class () != LOC_CONST
+ && sym->loc_class () != LOC_UNRESOLVED
&& type_name != NULL && strcmp (type_name, "exception") == 0);
}
{
for (struct symbol *sym : block_iterator_range (block))
{
- switch (sym->aclass ())
+ switch (sym->loc_class ())
{
case LOC_TYPEDEF:
case LOC_BLOCK:
return computed_ops->tracepoint_var_ref (var, ax, value);
/* I'm imitating the code in read_var_value. */
- switch (var->aclass ())
+ switch (var->loc_class ())
{
case LOC_CONST: /* A constant, like an enum value. */
ax_const_l (ax, (LONGEST) var->value_longest ());
bool
best_symbol (struct symbol *a, const domain_search_flags domain)
{
- if (a->aclass () == LOC_UNRESOLVED)
+ if (a->loc_class () == LOC_UNRESOLVED)
return false;
if ((domain & SEARCH_VAR_DOMAIN) != 0)
if (b->matches (domain) && !a->matches (domain))
return b;
- if (a->aclass () != LOC_UNRESOLVED && b->aclass () == LOC_UNRESOLVED)
+ if (a->loc_class () != LOC_UNRESOLVED && b->loc_class () == LOC_UNRESOLVED)
return a;
- if (b->aclass () != LOC_UNRESOLVED && a->aclass () == LOC_UNRESOLVED)
+ if (b->loc_class () != LOC_UNRESOLVED && a->loc_class () == LOC_UNRESOLVED)
return b;
return a;
par_state->language ()->name_of_this ()
? &is_a_field_of_this : NULL);
- if (bsym.symbol && bsym.symbol->aclass () == LOC_BLOCK)
+ if (bsym.symbol && bsym.symbol->loc_class () == LOC_BLOCK)
{
yylval.ssym.sym = bsym;
yylval.ssym.is_a_field_of_this = is_a_field_of_this.type != NULL;
}
}
- if (bsym.symbol && bsym.symbol->aclass () == LOC_TYPEDEF)
+ if (bsym.symbol && bsym.symbol->loc_class () == LOC_TYPEDEF)
{
yylval.tsym.type = bsym.symbol->type ();
return TYPENAME;
return ERROR;
}
- switch (yylval.ssym.sym.symbol->aclass ())
+ switch (yylval.ssym.sym.symbol->loc_class ())
{
case LOC_BLOCK:
case LOC_LABEL:
{
struct symbol *sym = TYPE_TEMPLATE_ARGUMENT (type, i);
- if (sym->aclass () != LOC_TYPEDEF)
+ if (sym->loc_class () != LOC_TYPEDEF)
continue;
if (first)
Remove syms from the chain when their types are stored,
but search the whole chain, as there may be several syms
from different files with the same name. */
- if (real_sym->aclass () == LOC_TYPEDEF
+ if (real_sym->loc_class () == LOC_TYPEDEF
&& real_sym->domain () == TYPE_DOMAIN
&& real_sym->type ()->code () == TYPE_CODE_PTR
&& real_sym->type ()->target_type ()->length () != 0)
coff_reg_to_regnum
};
-/* The "aclass" index for computed COFF symbols. */
+/* The "loc_class" index for computed COFF symbols. */
static int coff_register_index;
(lookup_function_type (decode_function_type (cs, cs->c_type,
aux, objfile)));
- sym->set_aclass_index (LOC_BLOCK);
+ sym->set_loc_class_index (LOC_BLOCK);
if (cs->c_sclass == C_STAT || cs->c_sclass == C_THUMBSTAT
|| cs->c_sclass == C_THUMBSTATFUNC)
add_symbol_to_list (sym, get_file_symbols ());
break;
case C_AUTO:
- sym->set_aclass_index (LOC_LOCAL);
+ sym->set_loc_class_index (LOC_LOCAL);
add_symbol_to_list (sym, get_local_symbols ());
break;
case C_THUMBEXT:
case C_THUMBEXTFUNC:
case C_EXT:
- sym->set_aclass_index (LOC_STATIC);
+ sym->set_loc_class_index (LOC_STATIC);
sym->set_value_address ((CORE_ADDR) cs->c_value
+ objfile->section_offsets[SECT_OFF_TEXT (objfile)]);
add_symbol_to_list (sym, get_global_symbols ());
case C_THUMBSTAT:
case C_THUMBSTATFUNC:
case C_STAT:
- sym->set_aclass_index (LOC_STATIC);
+ sym->set_loc_class_index (LOC_STATIC);
sym->set_value_address ((CORE_ADDR) cs->c_value
+ objfile->section_offsets[SECT_OFF_TEXT (objfile)]);
if (within_function)
case C_GLBLREG:
#endif
case C_REG:
- sym->set_aclass_index (coff_register_index);
+ sym->set_loc_class_index (coff_register_index);
sym->set_value_longest (cs->c_value);
add_symbol_to_list (sym, get_local_symbols ());
break;
break;
case C_ARG:
- sym->set_aclass_index (LOC_ARG);
+ sym->set_loc_class_index (LOC_ARG);
sym->set_is_argument (1);
add_symbol_to_list (sym, get_local_symbols ());
break;
case C_REGPARM:
- sym->set_aclass_index (coff_register_index);
+ sym->set_loc_class_index (coff_register_index);
sym->set_is_argument (1);
sym->set_value_longest (cs->c_value);
add_symbol_to_list (sym, get_local_symbols ());
break;
case C_TPDEF:
- sym->set_aclass_index (LOC_TYPEDEF);
+ sym->set_loc_class_index (LOC_TYPEDEF);
sym->set_domain (TYPE_DOMAIN);
/* If type has no name, give it one. */
case C_STRTAG:
case C_UNTAG:
case C_ENTAG:
- sym->set_aclass_index (LOC_TYPEDEF);
+ sym->set_loc_class_index (LOC_TYPEDEF);
sym->set_domain (STRUCT_DOMAIN);
/* Some compilers try to be helpful by inventing "fake"
name = obstack_strdup (&objfile->objfile_obstack, name);
sym->set_linkage_name (name);
- sym->set_aclass_index (LOC_CONST);
+ sym->set_loc_class_index (LOC_CONST);
sym->set_domain (VAR_DOMAIN);
sym->set_value_longest (ms->c_value);
add_symbol_to_list (sym, symlist);
context->error_symbol_once (sym.symbol);
- if (sym.symbol->aclass () == LOC_LABEL)
+ if (sym.symbol->loc_class () == LOC_LABEL)
sym_type = 0;
else
sym_type = context->convert_type (sym.symbol->type ());
CORE_ADDR addr = 0;
gdb::unique_xmalloc_ptr<char> symbol_name;
- switch (sym.symbol->aclass ())
+ switch (sym.symbol->loc_class ())
{
case LOC_TYPEDEF:
kind = GCC_C_SYMBOL_TYPEDEF;
}
else
{
- switch (sym->aclass ())
+ switch (sym->loc_class ())
{
case LOC_REGISTER:
case LOC_ARG:
instance->error_symbol_once (sym.symbol);
- if (sym.symbol->aclass () == LOC_LABEL)
+ if (sym.symbol->loc_class () == LOC_LABEL)
sym_type = 0;
else
sym_type = instance->convert_type (sym.symbol->type ());
std::string name;
gdb::unique_xmalloc_ptr<char> symbol_name;
- switch (sym.symbol->aclass ())
+ switch (sym.symbol->loc_class ())
{
case LOC_TYPEDEF:
if (sym.symbol->type ()->code () == TYPE_CODE_TYPEDEF)
return NULL;
}
- if (rtti_sym->aclass () != LOC_TYPEDEF)
+ if (rtti_sym->loc_class () != LOC_TYPEDEF)
{
warning (_("RTTI symbol for class '%s' is not a type"), name);
return NULL;
if (msym.minsym != NULL)
{
sym->set_value_address (msym.value_address ());
- sym->set_aclass_index (LOC_STATIC);
+ sym->set_loc_class_index (LOC_STATIC);
sym->set_section_index (msym.minsym->section_index ());
}
}
sym->set_language (language_c, &ccp->of->objfile_obstack);
sym->compute_and_set_names (name, false, ccp->of->per_bfd);
- sym->set_aclass_index (LOC_CONST);
+ sym->set_loc_class_index (LOC_CONST);
sym->set_domain (VAR_DOMAIN);
sym->set_type (fip->ptype);
add_symbol_to_list (sym, ccp->builder->get_global_symbols ());
sym->set_language (language_c, &objfile->objfile_obstack);
sym->compute_and_set_names (name, false, objfile->per_bfd);
sym->set_domain (VAR_DOMAIN);
- sym->set_aclass_index (LOC_OPTIMIZED_OUT);
+ sym->set_loc_class_index (LOC_OPTIMIZED_OUT);
if (type != nullptr)
sym->set_type (type);
case CTF_K_STRUCT:
case CTF_K_UNION:
case CTF_K_ENUM:
- sym->set_aclass_index (LOC_TYPEDEF);
+ sym->set_loc_class_index (LOC_TYPEDEF);
sym->set_domain (STRUCT_DOMAIN);
break;
case CTF_K_FUNCTION:
- sym->set_aclass_index (LOC_STATIC);
+ sym->set_loc_class_index (LOC_STATIC);
set_symbol_address (objfile, sym, sym->linkage_name ());
break;
case CTF_K_CONST:
case CTF_K_TYPEDEF:
case CTF_K_INTEGER:
case CTF_K_FLOAT:
- sym->set_aclass_index (LOC_TYPEDEF);
+ sym->set_loc_class_index (LOC_TYPEDEF);
sym->set_domain (TYPE_DOMAIN);
break;
case CTF_K_POINTER:
OBJSTAT (ccp->of, n_syms++);
sym->set_type (type);
sym->set_domain (VAR_DOMAIN);
- sym->set_aclass_index (LOC_OPTIMIZED_OUT);
+ sym->set_loc_class_index (LOC_OPTIMIZED_OUT);
sym->compute_and_set_names (name, false, ccp->of->per_bfd);
add_symbol_to_list (sym, ccp->builder->get_file_symbols ());
break;
OBJSTAT (ccp->of, n_syms++);
sym->set_type (type);
sym->set_domain (VAR_DOMAIN);
- sym->set_aclass_index (LOC_STATIC);
+ sym->set_loc_class_index (LOC_STATIC);
sym->compute_and_set_names (tname, false, ccp->of->per_bfd);
add_symbol_to_list (sym, ccp->builder->get_global_symbols ());
set_symbol_address (ccp->of, sym, tname);
while ((tid = ctf_symbol_next (cfp, &i, &tname, functions)) != CTF_ERR)
{
uint32_t kind = ctf_type_kind (cfp, tid);
- address_class aclass;
+ location_class loc_class;
domain_enum tdomain;
switch (kind)
{
}
if (kind == CTF_K_FUNCTION)
- aclass = LOC_STATIC;
+ loc_class = LOC_STATIC;
else if (kind == CTF_K_CONST)
- aclass = LOC_CONST;
+ loc_class = LOC_CONST;
else
- aclass = LOC_TYPEDEF;
+ loc_class = LOC_TYPEDEF;
pst->add_psymbol (tname, true,
- tdomain, aclass, -1,
+ tdomain, loc_class, -1,
psymbol_placement::GLOBAL,
unrelocated_addr (0),
language_c, pst->context.partial_symtabs, of);
ccp = (struct ctf_context *) arg;
domain_enum domain = UNDEF_DOMAIN;
- enum address_class aclass = LOC_UNDEF;
+ location_class loc_class = LOC_UNDEF;
kind = ctf_type_kind (ccp->fp, tid);
switch (kind)
{
case CTF_K_STRUCT:
case CTF_K_UNION:
domain = STRUCT_DOMAIN;
- aclass = LOC_TYPEDEF;
+ loc_class = LOC_TYPEDEF;
break;
case CTF_K_FUNCTION:
case CTF_K_FORWARD:
domain = VAR_DOMAIN;
- aclass = LOC_STATIC;
+ loc_class = LOC_STATIC;
section = SECT_OFF_TEXT (ccp->of);
break;
case CTF_K_CONST:
domain = VAR_DOMAIN;
- aclass = LOC_STATIC;
+ loc_class = LOC_STATIC;
break;
case CTF_K_TYPEDEF:
case CTF_K_POINTER:
case CTF_K_VOLATILE:
case CTF_K_RESTRICT:
domain = VAR_DOMAIN;
- aclass = LOC_TYPEDEF;
+ loc_class = LOC_TYPEDEF;
break;
case CTF_K_INTEGER:
case CTF_K_FLOAT:
domain = VAR_DOMAIN;
- aclass = LOC_TYPEDEF;
+ loc_class = LOC_TYPEDEF;
break;
case CTF_K_ARRAY:
case CTF_K_UNKNOWN:
return 0;
ccp->pst->add_psymbol (name, false,
- domain, aclass, section,
+ domain, loc_class, section,
psymbol_placement::STATIC,
unrelocated_addr (0),
language_c, ccp->partial_symtabs, ccp->of);
sym = lookup_symbol (copy.c_str (),
pstate->expression_context_block,
SEARCH_VFT, &is_a_field_of_this);
- if (sym.symbol && sym.symbol->aclass () != LOC_TYPEDEF)
+ if (sym.symbol && sym.symbol->loc_class () != LOC_TYPEDEF)
{
if (symbol_read_needs_frame (sym.symbol))
pstate->block_tracker->update (sym);
std::string copy = copy_name (yylval.sval);
sym = lookup_symbol (copy.c_str (), block, SEARCH_VFT, &is_a_field_of_this);
- if (sym.symbol && sym.symbol->aclass () == LOC_TYPEDEF)
+ if (sym.symbol && sym.symbol->loc_class () == LOC_TYPEDEF)
{
yylval.tsym.type = sym.symbol->type ();
return TYPENAME;
if (yylval.ssym.sym.symbol == NULL)
return ERROR;
- if (yylval.ssym.sym.symbol->aclass () == LOC_TYPEDEF)
+ if (yylval.ssym.sym.symbol->loc_class () == LOC_TYPEDEF)
{
yylval.tsym.type = yylval.ssym.sym.symbol->type ();
return TYPENAME;
if (real_symbol.symbol == nullptr)
error (_("could not find alias '%s' for function '%s'"),
name, sym->print_name ());
- if (real_symbol.symbol->aclass () != LOC_BLOCK)
+ if (real_symbol.symbol->loc_class () != LOC_BLOCK)
error (_("alias '%s' for function '%s' is not a function"),
name, sym->print_name ());
static const registry<objfile>::key<dwarf2_per_bfd>
dwarf2_per_bfd_objfile_data_key;
-/* The "aclass" indices for various kinds of computed DWARF symbols. */
+/* The "loc_class" indices for various kinds of computed DWARF symbols. */
static int dwarf2_locexpr_index;
static int dwarf2_loclist_index;
struct symbol *sym = list->symbol[i];
if (sym->language () == language_go
- && sym->aclass () == LOC_BLOCK)
+ && sym->loc_class () == LOC_BLOCK)
{
gdb::unique_xmalloc_ptr<char> this_package_name
= go_symbol_package_name (sym);
sym->set_language (language_go, &objfile->objfile_obstack);
sym->compute_and_set_names (saved_package_name, false, objfile->per_bfd);
sym->set_domain (TYPE_DOMAIN);
- sym->set_aclass_index (LOC_TYPEDEF);
+ sym->set_loc_class_index (LOC_TYPEDEF);
sym->set_type (type);
add_symbol_to_list (sym, cu->get_builder ()->get_global_symbols ());
type = die_type (d, imported_cu);
struct symbol *sym = new_symbol (die, type, cu);
attr = dwarf2_attr (d, DW_AT_location, imported_cu);
- sym->set_aclass_index (LOC_UNRESOLVED);
+ sym->set_loc_class_index (LOC_UNRESOLVED);
if (attr != nullptr)
var_decode_location (attr, sym, cu);
return true;
gdb_assert (ptr - baton->data == baton->size);
SYMBOL_LOCATION_BATON (sym) = baton;
- sym->set_aclass_index (dwarf2_locexpr_index);
+ sym->set_loc_class_index (dwarf2_locexpr_index);
}
/* Create appropriate locally-scoped variables for all the
variable has been optimized away. */
if (attr->form_is_block () && attr->as_block ()->size == 0)
{
- sym->set_aclass_index (LOC_OPTIMIZED_OUT);
+ sym->set_loc_class_index (LOC_OPTIMIZED_OUT);
return;
}
else
tem = read_addr_index_from_leb128 (cu, block->data + 1, &dummy);
sym->set_value_address ((CORE_ADDR) tem);
- sym->set_aclass_index (LOC_STATIC);
+ sym->set_loc_class_index (LOC_STATIC);
fixup_symbol_section (sym, objfile);
sym->set_value_address
(sym->value_address ()
= new (&cu->per_objfile->objfile->objfile_obstack) symbol (*orig);
copy->set_linkage_name (new_name);
SYMBOL_LOCATION_BATON (copy) = (void *) orig_name;
- copy->set_aclass_index (copy->aclass () == LOC_BLOCK
+ copy->set_loc_class_index (copy->loc_class () == LOC_BLOCK
? ada_block_index
: ada_imported_index);
add_symbol_to_list (copy, list_to_add);
/* Default assumptions.
Use the passed type or decode it from the die. */
sym->set_domain (UNDEF_DOMAIN);
- sym->set_aclass_index (LOC_OPTIMIZED_OUT);
+ sym->set_loc_class_index (LOC_OPTIMIZED_OUT);
if (type != NULL)
sym->set_type (type);
else
CORE_ADDR addr = per_objfile->relocate (attr->as_address ());
sym->set_section_index (SECT_OFF_TEXT (objfile));
sym->set_value_address (addr);
- sym->set_aclass_index (LOC_LABEL);
+ sym->set_loc_class_index (LOC_LABEL);
}
else
- sym->set_aclass_index (LOC_OPTIMIZED_OUT);
+ sym->set_loc_class_index (LOC_OPTIMIZED_OUT);
sym->set_type (builtin_type (objfile)->builtin_core_addr);
sym->set_domain (LABEL_DOMAIN);
list_to_add = cu->list_in_scope;
/* SYMBOL_BLOCK_VALUE (sym) will be filled in later by
finish_block. */
sym->set_domain (FUNCTION_DOMAIN);
- sym->set_aclass_index (LOC_BLOCK);
+ sym->set_loc_class_index (LOC_BLOCK);
/* DW_TAG_entry_point provides an additional entry_point to an
existing sub_program. Therefore, we inherit the "external"
attribute from the sub_program to which the entry_point
/* SYMBOL_BLOCK_VALUE (sym) will be filled in later by
finish_block. */
sym->set_domain (FUNCTION_DOMAIN);
- sym->set_aclass_index (LOC_BLOCK);
+ sym->set_loc_class_index (LOC_BLOCK);
attr2 = dwarf2_attr (die, DW_AT_external, cu);
if ((attr2 != nullptr && attr2->as_boolean ())
|| cu->lang () == language_ada
/* For Import, create a symbol using the source
name, and have it refer to the linkage name. */
SYMBOL_LOCATION_BATON (sym) = (void *) linkagename;
- sym->set_aclass_index (ada_block_index);
+ sym->set_loc_class_index (ada_block_index);
}
else
{
/* SYMBOL_BLOCK_VALUE (sym) will be filled in later by
finish_block. */
sym->set_domain (FUNCTION_DOMAIN);
- sym->set_aclass_index (LOC_BLOCK);
+ sym->set_loc_class_index (LOC_BLOCK);
sym->set_is_inlined (1);
list_to_add = cu->list_in_scope;
break;
&& die->parent->tag == DW_TAG_common_block)
attr2 = NULL;
- if (sym->aclass () == LOC_STATIC
+ if (sym->loc_class () == LOC_STATIC
&& sym->value_address () == 0
&& !per_objfile->per_bfd->has_section_at_zero)
{
}
else if (attr2 != nullptr && attr2->as_boolean ())
{
- if (sym->aclass () == LOC_STATIC
+ if (sym->loc_class () == LOC_STATIC
&& (objfile->flags & OBJF_MAINLINE) == 0
&& per_objfile->per_bfd->can_copy)
{
? cu->get_builder ()->get_global_symbols ()
: cu->list_in_scope);
SYMBOL_LOCATION_BATON (sym) = (void *) linkagename;
- sym->set_aclass_index (ada_imported_index);
+ sym->set_loc_class_index (ada_imported_index);
}
else if (attr2 != nullptr && attr2->as_boolean ()
&& dwarf2_attr (die, DW_AT_type, cu) != NULL)
? cu->get_builder ()->get_global_symbols ()
: cu->list_in_scope);
- sym->set_aclass_index (LOC_UNRESOLVED);
+ sym->set_loc_class_index (LOC_UNRESOLVED);
}
else if (!die_is_declaration (die, cu))
{
/* Use the default LOC_OPTIMIZED_OUT class. */
- gdb_assert (sym->aclass () == LOC_OPTIMIZED_OUT);
+ gdb_assert (sym->loc_class () == LOC_OPTIMIZED_OUT);
if (!suppress_add)
list_to_add = cu->list_in_scope;
}
there's a special hack for C++ in the matching code,
so we don't need to enter a separate typedef for the
tag. */
- sym->set_aclass_index (LOC_TYPEDEF);
+ sym->set_loc_class_index (LOC_TYPEDEF);
sym->set_domain (STRUCT_DOMAIN);
}
else
{
/* Other languages don't have a tag namespace. */
- sym->set_aclass_index (LOC_TYPEDEF);
+ sym->set_loc_class_index (LOC_TYPEDEF);
sym->set_domain (TYPE_DOMAIN);
}
case DW_TAG_base_type:
case DW_TAG_subrange_type:
case DW_TAG_generic_subrange:
- sym->set_aclass_index (LOC_TYPEDEF);
+ sym->set_loc_class_index (LOC_TYPEDEF);
sym->set_domain (TYPE_DOMAIN);
list_to_add = cu->list_in_scope;
break;
case DW_TAG_imported_declaration:
case DW_TAG_namespace:
sym->set_domain (TYPE_DOMAIN);
- sym->set_aclass_index (LOC_TYPEDEF);
+ sym->set_loc_class_index (LOC_TYPEDEF);
list_to_add = cu->get_builder ()->get_global_symbols ();
break;
case DW_TAG_module:
- sym->set_aclass_index (LOC_TYPEDEF);
+ sym->set_loc_class_index (LOC_TYPEDEF);
sym->set_domain (MODULE_DOMAIN);
list_to_add = cu->get_builder ()->get_global_symbols ();
break;
case DW_TAG_common_block:
- sym->set_aclass_index (LOC_COMMON_BLOCK);
+ sym->set_loc_class_index (LOC_COMMON_BLOCK);
sym->set_domain (COMMON_BLOCK_DOMAIN);
list_to_add = cu->list_in_scope;
break;
case DW_TAG_namelist:
- sym->set_aclass_index (LOC_STATIC);
+ sym->set_loc_class_index (LOC_STATIC);
sym->set_domain (VAR_DOMAIN);
list_to_add = cu->list_in_scope;
break;
if (baton != NULL)
{
SYMBOL_LOCATION_BATON (sym) = baton;
- sym->set_aclass_index (dwarf2_locexpr_index);
+ sym->set_loc_class_index (dwarf2_locexpr_index);
}
else if (bytes != NULL)
{
sym->set_value_bytes (bytes);
- sym->set_aclass_index (LOC_CONST_BYTES);
+ sym->set_loc_class_index (LOC_CONST_BYTES);
}
else
{
sym->set_value_longest (value);
- sym->set_aclass_index (LOC_CONST);
+ sym->set_loc_class_index (LOC_CONST);
}
}
case DW_OP_deref:
/* If we're not the last op, then we definitely can't encode
- this using GDB's address_class enum. This is valid for partial
+ this using GDB's location_class enum. This is valid for partial
global symbols, although the variable's address will be bogus
in the psymtab. */
if (i < size)
complaint (_("Location list used without "
"specifying the CU base address."));
- sym->set_aclass_index ((is_block
+ sym->set_loc_class_index ((is_block
? dwarf2_loclist_block_index
: dwarf2_loclist_index));
SYMBOL_LOCATION_BATON (sym) = baton;
baton->size = 0;
}
- sym->set_aclass_index ((is_block
+ sym->set_loc_class_index ((is_block
? dwarf2_locexpr_block_index
: dwarf2_locexpr_index));
SYMBOL_LOCATION_BATON (sym) = baton;
if (noside == EVAL_AVOID_SIDE_EFFECTS)
{
struct type *type = lookup_pointer_type (var->type ());
- enum address_class sym_class = var->aclass ();
+ location_class loc_class = var->loc_class ();
- if (sym_class == LOC_CONST
- || sym_class == LOC_CONST_BYTES
- || sym_class == LOC_REGISTER)
+ if (loc_class == LOC_CONST
+ || loc_class == LOC_CONST_BYTES
+ || loc_class == LOC_REGISTER)
error (_("Attempt to take address of register or constant."));
return value::zero (type, not_lval);
static inline bool
check_constant (struct symbol *sym)
{
- enum address_class sc = sym->aclass ();
- return (sc == LOC_BLOCK
- || sc == LOC_CONST
- || sc == LOC_CONST_BYTES
- || sc == LOC_LABEL);
+ location_class lc = sym->loc_class ();
+ return (lc == LOC_BLOCK
+ || lc == LOC_CONST
+ || lc == LOC_CONST_BYTES
+ || lc == LOC_LABEL);
}
static inline bool
{
result = lookup_symbol (tmp.c_str (), pstate->expression_context_block,
domain, NULL);
- if (result.symbol && result.symbol->aclass () == LOC_TYPEDEF)
+ if (result.symbol && result.symbol->loc_class () == LOC_TYPEDEF)
{
yylval.tsym.type = result.symbol->type ();
return TYPENAME;
const struct common_block *common = sym->value_common_block ();
size_t index;
- gdb_assert (sym->aclass () == LOC_COMMON_BLOCK);
+ gdb_assert (sym->loc_class () == LOC_COMMON_BLOCK);
if (comname && (!sym->linkage_name ()
|| strcmp (comname, sym->linkage_name ()) != 0))
computed_ops != nullptr)
return computed_ops->get_symbol_read_needs (sym);
- switch (sym->aclass ())
+ switch (sym->loc_class ())
{
/* All cases listed explicitly so that gcc -Wall will detect it if
we failed to consider one. */
if (const symbol_computed_ops *computed_ops = var->computed_ops ())
return computed_ops->read_variable (var, frame);
- switch (var->aclass ())
+ switch (var->loc_class ())
{
case LOC_CONST:
if (is_dynamic_type (type))
const symbol_register_ops *reg_ops = var->register_ops ();
int regno = reg_ops->register_number (var, get_frame_arch (frame));
- if (var->aclass () == LOC_REGPARM_ADDR)
+ if (var->loc_class () == LOC_REGPARM_ADDR)
addr = value_as_address
(value_from_register (lookup_pointer_type (type), regno, frame));
else
SEARCH_FUNCTION_DOMAIN, nullptr);
/* This lookup should always yield a block-valued symbol. */
- if (bs.symbol != nullptr && bs.symbol->aclass () == LOC_BLOCK)
+ if (bs.symbol != nullptr && bs.symbol->loc_class () == LOC_BLOCK)
{
const struct block *block = bs.symbol->value_block ();
gdb_assert (block != nullptr);
&is_a_field_of_this).symbol;
if (sym
- && sym->aclass () == LOC_TYPEDEF
+ && sym->loc_class () == LOC_TYPEDEF
&& sym->type ()->code () == TYPE_CODE_MODULE)
return 1;
= syscm_get_valid_symbol_smob_arg_unsafe (self, SCM_ARG1, FUNC_NAME);
const struct symbol *symbol = s_smob->symbol;
- return scm_from_int (symbol->aclass ());
+ return scm_from_int (symbol->loc_class ());
}
/* (symbol-argument? <gdb:symbol>) -> boolean */
symbol_smob *s_smob
= syscm_get_valid_symbol_smob_arg_unsafe (self, SCM_ARG1, FUNC_NAME);
const struct symbol *symbol = s_smob->symbol;
- enum address_class theclass;
+ location_class loc_class = symbol->loc_class ();
- theclass = symbol->aclass ();
-
- return scm_from_bool (theclass == LOC_CONST || theclass == LOC_CONST_BYTES);
+ return scm_from_bool (loc_class == LOC_CONST || loc_class == LOC_CONST_BYTES);
}
/* (symbol-function? <gdb:symbol>) -> boolean */
symbol_smob *s_smob
= syscm_get_valid_symbol_smob_arg_unsafe (self, SCM_ARG1, FUNC_NAME);
const struct symbol *symbol = s_smob->symbol;
- enum address_class theclass;
-
- theclass = symbol->aclass ();
+ location_class loc_class = symbol->loc_class ();
- return scm_from_bool (theclass == LOC_BLOCK);
+ return scm_from_bool (loc_class == LOC_BLOCK);
}
/* (symbol-variable? <gdb:symbol>) -> boolean */
symbol_smob *s_smob
= syscm_get_valid_symbol_smob_arg_unsafe (self, SCM_ARG1, FUNC_NAME);
const struct symbol *symbol = s_smob->symbol;
- enum address_class theclass;
-
- theclass = symbol->aclass ();
+ location_class loc_class = symbol->loc_class ();
return scm_from_bool (!symbol->is_argument ()
- && (theclass == LOC_LOCAL || theclass == LOC_REGISTER
- || theclass == LOC_STATIC || theclass == LOC_COMPUTED
- || theclass == LOC_OPTIMIZED_OUT));
+ && (loc_class == LOC_LOCAL || loc_class == LOC_REGISTER
+ || loc_class == LOC_STATIC || loc_class == LOC_COMPUTED
+ || loc_class == LOC_OPTIMIZED_OUT));
}
/* (symbol-needs-frame? <gdb:symbol>) -> boolean
if (!gdbscm_is_false (frame_scm))
f_smob = frscm_get_frame_smob_arg_unsafe (frame_scm, frame_pos, FUNC_NAME);
- if (symbol->aclass () == LOC_TYPEDEF)
+ if (symbol->loc_class () == LOC_TYPEDEF)
{
gdbscm_out_of_range_error (FUNC_NAME, SCM_ARG1, self,
_("cannot get the value of a typedef"));
if (inline_skipped_frames (tp) > 0)
{
const symbol *sym = inline_skipped_symbol (tp);
- if (sym->aclass () == LOC_BLOCK)
+ if (sym->loc_class () == LOC_BLOCK)
{
const block *block = sym->value_block ();
if (block->end () < tp->control.step_range_end)
/* The name. */
block_name->set_domain (FUNCTION_DOMAIN);
- block_name->set_aclass_index (LOC_BLOCK);
+ block_name->set_loc_class_index (LOC_BLOCK);
block_name->set_symtab (filetab);
block_name->set_type (lookup_function_type (block_type));
block_name->set_value_block (new_block);
symbol->set_section_index (0);
symbol->set_type (type);
symbol->set_domain (TYPE_DOMAIN);
- symbol->set_aclass_index (LOC_TYPEDEF);
+ symbol->set_loc_class_index (LOC_TYPEDEF);
return symbol;
}
{
/* In list mode, add all matching symbols, regardless of class.
This allows the user to type "list a_global_variable". */
- if (bsym->symbol->aclass () == LOC_BLOCK || this->state->list_mode)
+ if (bsym->symbol->loc_class () == LOC_BLOCK || this->state->list_mode)
this->result.symbols->push_back (*bsym);
/* Continue iterating. */
line 16 will also result in a breakpoint in main, at line 17. */
if (!was_exact
&& sym != nullptr
- && sym->aclass () == LOC_BLOCK
+ && sym->loc_class () == LOC_BLOCK
&& sal.pc == sym->value_block ()->entry_pc ()
&& val.line < sym->line ())
continue;
if (state->funfirstline
&& !ls->minimal_symbols.empty ()
- && sym.symbol->aclass () == LOC_BLOCK)
+ && sym.symbol->loc_class () == LOC_BLOCK)
{
const CORE_ADDR addr
= sym.symbol->value_block ()->entry_pc ();
struct type *t;
struct symbol *sym = bsym->symbol;
- if (sym->aclass () != LOC_TYPEDEF)
+ if (sym->loc_class () != LOC_TYPEDEF)
return true; /* Continue iterating. */
t = sym->type ();
symbol_to_sal (struct symtab_and_line *result,
bool funfirstline, struct symbol *sym)
{
- if (sym->aclass () == LOC_BLOCK)
+ if (sym->loc_class () == LOC_BLOCK)
{
*result = find_function_start_sal (sym, funfirstline);
return true;
}
else
{
- if (sym->aclass () == LOC_LABEL && sym->value_address () != 0)
+ if (sym->loc_class () == LOC_LABEL && sym->value_address () != 0)
{
*result = {};
result->symtab = sym->symtab ();
{ struct symbol *tem
= lookup_symbol (copy_name ($3).c_str (), $1,
SEARCH_VFT, 0).symbol;
- if (!tem || tem->aclass () != LOC_BLOCK)
+ if (!tem || tem->loc_class () != LOC_BLOCK)
error (_("No function \"%s\" in specified context."),
copy_name ($3).c_str ());
$$ = tem;
sym = lookup_symbol (tmp.c_str (), pstate->expression_context_block,
SEARCH_VFT, 0).symbol;
- if (sym && sym->aclass () == LOC_BLOCK)
+ if (sym && sym->loc_class () == LOC_BLOCK)
return BLOCKNAME;
if (lookup_typename (pstate->language (),
tmp.c_str (), pstate->expression_context_block, 1))
if(sym)
{
- switch(sym->aclass ())
+ switch(sym->loc_class ())
{
case LOC_STATIC:
case LOC_REGISTER:
int, const char *);
static struct symbol *mylookup_symbol (const char *, const struct block *,
- domain_enum, enum address_class);
+ domain_enum, location_class);
static void sort_blocks (struct symtab *);
mdebug_reg_to_regnum
};
-/* The "aclass" indices for computed symbols. */
+/* The "loc_class" indices for computed symbols. */
static int mdebug_register_index;
static int mdebug_regparm_index;
static void
add_data_symbol (SYMR *sh, union aux_ext *ax, int bigend,
- struct symbol *s, int aclass_index, struct block *b,
+ struct symbol *s, int loc_class_index, struct block *b,
struct objfile *objfile, const char *name)
{
s->set_domain (VAR_DOMAIN);
- s->set_aclass_index (aclass_index);
+ s->set_loc_class_index (loc_class_index);
add_symbol (s, top_stack->cur_st, b);
/* Type could be missing if file is compiled without debugging info. */
{
case scRegister:
/* Pass by value in register. */
- s->set_aclass_index (mdebug_register_index);
+ s->set_loc_class_index (mdebug_register_index);
break;
case scVar:
/* Pass by reference on stack. */
- s->set_aclass_index (LOC_REF_ARG);
+ s->set_loc_class_index (LOC_REF_ARG);
break;
case scVarRegister:
/* Pass by reference in register. */
- s->set_aclass_index (mdebug_regparm_index);
+ s->set_loc_class_index (mdebug_regparm_index);
break;
default:
/* Pass by value on stack. */
- s->set_aclass_index (LOC_ARG);
+ s->set_loc_class_index (LOC_ARG);
break;
}
s->set_value_longest (svalue);
case stLabel: /* label, goes into current block. */
s = new_symbol (name);
s->set_domain (LABEL_DOMAIN); /* So that it can be used */
- s->set_aclass_index (LOC_LABEL); /* but not misused. */
+ s->set_loc_class_index (LOC_LABEL); /* but not misused. */
s->set_section_index (section_index);
s->set_value_address (sh->value);
s->set_type (builtin_type (objfile)->builtin_int);
}
s = new_symbol (name);
s->set_domain (FUNCTION_DOMAIN);
- s->set_aclass_index (LOC_BLOCK);
+ s->set_loc_class_index (LOC_BLOCK);
s->set_section_index (section_index);
/* Type of the return value. */
if (SC_IS_UNDEF (sh->sc) || sh->sc == scNil)
enum_sym->set_linkage_name
(obstack_strdup (&mdebugread_objfile->objfile_obstack,
f->name ()));
- enum_sym->set_aclass_index (LOC_CONST);
+ enum_sym->set_loc_class_index (LOC_CONST);
enum_sym->set_type (t);
enum_sym->set_domain (VAR_DOMAIN);
enum_sym->set_value_longest (tsym.value);
s = new_symbol (name);
s->set_domain (STRUCT_DOMAIN);
- s->set_aclass_index (LOC_TYPEDEF);
+ s->set_loc_class_index (LOC_TYPEDEF);
s->set_value_longest (0);
s->set_type (t);
add_symbol (s, top_stack->cur_st, top_stack->cur_block);
/* Make up special symbol to contain procedure specific info. */
s = new_symbol (MDEBUG_EFI_SYMBOL_NAME);
s->set_domain (LABEL_DOMAIN);
- s->set_aclass_index (LOC_CONST);
+ s->set_loc_class_index (LOC_CONST);
s->set_type (builtin_type (mdebugread_objfile)->builtin_void);
e = OBSTACK_ZALLOC (&mdebugread_objfile->objfile_obstack,
mdebug_extra_func_info);
break;
s = new_symbol (name);
s->set_domain (TYPE_DOMAIN);
- s->set_aclass_index (LOC_TYPEDEF);
+ s->set_loc_class_index (LOC_TYPEDEF);
s->set_value_block (top_stack->cur_block);
s->set_type (t);
add_symbol (s, top_stack->cur_st, top_stack->cur_block);
for (cur_sdx = 0; cur_sdx < fh->csym;)
{
char *sym_name;
- enum address_class theclass;
+ location_class loc_class;
unrelocated_addr minsym_value;
int section = -1;
reader.record_with_info (sym_name, minsym_value,
mst_file_bss,
SECT_OFF_BSS (objfile));
- theclass = LOC_STATIC;
+ loc_class = LOC_STATIC;
break;
case stIndirect: /* Irix5 forward declaration */
structs from alpha and mips cc. */
if (sh.iss == 0 || has_opaque_xref (fh, &sh))
goto skip;
- theclass = LOC_TYPEDEF;
+ loc_class = LOC_TYPEDEF;
break;
case stConstant: /* Constant decl */
- theclass = LOC_CONST;
+ loc_class = LOC_CONST;
break;
case stUnion:
}
/* Use this gdb symbol. */
pst->add_psymbol (sym_name, true,
- VAR_DOMAIN, theclass, section,
+ VAR_DOMAIN, loc_class, section,
psymbol_placement::STATIC,
unrelocated_addr (sh.value),
psymtab_language,
PST_PRIVATE (save_pst)->extern_tab = ext_ptr;
for (; --cur_sdx >= 0; ext_ptr++)
{
- enum address_class theclass;
+ location_class loc_class;
SYMR *psh;
CORE_ADDR svalue;
int section;
Ignore them, as parse_external will ignore them too. */
continue;
case stLabel:
- theclass = LOC_LABEL;
+ loc_class = LOC_LABEL;
break;
default:
unknown_ext_complaint (debug_info->ssext + psh->iss);
if (SC_IS_COMMON (psh->sc))
continue;
- theclass = LOC_STATIC;
+ loc_class = LOC_STATIC;
break;
}
char *sym_name = debug_info->ssext + psh->iss;
pst->add_psymbol (sym_name, true,
- VAR_DOMAIN, theclass,
+ VAR_DOMAIN, loc_class,
section,
psymbol_placement::GLOBAL,
unrelocated_addr (svalue),
struct symbol *s = new_symbol (MDEBUG_EFI_SYMBOL_NAME);
s->set_domain (LABEL_DOMAIN);
- s->set_aclass_index (LOC_CONST);
+ s->set_loc_class_index (LOC_CONST);
s->set_type (builtin_type (objfile)->builtin_void);
s->set_value_bytes ((gdb_byte *) e);
e->pdr.framereg = -1;
static struct symbol *
mylookup_symbol (const char *name, const struct block *block,
- domain_enum domain, enum address_class theclass)
+ domain_enum domain, location_class loc_class)
{
int inc;
{
if (sym->linkage_name ()[0] == inc
&& sym->domain () == domain
- && sym->aclass () == theclass
+ && sym->loc_class () == loc_class
&& strcmp (sym->linkage_name (), name) == 0)
return sym;
}
block = block->superblock ();
if (block)
- return mylookup_symbol (name, block, domain, theclass);
+ return mylookup_symbol (name, block, domain, loc_class);
return 0;
}
{
int print_me = 0;
- switch (sym->aclass ())
+ switch (sym->loc_class ())
{
default:
case LOC_UNDEF: /* catches errors */
static void
mips_make_symbol_special (struct symbol *sym, struct objfile *objfile)
{
- if (sym->aclass () == LOC_BLOCK)
+ if (sym->loc_class () == LOC_BLOCK)
{
/* We are in symbol reading so it is OK to cast away constness. */
struct block *block = (struct block *) sym->value_block ();
any symbols in STRUCT_DOMAIN or UNDEF_DOMAIN.
But I'm leaving out that test, on the theory that
they can't possibly pass the tests below. */
- if ((sym->aclass () == LOC_LABEL
- || sym->aclass () == LOC_STATIC)
+ if ((sym->loc_class () == LOC_LABEL
+ || sym->loc_class () == LOC_STATIC)
&& sym->section_index () >= 0)
sym->set_value_address (sym->value_address ()
+ delta[sym->section_index ()]);
/* Call lookup_symtab, not lookup_partial_symtab, in case there are
no psymtabs (coff, xcoff, or some future change to blow away the
psymtabs once once symbols are read). */
- if ((sym && sym->aclass () == LOC_BLOCK)
+ if ((sym && sym->loc_class () == LOC_BLOCK)
|| lookup_symtab (current_program_space, tmp.c_str ()))
{
yylval.ssym.sym.symbol = sym;
free (uptokstart);
return BLOCKNAME;
}
- if (sym && sym->aclass () == LOC_TYPEDEF)
+ if (sym && sym->loc_class () == LOC_TYPEDEF)
{
#if 1
/* Despite the following flaw, we need to keep this code enabled.
SEARCH_VFT, NULL).symbol;
if (cur_sym)
{
- if (cur_sym->aclass () == LOC_TYPEDEF)
+ if (cur_sym->loc_class () == LOC_TYPEDEF)
{
best_sym = cur_sym;
pstate->lexptr = p;
return;
}
- switch (sym->aclass ())
+ switch (sym->loc_class ())
{
case LOC_CONST:
case LOC_CONST_BYTES:
for (const partial_symbol *p : psymtab->global_psymbols)
{
if (p->domain == VAR_DOMAIN
- && p->aclass == LOC_BLOCK
+ && p->loc_class == LOC_BLOCK
&& pc >= p->address (objfile)
&& (p->address (objfile) > best_pc
|| (psymtab->text_low (objfile) == 0
for (const partial_symbol *p : psymtab->static_psymbols)
{
if (p->domain == VAR_DOMAIN
- && p->aclass == LOC_BLOCK
+ && p->loc_class == LOC_BLOCK
&& pc >= p->address (objfile)
&& (p->address (objfile) > best_pc
|| (psymtab->text_low (objfile) == 0
gdb_puts ("<invalid domain>, ", outfile);
break;
}
- switch (p->aclass)
+ switch (p->loc_class)
{
case LOC_UNDEF:
gdb_puts ("undefined", outfile);
struct partial_symbol *psymbol = (struct partial_symbol *) addr;
unsigned int lang = psymbol->ginfo.language ();
unsigned int domain = psymbol->domain;
- unsigned int theclass = psymbol->aclass;
+ unsigned int loc_class = psymbol->loc_class;
h = fast_hash (&psymbol->ginfo.m_value, sizeof (psymbol->ginfo.m_value), h);
h = fast_hash (&lang, sizeof (unsigned int), h);
h = fast_hash (&domain, sizeof (unsigned int), h);
- h = fast_hash (&theclass, sizeof (unsigned int), h);
+ h = fast_hash (&loc_class, sizeof (unsigned int), h);
/* Note that psymbol names are interned via compute_and_set_names, so
there's no need to hash the contents of the name here. */
h = fast_hash (&psymbol->ginfo.m_name, sizeof (psymbol->ginfo.m_name), h);
sizeof (sym1->ginfo.m_value)) == 0
&& sym1->ginfo.language () == sym2->ginfo.language ()
&& sym1->domain == sym2->domain
- && sym1->aclass == sym2->aclass
+ && sym1->loc_class == sym2->loc_class
/* Note that psymbol names are interned via
compute_and_set_names, so there's no need to compare the
contents of the name here. */
void
partial_symtab::add_psymbol (std::string_view name, bool copy_name,
domain_enum domain,
- enum address_class theclass,
+ location_class loc_class,
int section,
psymbol_placement where,
unrelocated_addr coreaddr,
psymbol.set_unrelocated_address (coreaddr);
psymbol.ginfo.set_section_index (section);
psymbol.domain = domain;
- psymbol.aclass = theclass;
+ psymbol.loc_class = loc_class;
psymbol.ginfo.set_language (language, partial_symtabs->obstack ());
psymbol.ginfo.compute_and_set_names (name, copy_name, objfile->per_bfd);
{
/* Skip symbols for inlined functions without address. These may
or may not have a match in the full symtab. */
- if (psym->aclass == LOC_BLOCK
+ if (psym->loc_class == LOC_BLOCK
&& psym->ginfo.value_address () == 0)
continue;
ENUM_BITFIELD(domain_enum) domain : SYMBOL_DOMAIN_BITS;
/* Address class (for info_symbols). Note that we don't allow
- synthetic "aclass" values here at present, simply because there's
+ synthetic "loc_class" values here at present, simply because there's
no need. */
- ENUM_BITFIELD(address_class) aclass : SYMBOL_ACLASS_BITS;
+ ENUM_BITFIELD(location_class) loc_class : SYMBOL_LOC_CLASS_BITS;
};
/* A convenience enum to give names to some constants used when
If COPY_NAME is true, make a copy of NAME, otherwise use the passed
reference.
- THECLASS is the type of symbol.
+ LOC_CLASS is the type of symbol.
SECTION is the index of the section of OBJFILE in which the symbol is found.
void add_psymbol (std::string_view name,
bool copy_name, domain_enum domain,
- enum address_class theclass,
+ location_class loc_class,
int section,
psymbol_placement where,
unrelocated_addr coreaddr,
{
int print_me = 0;
- switch (sym->aclass ())
+ switch (sym->loc_class ())
{
default:
case LOC_UNDEF: /* catches errors */
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
sympy_is_constant (PyObject *self, void *closure)
{
struct symbol *symbol = NULL;
- enum address_class theclass;
SYMPY_REQUIRE_VALID (self, symbol);
- theclass = symbol->aclass ();
+ location_class loc_class = symbol->loc_class ();
- return PyBool_FromLong (theclass == LOC_CONST || theclass == LOC_CONST_BYTES);
+ return PyBool_FromLong (loc_class == LOC_CONST || loc_class == LOC_CONST_BYTES);
}
static PyObject *
sympy_is_function (PyObject *self, void *closure)
{
struct symbol *symbol = NULL;
- enum address_class theclass;
SYMPY_REQUIRE_VALID (self, symbol);
- theclass = symbol->aclass ();
+ location_class loc_class = symbol->loc_class ();
- return PyBool_FromLong (theclass == LOC_BLOCK);
+ return PyBool_FromLong (loc_class == LOC_BLOCK);
}
static PyObject *
sympy_is_variable (PyObject *self, void *closure)
{
struct symbol *symbol = NULL;
- enum address_class theclass;
SYMPY_REQUIRE_VALID (self, symbol);
- theclass = symbol->aclass ();
+ location_class loc_class = symbol->loc_class ();
return PyBool_FromLong (!symbol->is_argument ()
- && (theclass == LOC_LOCAL || theclass == LOC_REGISTER
- || theclass == LOC_STATIC || theclass == LOC_COMPUTED
- || theclass == LOC_OPTIMIZED_OUT));
+ && (loc_class == LOC_LOCAL || loc_class == LOC_REGISTER
+ || loc_class == LOC_STATIC || loc_class == LOC_COMPUTED
+ || loc_class == LOC_OPTIMIZED_OUT));
}
/* Implementation of Symbol.is_artificial. */
}
SYMPY_REQUIRE_VALID (self, symbol);
- if (symbol->aclass () == LOC_TYPEDEF)
+ if (symbol->loc_class () == LOC_TYPEDEF)
{
PyErr_SetString (PyExc_TypeError, "cannot get the value of a typedef");
return NULL;
}
sym = TYPE_TEMPLATE_ARGUMENT (type, argno);
- if (sym->aclass () == LOC_TYPEDEF)
+ if (sym->loc_class () == LOC_TYPEDEF)
return type_to_type_object (sym->type ());
- else if (sym->aclass () == LOC_OPTIMIZED_OUT)
+ else if (sym->loc_class () == LOC_OPTIMIZED_OUT)
{
PyErr_Format (PyExc_RuntimeError,
_("Template argument is optimized out"));
struct block_symbol sym = lookup_symbol (name.c_str (),
pstate->expression_context_block,
SEARCH_VFT);
- if (sym.symbol != nullptr && sym.symbol->aclass () != LOC_TYPEDEF)
+ if (sym.symbol != nullptr && sym.symbol->loc_class () != LOC_TYPEDEF)
return make_operation<var_value_operation> (sym);
struct type *type = nullptr;
if (sym.symbol != nullptr)
{
- gdb_assert (sym.symbol->aclass () == LOC_TYPEDEF);
+ gdb_assert (sym.symbol->loc_class () == LOC_TYPEDEF);
type = sym.symbol->type ();
}
if (type == nullptr)
a N_GSYM stab for it, but no regular (C_EXT) symbol. */
sym = new (&objfile->objfile_obstack) symbol;
sym->set_domain (VAR_DOMAIN);
- sym->set_aclass_index (LOC_OPTIMIZED_OUT);
+ sym->set_loc_class_index (LOC_OPTIMIZED_OUT);
sym->set_linkage_name
(obstack_strndup (&objfile->objfile_obstack, name, pp - name));
pp += 2;
stab_reg_to_regnum
};
-/* The "aclass" indices for computed symbols. */
+/* The "loc_class" indices for computed symbols. */
static int stab_register_index;
static int stab_regparm_index;
(where type 6 is defined by "blobs:t6=eblob1:0,blob2:1,;"). */
if (*p != '=')
{
- sym->set_aclass_index (LOC_CONST);
+ sym->set_loc_class_index (LOC_CONST);
sym->set_type (error_type (&p, objfile));
sym->set_domain (VAR_DOMAIN);
add_symbol_to_list (sym, get_file_symbols ());
sym->set_type (dbl_type);
sym->set_value_bytes (dbl_valu);
- sym->set_aclass_index (LOC_CONST_BYTES);
+ sym->set_loc_class_index (LOC_CONST_BYTES);
}
break;
case 'i':
sym->set_type (builtin_type (objfile)->builtin_long);
sym->set_value_longest (atoi (p));
- sym->set_aclass_index (LOC_CONST);
+ sym->set_loc_class_index (LOC_CONST);
}
break;
{
sym->set_type (builtin_type (objfile)->builtin_char);
sym->set_value_longest (atoi (p));
- sym->set_aclass_index (LOC_CONST);
+ sym->set_loc_class_index (LOC_CONST);
}
break;
if (quote != '\'' && quote != '"')
{
- sym->set_aclass_index (LOC_CONST);
+ sym->set_loc_class_index (LOC_CONST);
sym->set_type (error_type (&p, objfile));
sym->set_domain (VAR_DOMAIN);
add_symbol_to_list (sym, get_file_symbols ());
}
if (*p != quote)
{
- sym->set_aclass_index (LOC_CONST);
+ sym->set_loc_class_index (LOC_CONST);
sym->set_type (error_type (&p, objfile));
sym->set_domain (VAR_DOMAIN);
add_symbol_to_list (sym, get_file_symbols ());
p++;
sym->set_value_bytes (string_value);
- sym->set_aclass_index (LOC_CONST_BYTES);
+ sym->set_loc_class_index (LOC_CONST_BYTES);
}
break;
e.g. "b:c=e6,0" for "const b = blob1"
(where type 6 is defined by "blobs:t6=eblob1:0,blob2:1,;"). */
{
- sym->set_aclass_index (LOC_CONST);
+ sym->set_loc_class_index (LOC_CONST);
sym->set_type (read_type (&p, objfile));
if (*p != ',')
break;
default:
{
- sym->set_aclass_index (LOC_CONST);
+ sym->set_loc_class_index (LOC_CONST);
sym->set_type (error_type (&p, objfile));
}
}
case 'C':
/* The name of a caught exception. */
sym->set_type (read_type (&p, objfile));
- sym->set_aclass_index (LOC_LABEL);
+ sym->set_loc_class_index (LOC_LABEL);
sym->set_domain (VAR_DOMAIN);
sym->set_value_address (valu);
add_symbol_to_list (sym, get_local_symbols ());
case 'f':
/* A static function definition. */
sym->set_type (read_type (&p, objfile));
- sym->set_aclass_index (LOC_BLOCK);
+ sym->set_loc_class_index (LOC_BLOCK);
sym->set_domain (FUNCTION_DOMAIN);
add_symbol_to_list (sym, get_file_symbols ());
/* fall into process_function_types. */
case 'F':
/* A global function definition. */
sym->set_type (read_type (&p, objfile));
- sym->set_aclass_index (LOC_BLOCK);
+ sym->set_loc_class_index (LOC_BLOCK);
sym->set_domain (FUNCTION_DOMAIN);
add_symbol_to_list (sym, get_global_symbols ());
goto process_function_types;
corresponding linker definition to find the value.
These definitions appear at the end of the namelist. */
sym->set_type (read_type (&p, objfile));
- sym->set_aclass_index (LOC_STATIC);
+ sym->set_loc_class_index (LOC_STATIC);
sym->set_domain (VAR_DOMAIN);
/* Don't add symbol references to global_sym_chain.
Symbol references don't have valid names and won't match up with
case 's':
case 'l':
sym->set_type (read_type (&p, objfile));
- sym->set_aclass_index (LOC_LOCAL);
+ sym->set_loc_class_index (LOC_LOCAL);
sym->set_value_longest (valu);
sym->set_domain (VAR_DOMAIN);
add_symbol_to_list (sym, get_local_symbols ());
else
sym->set_type (read_type (&p, objfile));
- sym->set_aclass_index (LOC_ARG);
+ sym->set_loc_class_index (LOC_ARG);
sym->set_value_longest (valu);
sym->set_domain (VAR_DOMAIN);
sym->set_is_argument (1);
case 'R':
/* Parameter which is in a register. */
sym->set_type (read_type (&p, objfile));
- sym->set_aclass_index (stab_register_index);
+ sym->set_loc_class_index (stab_register_index);
sym->set_is_argument (1);
sym->set_value_longest (valu);
sym->set_domain (VAR_DOMAIN);
case 'r':
/* Register variable (either global or local). */
sym->set_type (read_type (&p, objfile));
- sym->set_aclass_index (stab_register_index);
+ sym->set_loc_class_index (stab_register_index);
sym->set_value_longest (valu);
sym->set_domain (VAR_DOMAIN);
if (within_function)
struct symbol *prev_sym;
prev_sym = local_symbols->symbol[local_symbols->nsyms - 1];
- if ((prev_sym->aclass () == LOC_REF_ARG
- || prev_sym->aclass () == LOC_ARG)
+ if ((prev_sym->loc_class () == LOC_REF_ARG
+ || prev_sym->loc_class () == LOC_ARG)
&& strcmp (prev_sym->linkage_name (),
sym->linkage_name ()) == 0)
{
- prev_sym->set_aclass_index (stab_register_index);
+ prev_sym->set_loc_class_index (stab_register_index);
/* Use the type from the LOC_REGISTER; that is the type
that is actually in that register. */
prev_sym->set_type (sym->type ());
case 'S':
/* Static symbol at top level of file. */
sym->set_type (read_type (&p, objfile));
- sym->set_aclass_index (LOC_STATIC);
+ sym->set_loc_class_index (LOC_STATIC);
sym->set_value_address (valu);
sym->set_domain (VAR_DOMAIN);
add_symbol_to_list (sym, get_file_symbols ());
if (nameless)
return NULL;
- sym->set_aclass_index (LOC_TYPEDEF);
+ sym->set_loc_class_index (LOC_TYPEDEF);
sym->set_value_longest (valu);
sym->set_domain (TYPE_DOMAIN);
/* C++ vagaries: we may have a type which is derived from
struct symbol *struct_sym = new (&objfile->objfile_obstack) symbol;
*struct_sym = *sym;
- struct_sym->set_aclass_index (LOC_TYPEDEF);
+ struct_sym->set_loc_class_index (LOC_TYPEDEF);
struct_sym->set_value_longest (valu);
struct_sym->set_domain (STRUCT_DOMAIN);
if (sym->type ()->name () == 0)
if (nameless)
return NULL;
- sym->set_aclass_index (LOC_TYPEDEF);
+ sym->set_loc_class_index (LOC_TYPEDEF);
sym->set_value_longest (valu);
sym->set_domain (STRUCT_DOMAIN);
if (sym->type ()->name () == 0)
struct symbol *typedef_sym = new (&objfile->objfile_obstack) symbol;
*typedef_sym = *sym;
- typedef_sym->set_aclass_index (LOC_TYPEDEF);
+ typedef_sym->set_loc_class_index (LOC_TYPEDEF);
typedef_sym->set_value_longest (valu);
typedef_sym->set_domain (TYPE_DOMAIN);
if (sym->type ()->name () == 0)
case 'V':
/* Static symbol of local scope. */
sym->set_type (read_type (&p, objfile));
- sym->set_aclass_index (LOC_STATIC);
+ sym->set_loc_class_index (LOC_STATIC);
sym->set_value_address (valu);
sym->set_domain (VAR_DOMAIN);
add_symbol_to_list (sym, get_local_symbols ());
case 'v':
/* Reference parameter */
sym->set_type (read_type (&p, objfile));
- sym->set_aclass_index (LOC_REF_ARG);
+ sym->set_loc_class_index (LOC_REF_ARG);
sym->set_is_argument (1);
sym->set_value_longest (valu);
sym->set_domain (VAR_DOMAIN);
case 'a':
/* Reference parameter which is in a register. */
sym->set_type (read_type (&p, objfile));
- sym->set_aclass_index (stab_regparm_index);
+ sym->set_loc_class_index (stab_regparm_index);
sym->set_is_argument (1);
sym->set_value_longest (valu);
sym->set_domain (VAR_DOMAIN);
that Pascal uses it too, but when I tried it Pascal used
"x:3" (local symbol) instead. */
sym->set_type (read_type (&p, objfile));
- sym->set_aclass_index (LOC_LOCAL);
+ sym->set_loc_class_index (LOC_LOCAL);
sym->set_value_longest (valu);
sym->set_domain (VAR_DOMAIN);
add_symbol_to_list (sym, get_local_symbols ());
default:
sym->set_type (error_type (&p, objfile));
- sym->set_aclass_index (LOC_CONST);
+ sym->set_loc_class_index (LOC_CONST);
sym->set_value_longest (0);
sym->set_domain (VAR_DOMAIN);
add_symbol_to_list (sym, get_file_symbols ());
{
/* We have to convert LOC_REGISTER to LOC_REGPARM_ADDR (for
variables passed in a register). */
- if (sym->aclass () == LOC_REGISTER)
- sym->set_aclass_index (LOC_REGPARM_ADDR);
+ if (sym->loc_class () == LOC_REGISTER)
+ sym->set_loc_class_index (LOC_REGPARM_ADDR);
/* Likewise for converting LOC_ARG to LOC_REF_ARG (for the 7th
and subsequent arguments on SPARC, for example). */
- else if (sym->aclass () == LOC_ARG)
- sym->set_aclass_index (LOC_REF_ARG);
+ else if (sym->loc_class () == LOC_ARG)
+ sym->set_loc_class_index (LOC_REF_ARG);
}
return sym;
{
struct symbol *sym = ppt->symbol[i];
- if (sym->aclass () == LOC_TYPEDEF
+ if (sym->loc_class () == LOC_TYPEDEF
&& sym->domain () == STRUCT_DOMAIN
&& (sym->type ()->code () == code)
&& strcmp (sym->linkage_name (), type_name) == 0)
sym->set_linkage_name (name);
sym->set_language (get_current_subfile ()->language,
&objfile->objfile_obstack);
- sym->set_aclass_index (LOC_CONST);
+ sym->set_loc_class_index (LOC_CONST);
sym->set_domain (VAR_DOMAIN);
sym->set_value_longest (n);
if (n < 0)
sym = new (&objfile->objfile_obstack) symbol;
/* Note: common_block_name already saved on objfile_obstack. */
sym->set_linkage_name (common_block_name);
- sym->set_aclass_index (LOC_BLOCK);
+ sym->set_loc_class_index (LOC_BLOCK);
/* Now we copy all the symbols which have been defined since the BCOMM. */
{
struct symbol *sym = ppt->symbol[i];
- if (sym->aclass () == LOC_TYPEDEF
+ if (sym->loc_class () == LOC_TYPEDEF
&& sym->domain () == STRUCT_DOMAIN
&& (sym->type ()->code () == (*type)->code ())
&& ((*type)->instance_flags ()
the same symbol if there are multiple references. */
if (sym)
{
- if (sym->aclass () == LOC_BLOCK)
+ if (sym->loc_class () == LOC_BLOCK)
fix_common_block
(sym, msymbol->value_address (resolve_objfile),
msymbol->section_index ());
prev->set_value_address (0);
/* Complain about unresolved common block symbols. */
- if (prev->aclass () == LOC_STATIC)
- prev->set_aclass_index (LOC_UNRESOLVED);
+ if (prev->loc_class () == LOC_STATIC)
+ prev->set_loc_class_index (LOC_UNRESOLVED);
else
complaint (_("%s: common block `%s' from "
"global_sym_chain unresolved"),
break;
}
- switch (sym->aclass ())
+ switch (sym->loc_class ())
{
case LOC_ARG:
case LOC_REF_ARG:
nsym = lookup_symbol_search_name (sym->search_name (),
b, SEARCH_VAR_DOMAIN).symbol;
gdb_assert (nsym != NULL);
- if (nsym->aclass () == LOC_REGISTER
+ if (nsym->loc_class () == LOC_REGISTER
&& !nsym->is_argument ())
{
/* There is a LOC_ARG/LOC_REGISTER pair. This means
{
for (struct symbol *sym : block_iterator_range (b))
{
- switch (sym->aclass ())
+ switch (sym->loc_class ())
{
case LOC_CONST:
case LOC_CONST_BYTES:
}
else
{
- if (symbol->aclass () == LOC_TYPEDEF)
+ if (symbol->loc_class () == LOC_TYPEDEF)
gdb_printf (outfile, "typedef ");
if (symbol->type ())
{
else
gdb_printf (outfile, "%s ", symbol->print_name ());
- switch (symbol->aclass ())
+ switch (symbol->loc_class ())
{
case LOC_CONST:
gdb_printf (outfile, "const %s (%s)",
default:
gdb_printf (outfile, "botched symbol class %x",
- symbol->aclass ());
+ symbol->loc_class ());
break;
}
}
index without doing the check that is done by the wrapper macros
like SECT_OFF_TEXT. */
int fallback;
- switch (sym->aclass ())
+ switch (sym->loc_class ())
{
case LOC_STATIC:
fallback = objfile->sect_index_data;
for (struct symbol *sym : block_iterator_range (b))
{
- if (sym->aclass () == LOC_STATIC
+ if (sym->loc_class () == LOC_STATIC
&& sym->value_address () == addr)
return sym;
}
symbol *sym = find_pc_function (func_addr);
if (sym != NULL
- && sym->aclass () == LOC_BLOCK
+ && sym->loc_class () == LOC_BLOCK
&& sym->value_block ()->entry_pc () == func_addr)
return sym;
if ((kind & SEARCH_VAR_DOMAIN) != 0)
{
- if (sym->aclass () == LOC_UNRESOLVED
+ if (sym->loc_class () == LOC_UNRESOLVED
/* LOC_CONST can be used for more than
just enums, e.g., c++ static const
members. We only want to skip enums
here. */
- || (sym->aclass () == LOC_CONST
+ || (sym->loc_class () == LOC_CONST
&& (sym->type ()->code () == TYPE_CODE_ENUM)))
continue;
}
string_file tmp_stream;
type_print (sym->type (),
- (sym->aclass () == LOC_TYPEDEF
+ (sym->loc_class () == LOC_TYPEDEF
? "" : sym->print_name ()),
&tmp_stream, 0);
the msymbol name and removes the msymbol name from the completion
tracker. */
if (sym->language () == language_cplus
- && sym->aclass () == LOC_BLOCK)
+ && sym->loc_class () == LOC_BLOCK)
{
/* The call to canonicalize returns the empty string if the input
string is already in canonical form, thanks to this we don't
const lookup_name_info &lookup_name,
const char *text, const char *word)
{
- if (sym->aclass () == LOC_TYPEDEF)
+ if (sym->loc_class () == LOC_TYPEDEF)
{
struct type *t = sym->type ();
enum type_code c = t->code ();
bound_minimal_symbol
find_gnu_ifunc (const symbol *sym)
{
- if (sym->aclass () != LOC_BLOCK)
+ if (sym->loc_class () != LOC_BLOCK)
return {};
lookup_name_info lookup_name (sym->search_name (),
/* The next index to hand out in response to a registration request. */
-static int next_aclass_value = LOC_FINAL_VALUE;
+static int next_loc_class_value = LOC_FINAL_VALUE;
-/* The maximum number of "aclass" registrations we support. This is
+/* The maximum number of "loc_class" registrations we support. This is
constant for convenience. */
#define MAX_SYMBOL_IMPLS (LOC_FINAL_VALUE + 11)
-/* The objects representing the various "aclass" values. The elements
+/* The objects representing the various "loc_class" values. The elements
from 0 up to LOC_FINAL_VALUE-1 represent themselves, and subsequent
elements are those registered at gdb initialization time. */
/* Make sure we saved enough room in struct symbol. */
-static_assert (MAX_SYMBOL_IMPLS <= (1 << SYMBOL_ACLASS_BITS));
+static_assert (MAX_SYMBOL_IMPLS <= (1 << SYMBOL_LOC_CLASS_BITS));
-/* Register a computed symbol type. ACLASS must be LOC_COMPUTED. OPS
+/* Register a computed symbol type. LOC_CLASS must be LOC_COMPUTED. OPS
is the ops vector associated with this index. This returns the new
- index, which should be used as the aclass_index field for symbols
+ index, which should be used as the loc_class_index field for symbols
of this type. */
int
-register_symbol_computed_impl (enum address_class aclass,
+register_symbol_computed_impl (location_class loc_class,
const struct symbol_computed_ops *ops)
{
- int result = next_aclass_value++;
+ int result = next_loc_class_value++;
- gdb_assert (aclass == LOC_COMPUTED);
+ gdb_assert (loc_class == LOC_COMPUTED);
gdb_assert (result < MAX_SYMBOL_IMPLS);
- symbol_impl[result].aclass = aclass;
+ symbol_impl[result].loc_class = loc_class;
symbol_impl[result].ops_computed = ops;
/* Sanity check OPS. */
return result;
}
-/* Register a function with frame base type. ACLASS must be LOC_BLOCK.
+/* Register a function with frame base type. LOC_CLASS must be LOC_BLOCK.
OPS is the ops vector associated with this index. This returns the
- new index, which should be used as the aclass_index field for symbols
+ new index, which should be used as the loc_class_index field for symbols
of this type. */
int
-register_symbol_block_impl (enum address_class aclass,
+register_symbol_block_impl (location_class loc_class,
const struct symbol_block_ops *ops)
{
- int result = next_aclass_value++;
+ int result = next_loc_class_value++;
- gdb_assert (aclass == LOC_BLOCK);
+ gdb_assert (loc_class == LOC_BLOCK);
gdb_assert (result < MAX_SYMBOL_IMPLS);
- symbol_impl[result].aclass = aclass;
+ symbol_impl[result].loc_class = loc_class;
symbol_impl[result].ops_block = ops;
/* Sanity check OPS. */
return result;
}
-/* Register a register symbol type. ACLASS must be LOC_REGISTER or
+/* Register a register symbol type. LOC_CLASS must be LOC_REGISTER or
LOC_REGPARM_ADDR. OPS is the register ops vector associated with
this index. This returns the new index, which should be used as
- the aclass_index field for symbols of this type. */
+ the loc_class_index field for symbols of this type. */
int
-register_symbol_register_impl (enum address_class aclass,
+register_symbol_register_impl (location_class loc_class,
const struct symbol_register_ops *ops)
{
- int result = next_aclass_value++;
+ int result = next_loc_class_value++;
- gdb_assert (aclass == LOC_REGISTER || aclass == LOC_REGPARM_ADDR);
+ gdb_assert (loc_class == LOC_REGISTER || loc_class == LOC_REGPARM_ADDR);
gdb_assert (result < MAX_SYMBOL_IMPLS);
- symbol_impl[result].aclass = aclass;
+ symbol_impl[result].loc_class = loc_class;
symbol_impl[result].ops_register = ops;
return result;
}
/* Initialize elements of 'symbol_impl' for the constants in enum
- address_class. */
+ location_class. */
static void
initialize_ordinary_address_classes (void)
{
- int i;
-
- for (i = 0; i < LOC_FINAL_VALUE; ++i)
- symbol_impl[i].aclass = (enum address_class) i;
+ for (int i = 0; i < LOC_FINAL_VALUE; ++i)
+ symbol_impl[i].loc_class = static_cast<location_class> (i);
}
\f
symbol::get_maybe_copied_address () const
{
gdb_assert (this->maybe_copied);
- gdb_assert (this->aclass () == LOC_STATIC);
+ gdb_assert (this->loc_class () == LOC_STATIC);
const char *linkage_name = this->linkage_name ();
bound_minimal_symbol minsym
Throws an exception if VAL is not one of the allowable values. */
extern domain_search_flags from_scripting_domain (int val);
-/* An address-class says where to find the value of a symbol. */
+/* A location class says where to find the value of a symbol. */
-enum address_class
+enum location_class
{
/* Not used; catches errors. */
LOC_FINAL_VALUE
};
-/* The number of bits needed for values in enum address_class, with some
+/* The number of bits needed for values in enum location_class, with some
padding for reasonable growth, and room for run-time registered address
classes. See symtab.c:MAX_SYMBOL_IMPLS.
This is a #define so that we can have a assertion elsewhere to
verify that we have reserved enough space for synthetic address
classes. */
-#define SYMBOL_ACLASS_BITS 5
-static_assert (LOC_FINAL_VALUE <= (1 << SYMBOL_ACLASS_BITS));
+#define SYMBOL_LOC_CLASS_BITS 5
+static_assert (LOC_FINAL_VALUE <= (1 << SYMBOL_LOC_CLASS_BITS));
/* The methods needed to implement LOC_COMPUTED. These methods can
use the symbol's .aux_value for additional per-symbol information.
struct symbol_impl
{
- enum address_class aclass;
+ location_class loc_class;
/* Used with LOC_COMPUTED. */
const struct symbol_computed_ops *ops_computed;
symbol ()
/* Class-initialization of bitfields is only allowed in C++20. */
: m_domain (UNDEF_DOMAIN),
- m_aclass_index (0),
+ m_loc_class_index (0),
m_is_objfile_owned (1),
m_is_argument (0),
m_is_inlined (0),
symbol (const symbol &) = default;
symbol &operator= (const symbol &) = default;
- void set_aclass_index (unsigned int aclass_index)
+ void set_loc_class_index (unsigned int loc_class_index)
{
- m_aclass_index = aclass_index;
+ m_loc_class_index = loc_class_index;
}
const symbol_impl &impl () const
{
- return symbol_impls[this->m_aclass_index];
+ return symbol_impls[this->m_loc_class_index];
}
const symbol_block_ops *block_ops () const
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. */
ENUM_BITFIELD(domain_enum) m_domain : SYMBOL_DOMAIN_BITS;
- /* Address class. This holds an index into the 'symbol_impls'
- table. The actual enum address_class value is stored there,
+ /* Location class. This holds an index into the 'symbol_impls'
+ table. The actual location_class value is stored there,
alongside any per-class ops vectors. */
- unsigned int m_aclass_index : SYMBOL_ACLASS_BITS;
+ unsigned int m_loc_class_index : SYMBOL_LOC_CLASS_BITS;
/* If non-zero then symbol is objfile-owned, use owner.symtab.
Otherwise symbol is arch-owned, use owner.arch. */
return m_value.block;
}
-extern int register_symbol_computed_impl (enum address_class,
+extern int register_symbol_computed_impl (location_class,
const struct symbol_computed_ops *);
-extern int register_symbol_block_impl (enum address_class aclass,
+extern int register_symbol_block_impl (location_class loc_class,
const struct symbol_block_ops *ops);
-extern int register_symbol_register_impl (enum address_class,
+extern int register_symbol_register_impl (location_class,
const struct symbol_register_ops *);
/* An instance of this type is used to represent a C++ template
(exp->op.get ()));
sym = vvop->get_symbol ();
- if (sym->aclass () == LOC_CONST)
+ if (sym->loc_class () == LOC_CONST)
{
error (_("constant `%s' (value %s) "
"will not be collected."),
sym->print_name (),
plongest (sym->value_longest ()));
}
- else if (sym->aclass () == LOC_OPTIMIZED_OUT)
+ else if (sym->loc_class () == LOC_OPTIMIZED_OUT)
{
error (_("`%s' is optimized away "
"and cannot be collected."),
int treat_as_expr = 0;
len = check_typedef (sym->type ())->length ();
- switch (sym->aclass ())
+ switch (sym->loc_class ())
{
default:
gdb_printf ("%s: don't know symbol class %d\n",
- sym->print_name (), sym->aclass ());
+ sym->print_name (), sym->loc_class ());
break;
case LOC_CONST:
gdb_printf ("constant %s (value %s) will not be collected.\n",
gdb_stdout);
else
{
- switch (sym->aclass ())
+ switch (sym->loc_class ())
{
default:
case LOC_UNDEF: /* Messed up symbol? */
gdb_printf ("a bogus symbol, class %d.\n",
- sym->aclass ());
+ sym->loc_class ());
count--; /* Don't count this one. */
continue;
case LOC_CONST:
struct decl_field *tf;
/* We only want type-valued template parameters in the hash. */
- if (TYPE_TEMPLATE_ARGUMENT (t, i)->aclass () != LOC_TYPEDEF)
+ if (TYPE_TEMPLATE_ARGUMENT (t, i)->loc_class () != LOC_TYPEDEF)
continue;
tf = XOBNEW (&m_storage, struct decl_field);
if (sym.symbol == NULL)
return NULL;
else if ((noside == EVAL_AVOID_SIDE_EFFECTS)
- && (sym.symbol->aclass () == LOC_TYPEDEF))
+ && (sym.symbol->loc_class () == LOC_TYPEDEF))
result = value::allocate (sym.symbol->type ());
else
result = value_of_variable (sym.symbol, sym.block);
sym->set_type (builtin_type (objfile)->nodebug_text_symbol);
sym->set_domain (FUNCTION_DOMAIN);
- sym->set_aclass_index (LOC_BLOCK);
+ sym->set_loc_class_index (LOC_BLOCK);
sym2 = new (&objfile->objfile_obstack) symbol (*sym);
if (cs->c_sclass == C_EXT || C_WEAKEXT)