ada_lookup_encoded_symbol (name, orig_left_context, VAR_DOMAIN, &sym_info);
if (sym_info.symbol == NULL)
error (_("Could not find renamed variable: %s"), ada_decode (name).c_str ());
- else if (SYMBOL_CLASS (sym_info.symbol) == LOC_TYPEDEF)
+ else if (sym_info.symbol->aclass () == LOC_TYPEDEF)
/* We have a renaming of an old-style renaming symbol. Don't
trust the block information. */
sym_info.block = orig_left_context;
VAR_DOMAIN, &index_sym_info);
if (index_sym_info.symbol == NULL)
error (_("Could not find %s"), index_name);
- else if (SYMBOL_CLASS (index_sym_info.symbol) == LOC_TYPEDEF)
+ else if (index_sym_info.symbol->aclass () == 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, VAR_DOMAIN);
if (context == NULL
- && (syms.empty () || SYMBOL_CLASS (syms[0].symbol) != LOC_BLOCK))
+ && (syms.empty () || syms[0].symbol->aclass () != LOC_BLOCK))
symtab = lookup_symtab (name);
else
symtab = NULL;
if (symtab != NULL)
result = BLOCKVECTOR_BLOCK (symtab->blockvector (), STATIC_BLOCK);
- else if (syms.empty () || SYMBOL_CLASS (syms[0].symbol) != LOC_BLOCK)
+ else if (syms.empty () || syms[0].symbol->aclass () != 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 (SYMBOL_CLASS (syms[i].symbol))
+ switch (syms[i].symbol->aclass ())
{
case LOC_TYPEDEF:
if (ada_prefer_type (SYMBOL_TYPE (syms[i].symbol), preferred_type))
strcpy (expanded_name, "standard__");
strcat (expanded_name, name);
sym = ada_lookup_symbol (expanded_name, NULL, VAR_DOMAIN).symbol;
- if (sym != NULL && SYMBOL_CLASS (sym) == LOC_TYPEDEF)
+ if (sym != NULL && sym->aclass () == LOC_TYPEDEF)
type = SYMBOL_TYPE (sym);
}
par_state->expression_context_block,
VAR_DOMAIN);
- if (syms.size () != 1 || SYMBOL_CLASS (syms[0].symbol) == LOC_TYPEDEF)
+ if (syms.size () != 1 || syms[0].symbol->aclass () == 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 (SYMBOL_CLASS (syms[i].symbol) == LOC_BLOCK)
+ if (syms[i].symbol->aclass () == LOC_BLOCK)
{
struct symtab_and_line sal =
find_function_start_sal (syms[i].symbol, 1);
else
{
int is_enumeral =
- (SYMBOL_CLASS (syms[i].symbol) == LOC_CONST
+ (syms[i].symbol->aclass () == LOC_CONST
&& SYMBOL_TYPE (syms[i].symbol) != NULL
&& SYMBOL_TYPE (syms[i].symbol)->code () == TYPE_CODE_ENUM);
struct symtab *symtab = NULL;
candidates.end (),
[] (block_symbol &bsym)
{
- switch (SYMBOL_CLASS (bsym.symbol))
+ switch (bsym.symbol->aclass ())
{
case LOC_REGISTER:
case LOC_ARG:
candidates.end (),
[] (block_symbol &bsym)
{
- return SYMBOL_CLASS (bsym.symbol) == LOC_TYPEDEF;
+ return bsym.symbol->aclass () == LOC_TYPEDEF;
}),
candidates.end ());
}
int i;
struct type *func_type = SYMBOL_TYPE (func);
- if (SYMBOL_CLASS (func) == LOC_CONST
+ if (func->aclass () == 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 (SYMBOL_CLASS (sym))
+ switch (sym->aclass ())
{
default:
return ADA_NOT_RENAMING;
for (const block_symbol &sym : syms)
if (SYMBOL_TYPE (sym.symbol)->code () != TYPE_CODE_FUNC
&& (SYMBOL_TYPE (sym.symbol)->code () != TYPE_CODE_ENUM
- || SYMBOL_CLASS (sym.symbol) != LOC_CONST))
+ || sym.symbol->aclass () != LOC_CONST))
return 1;
return 0;
if (sym0 == sym1)
return 1;
if (SYMBOL_DOMAIN (sym0) != SYMBOL_DOMAIN (sym1)
- || SYMBOL_CLASS (sym0) != SYMBOL_CLASS (sym1))
+ || sym0->aclass () != sym1->aclass ())
return 0;
- switch (SYMBOL_CLASS (sym0))
+ switch (sym0->aclass ())
{
case LOC_UNDEF:
return 1;
should be identical. */
else if ((*syms)[i].symbol->linkage_name () != NULL
- && SYMBOL_CLASS ((*syms)[i].symbol) == LOC_STATIC
+ && (*syms)[i].symbol->aclass () == LOC_STATIC
&& is_nondebugging_type (SYMBOL_TYPE ((*syms)[i].symbol)))
{
for (j = 0; j < syms->size (); j += 1)
&& (*syms)[j].symbol->linkage_name () != NULL
&& strcmp ((*syms)[i].symbol->linkage_name (),
(*syms)[j].symbol->linkage_name ()) == 0
- && SYMBOL_CLASS ((*syms)[i].symbol)
- == SYMBOL_CLASS ((*syms)[j].symbol)
+ && ((*syms)[i].symbol->aclass ()
+ == (*syms)[j].symbol->aclass ())
&& SYMBOL_VALUE_ADDRESS ((*syms)[i].symbol)
== SYMBOL_VALUE_ADDRESS ((*syms)[j].symbol))
remove_p = 1;
static int
old_renaming_is_invisible (const struct symbol *sym, const char *function_name)
{
- if (SYMBOL_CLASS (sym) != LOC_TYPEDEF)
+ if (sym->aclass () != LOC_TYPEDEF)
return 0;
std::string scope = xget_renaming_scope (SYMBOL_TYPE (sym));
const char *name;
const char *suffix;
- if (sym == NULL || SYMBOL_CLASS (sym) == LOC_TYPEDEF)
+ if (sym == NULL || sym->aclass () == LOC_TYPEDEF)
continue;
name = sym->linkage_name ();
suffix = strstr (name, "___XR");
}
else
{
- if (SYMBOL_CLASS (sym) == LOC_UNRESOLVED)
+ if (sym->aclass () == LOC_UNRESOLVED)
return true;
else if (SYMBOL_IS_ARGUMENT (sym))
arg_sym = sym;
{
if (symbol_matches_domain (sym->language (), SYMBOL_DOMAIN (sym), domain))
{
- if (SYMBOL_CLASS (sym) != LOC_UNRESOLVED)
+ if (sym->aclass () != LOC_UNRESOLVED)
{
if (SYMBOL_IS_ARGUMENT (sym))
arg_sym = sym;
if (cmp == 0
&& is_name_suffix (sym->linkage_name () + name_len + 5))
{
- if (SYMBOL_CLASS (sym) != LOC_UNRESOLVED)
+ if (sym->aclass () != LOC_UNRESOLVED)
{
if (SYMBOL_IS_ARGUMENT (sym))
arg_sym = sym;
struct symbol *sym;
sym = standard_lookup (name, get_selected_block (NULL), VAR_DOMAIN);
- if (sym != NULL && SYMBOL_CLASS (sym) == LOC_TYPEDEF)
+ if (sym != NULL && sym->aclass () == LOC_TYPEDEF)
return sym;
sym = standard_lookup (name, NULL, STRUCT_DOMAIN);
/* Make sure that the symbol we found corresponds to a function. */
- if (SYMBOL_CLASS (sym) != LOC_BLOCK)
+ if (sym->aclass () != LOC_BLOCK)
{
error (_("Symbol \"%s\" is not a function (class = %d)"),
- sym->linkage_name (), SYMBOL_CLASS (sym));
+ sym->linkage_name (), sym->aclass ());
return 0;
}
/* Make sure that the symbol we found corresponds to a function. */
- if (SYMBOL_CLASS (sym) != LOC_BLOCK)
+ if (sym->aclass () != LOC_BLOCK)
{
error (_("Symbol \"%s\" is not a function (class = %d)"),
- sym->linkage_name (), SYMBOL_CLASS (sym));
+ sym->linkage_name (), sym->aclass ());
return 0;
}
if (sym == NULL)
error (_("Catchpoint symbol not found: %s"), sym_name);
- if (SYMBOL_CLASS (sym) != LOC_BLOCK)
+ if (sym->aclass () != LOC_BLOCK)
error (_("Unable to insert catchpoint. %s is not a function."), sym_name);
/* Set ADDR_STRING. */
{
const char *type_name = SYMBOL_TYPE (sym)->name ();
- return (SYMBOL_CLASS (sym) != LOC_TYPEDEF
- && SYMBOL_CLASS (sym) != LOC_BLOCK
- && SYMBOL_CLASS (sym) != LOC_CONST
- && SYMBOL_CLASS (sym) != LOC_UNRESOLVED
+ return (sym->aclass () != LOC_TYPEDEF
+ && sym->aclass () != LOC_BLOCK
+ && sym->aclass () != LOC_CONST
+ && sym->aclass () != LOC_UNRESOLVED
&& type_name != NULL && strcmp (type_name, "exception") == 0);
}
ALL_BLOCK_SYMBOLS (block, iter, sym)
{
- switch (SYMBOL_CLASS (sym))
+ switch (sym->aclass ())
{
case LOC_TYPEDEF:
case LOC_BLOCK:
}
/* I'm imitating the code in read_var_value. */
- switch (SYMBOL_CLASS (var))
+ switch (var->aclass ())
{
case LOC_CONST: /* A constant, like an enum value. */
ax_const_l (ax, (LONGEST) SYMBOL_VALUE (var));
best_symbol (struct symbol *a, const domain_enum domain)
{
return (SYMBOL_DOMAIN (a) == domain
- && SYMBOL_CLASS (a) != LOC_UNRESOLVED);
+ && a->aclass () != LOC_UNRESOLVED);
}
/* See block.h. */
&& SYMBOL_DOMAIN (a) != domain)
return b;
- if (SYMBOL_CLASS (a) != LOC_UNRESOLVED
- && SYMBOL_CLASS (b) == LOC_UNRESOLVED)
+ if (a->aclass () != LOC_UNRESOLVED && b->aclass () == LOC_UNRESOLVED)
return a;
- if (SYMBOL_CLASS (b) != LOC_UNRESOLVED
- && SYMBOL_CLASS (a) == LOC_UNRESOLVED)
+
+ if (b->aclass () != LOC_UNRESOLVED && a->aclass () == LOC_UNRESOLVED)
return b;
return a;
= lookup_symbol (copy.c_str (), $1,
VAR_DOMAIN, NULL).symbol;
- if (!tem || SYMBOL_CLASS (tem) != LOC_BLOCK)
+ if (!tem || tem->aclass () != LOC_BLOCK)
error (_("No function \"%s\" in specified context."),
copy.c_str ());
$$ = SYMBOL_BLOCK_VALUE (tem); }
par_state->language ()->name_of_this ()
? &is_a_field_of_this : NULL);
- if (bsym.symbol && SYMBOL_CLASS (bsym.symbol) == LOC_BLOCK)
+ if (bsym.symbol && bsym.symbol->aclass () == LOC_BLOCK)
{
yylval.ssym.sym = bsym;
yylval.ssym.is_a_field_of_this = is_a_field_of_this.type != NULL;
}
}
- if (bsym.symbol && SYMBOL_CLASS (bsym.symbol) == LOC_TYPEDEF)
+ if (bsym.symbol && bsym.symbol->aclass () == LOC_TYPEDEF)
{
yylval.tsym.type = SYMBOL_TYPE (bsym.symbol);
return TYPENAME;
return ERROR;
}
- switch (SYMBOL_CLASS (yylval.ssym.sym.symbol))
+ switch (yylval.ssym.sym.symbol->aclass ())
{
case LOC_BLOCK:
case LOC_LABEL:
{
struct symbol *sym = TYPE_TEMPLATE_ARGUMENT (type, i);
- if (SYMBOL_CLASS (sym) != LOC_TYPEDEF)
+ if (sym->aclass () != 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 (SYMBOL_CLASS (real_sym) == LOC_TYPEDEF
+ if (real_sym->aclass () == LOC_TYPEDEF
&& SYMBOL_DOMAIN (real_sym) == VAR_DOMAIN
&& SYMBOL_TYPE (real_sym)->code () == TYPE_CODE_PTR
&& TYPE_LENGTH (TYPE_TARGET_TYPE (SYMBOL_TYPE (real_sym))) != 0)
context->error_symbol_once (sym.symbol);
- if (SYMBOL_CLASS (sym.symbol) == LOC_LABEL)
+ if (sym.symbol->aclass () == LOC_LABEL)
sym_type = 0;
else
sym_type = context->convert_type (SYMBOL_TYPE (sym.symbol));
CORE_ADDR addr = 0;
gdb::unique_xmalloc_ptr<char> symbol_name;
- switch (SYMBOL_CLASS (sym.symbol))
+ switch (sym.symbol->aclass ())
{
case LOC_TYPEDEF:
kind = GCC_C_SYMBOL_TYPEDEF;
/* We only need global functions here. */
sym = lookup_symbol (identifier, NULL, VAR_DOMAIN, NULL).symbol;
- if (sym != NULL && SYMBOL_CLASS (sym) == LOC_BLOCK)
+ if (sym != NULL && sym->aclass () == LOC_BLOCK)
{
if (compile_debug)
fprintf_unfiltered (gdb_stdlog,
}
else
{
- switch (SYMBOL_CLASS (sym))
+ switch (sym->aclass ())
{
case LOC_REGISTER:
case LOC_ARG:
instance->error_symbol_once (sym.symbol);
- if (SYMBOL_CLASS (sym.symbol) == LOC_LABEL)
+ if (sym.symbol->aclass () == LOC_LABEL)
sym_type = 0;
else
sym_type = instance->convert_type (SYMBOL_TYPE (sym.symbol));
std::string name;
gdb::unique_xmalloc_ptr<char> symbol_name;
- switch (SYMBOL_CLASS (sym.symbol))
+ switch (sym.symbol->aclass ())
{
case LOC_TYPEDEF:
if (SYMBOL_TYPE (sym.symbol)->code () == TYPE_CODE_TYPEDEF)
struct symbol *sym
= lookup_symbol (identifier, nullptr, VAR_DOMAIN, nullptr).symbol;
- if (sym != nullptr && SYMBOL_CLASS (sym) == LOC_BLOCK)
+ if (sym != nullptr && sym->aclass () == LOC_BLOCK)
{
if (compile_debug)
fprintf_unfiltered (gdb_stdlog,
return NULL;
}
- if (SYMBOL_CLASS (rtti_sym) != LOC_TYPEDEF)
+ if (rtti_sym->aclass () != LOC_TYPEDEF)
{
warning (_("RTTI symbol for class '%s' is not a type"), name);
return NULL;
sym = lookup_symbol (copy.c_str (),
pstate->expression_context_block,
VAR_DOMAIN, &is_a_field_of_this);
- if (sym.symbol && SYMBOL_CLASS (sym.symbol) != LOC_TYPEDEF)
+ if (sym.symbol && sym.symbol->aclass () != 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, VAR_DOMAIN, &is_a_field_of_this);
- if (sym.symbol && SYMBOL_CLASS (sym.symbol) == LOC_TYPEDEF)
+ if (sym.symbol && sym.symbol->aclass () == LOC_TYPEDEF)
{
yylval.tsym.type = SYMBOL_TYPE (sym.symbol);
return TYPENAME;
if (yylval.ssym.sym.symbol == NULL)
return ERROR;
- if (SYMBOL_CLASS (yylval.ssym.sym.symbol) == LOC_TYPEDEF)
+ if (yylval.ssym.sym.symbol->aclass () == LOC_TYPEDEF)
{
yylval.tsym.type = SYMBOL_TYPE (yylval.ssym.sym.symbol);
return TYPENAME;
struct symbol *sym = list->symbol[i];
if (sym->language () == language_go
- && SYMBOL_CLASS (sym) == LOC_BLOCK)
+ && sym->aclass () == LOC_BLOCK)
{
gdb::unique_xmalloc_ptr<char> this_package_name
(go_symbol_package_name (sym));
&& die->parent->tag == DW_TAG_common_block)
attr2 = NULL;
- if (SYMBOL_CLASS (sym) == LOC_STATIC
+ if (sym->aclass () == LOC_STATIC
&& SYMBOL_VALUE_ADDRESS (sym) == 0
&& !per_objfile->per_bfd->has_section_at_zero)
{
}
else if (attr2 != nullptr && attr2->as_boolean ())
{
- if (SYMBOL_CLASS (sym) == LOC_STATIC
+ if (sym->aclass () == LOC_STATIC
&& (objfile->flags & OBJF_MAINLINE) == 0
&& per_objfile->per_bfd->can_copy)
{
else if (!die_is_declaration (die, cu))
{
/* Use the default LOC_OPTIMIZED_OUT class. */
- gdb_assert (SYMBOL_CLASS (sym) == LOC_OPTIMIZED_OUT);
+ gdb_assert (sym->aclass () == LOC_OPTIMIZED_OUT);
if (!suppress_add)
list_to_add = cu->list_in_scope;
}
if (noside == EVAL_AVOID_SIDE_EFFECTS)
{
struct type *type = lookup_pointer_type (SYMBOL_TYPE (var));
- enum address_class sym_class = SYMBOL_CLASS (var);
+ enum address_class sym_class = var->aclass ();
if (sym_class == LOC_CONST
|| sym_class == LOC_CONST_BYTES
static inline bool
check_constant (struct symbol *sym)
{
- enum address_class sc = SYMBOL_CLASS (sym);
+ enum address_class sc = sym->aclass ();
return (sc == LOC_BLOCK
|| sc == LOC_CONST
|| sc == LOC_CONST_BYTES
{
result = lookup_symbol (tmp.c_str (), pstate->expression_context_block,
domain, NULL);
- if (result.symbol && SYMBOL_CLASS (result.symbol) == LOC_TYPEDEF)
+ if (result.symbol && result.symbol->aclass () == LOC_TYPEDEF)
{
yylval.tsym.type = SYMBOL_TYPE (result.symbol);
return TYPENAME;
const struct common_block *common = SYMBOL_VALUE_COMMON_BLOCK (sym);
size_t index;
- gdb_assert (SYMBOL_CLASS (sym) == LOC_COMMON_BLOCK);
+ gdb_assert (sym->aclass () == LOC_COMMON_BLOCK);
if (comname && (!sym->linkage_name ()
|| strcmp (comname, sym->linkage_name ()) != 0))
if (SYMBOL_COMPUTED_OPS (sym) != NULL)
return SYMBOL_COMPUTED_OPS (sym)->get_symbol_read_needs (sym);
- switch (SYMBOL_CLASS (sym))
+ switch (sym->aclass ())
{
/* All cases listed explicitly so that gcc -Wall will detect it if
we failed to consider one. */
if (SYMBOL_COMPUTED_OPS (var) != NULL)
return SYMBOL_COMPUTED_OPS (var)->read_variable (var, frame);
- switch (SYMBOL_CLASS (var))
+ switch (var->aclass ())
{
case LOC_CONST:
if (is_dynamic_type (type))
->register_number (var, get_frame_arch (frame));
struct value *regval;
- if (SYMBOL_CLASS (var) == LOC_REGPARM_ADDR)
+ if (var->aclass () == LOC_REGPARM_ADDR)
{
regval = value_from_register (lookup_pointer_type (type),
regno,
sym = lookup_symbol_in_language (name, block, VAR_DOMAIN,
language->la_language, NULL).symbol;
- if (sym != NULL && SYMBOL_CLASS (sym) == LOC_TYPEDEF)
+ if (sym != NULL && sym->aclass () == LOC_TYPEDEF)
return SYMBOL_TYPE (sym);
if (noerr)
sym = lookup_symbol (name, block, STRUCT_DOMAIN, &is_a_field_of_this).symbol;
if (sym
- && SYMBOL_CLASS (sym) == LOC_TYPEDEF
+ && sym->aclass () == LOC_TYPEDEF
&& SYMBOL_TYPE (sym)->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_CLASS (symbol));
+ return scm_from_int (symbol->aclass ());
}
/* (symbol-argument? <gdb:symbol>) -> boolean */
const struct symbol *symbol = s_smob->symbol;
enum address_class theclass;
- theclass = SYMBOL_CLASS (symbol);
+ theclass = symbol->aclass ();
return scm_from_bool (theclass == LOC_CONST || theclass == LOC_CONST_BYTES);
}
const struct symbol *symbol = s_smob->symbol;
enum address_class theclass;
- theclass = SYMBOL_CLASS (symbol);
+ theclass = symbol->aclass ();
return scm_from_bool (theclass == LOC_BLOCK);
}
const struct symbol *symbol = s_smob->symbol;
enum address_class theclass;
- theclass = SYMBOL_CLASS (symbol);
+ theclass = symbol->aclass ();
return scm_from_bool (!SYMBOL_IS_ARGUMENT (symbol)
&& (theclass == LOC_LOCAL || theclass == LOC_REGISTER
if (!gdbscm_is_false (frame_scm))
f_smob = frscm_get_frame_smob_arg_unsafe (frame_scm, frame_pos, FUNC_NAME);
- if (SYMBOL_CLASS (symbol) == LOC_TYPEDEF)
+ if (symbol->aclass () == 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)
{
symbol *sym = inline_skipped_symbol (tp);
- if (SYMBOL_CLASS (sym) == LOC_BLOCK)
+ if (sym->aclass () == LOC_BLOCK)
{
const block *block = SYMBOL_BLOCK_VALUE (sym);
if (BLOCK_END (block) < tp->control.step_range_end)
{
/* In list mode, add all matching symbols, regardless of class.
This allows the user to type "list a_global_variable". */
- if (SYMBOL_CLASS (bsym->symbol) == LOC_BLOCK || this->state->list_mode)
+ if (bsym->symbol->aclass () == LOC_BLOCK || this->state->list_mode)
this->result.symbols->push_back (*bsym);
/* Continue iterating. */
if (state->funfirstline
&& !ls->minimal_symbols.empty ()
- && SYMBOL_CLASS (sym.symbol) == LOC_BLOCK)
+ && sym.symbol->aclass () == LOC_BLOCK)
{
const CORE_ADDR addr
= BLOCK_ENTRY_PC (SYMBOL_BLOCK_VALUE (sym.symbol));
struct type *t;
struct symbol *sym = bsym->symbol;
- if (SYMBOL_CLASS (sym) != LOC_TYPEDEF)
+ if (sym->aclass () != LOC_TYPEDEF)
return true; /* Continue iterating. */
t = SYMBOL_TYPE (sym);
symbol_to_sal (struct symtab_and_line *result,
int funfirstline, struct symbol *sym)
{
- if (SYMBOL_CLASS (sym) == LOC_BLOCK)
+ if (sym->aclass () == LOC_BLOCK)
{
*result = find_function_start_sal (sym, funfirstline);
return 1;
}
else
{
- if (SYMBOL_CLASS (sym) == LOC_LABEL && SYMBOL_VALUE_ADDRESS (sym) != 0)
+ if (sym->aclass () == LOC_LABEL && SYMBOL_VALUE_ADDRESS (sym) != 0)
{
*result = {};
result->symtab = symbol_symtab (sym);
{ struct symbol *tem
= lookup_symbol (copy_name ($3).c_str (), $1,
VAR_DOMAIN, 0).symbol;
- if (!tem || SYMBOL_CLASS (tem) != LOC_BLOCK)
+ if (!tem || tem->aclass () != LOC_BLOCK)
error (_("No function \"%s\" in specified context."),
copy_name ($3).c_str ());
$$ = tem;
return BLOCKNAME;
sym = lookup_symbol (tmp.c_str (), pstate->expression_context_block,
VAR_DOMAIN, 0).symbol;
- if (sym && SYMBOL_CLASS (sym) == LOC_BLOCK)
+ if (sym && sym->aclass () == LOC_BLOCK)
return BLOCKNAME;
if (lookup_typename (pstate->language (),
tmp.c_str (), pstate->expression_context_block, 1))
if(sym)
{
- switch(SYMBOL_CLASS (sym))
+ switch(sym->aclass ())
{
case LOC_STATIC:
case LOC_REGISTER:
{
if (sym->linkage_name ()[0] == inc
&& SYMBOL_DOMAIN (sym) == domain
- && SYMBOL_CLASS (sym) == theclass
+ && sym->aclass () == theclass
&& strcmp (sym->linkage_name (), name) == 0)
return sym;
}
{
int print_me = 0;
- switch (SYMBOL_CLASS (sym))
+ switch (sym->aclass ())
{
default:
case LOC_UNDEF: /* catches errors */
static void
mips_make_symbol_special (struct symbol *sym, struct objfile *objfile)
{
- if (SYMBOL_CLASS (sym) == LOC_BLOCK)
+ if (sym->aclass () == LOC_BLOCK)
{
/* We are in symbol reading so it is OK to cast away constness. */
struct block *block = (struct block *) SYMBOL_BLOCK_VALUE (sym);
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 ((SYMBOL_CLASS (sym) == LOC_LABEL
- || SYMBOL_CLASS (sym) == LOC_STATIC)
+ if ((sym->aclass () == LOC_LABEL
+ || sym->aclass () == LOC_STATIC)
&& sym->section_index () >= 0)
{
SET_SYMBOL_VALUE_ADDRESS (sym,
= lookup_symbol (copy.c_str (), $1,
VAR_DOMAIN, NULL).symbol;
- if (!tem || SYMBOL_CLASS (tem) != LOC_BLOCK)
+ if (!tem || tem->aclass () != LOC_BLOCK)
error (_("No function \"%s\" in specified context."),
copy.c_str ());
$$ = SYMBOL_BLOCK_VALUE (tem); }
/* 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 && SYMBOL_CLASS (sym) == LOC_BLOCK)
+ if ((sym && sym->aclass () == LOC_BLOCK)
|| lookup_symtab (tmp.c_str ()))
{
yylval.ssym.sym.symbol = sym;
free (uptokstart);
return BLOCKNAME;
}
- if (sym && SYMBOL_CLASS (sym) == LOC_TYPEDEF)
+ if (sym && sym->aclass () == LOC_TYPEDEF)
{
#if 1
/* Despite the following flaw, we need to keep this code enabled.
VAR_DOMAIN, NULL).symbol;
if (cur_sym)
{
- if (SYMBOL_CLASS (cur_sym) == LOC_TYPEDEF)
+ if (cur_sym->aclass () == LOC_TYPEDEF)
{
best_sym = cur_sym;
pstate->lexptr = p;
return;
}
- switch (SYMBOL_CLASS (sym))
+ switch (sym->aclass ())
{
case LOC_CONST:
case LOC_CONST_BYTES:
{
int print_me = 0;
- switch (SYMBOL_CLASS (sym))
+ switch (sym->aclass ())
{
default:
case LOC_UNDEF: /* catches errors */
SYMPY_REQUIRE_VALID (self, symbol);
- return gdb_py_object_from_longest (SYMBOL_CLASS (symbol)).release ();
+ return gdb_py_object_from_longest (symbol->aclass ()).release ();
}
static PyObject *
SYMPY_REQUIRE_VALID (self, symbol);
- theclass = SYMBOL_CLASS (symbol);
+ theclass = symbol->aclass ();
return PyBool_FromLong (theclass == LOC_CONST || theclass == LOC_CONST_BYTES);
}
SYMPY_REQUIRE_VALID (self, symbol);
- theclass = SYMBOL_CLASS (symbol);
+ theclass = symbol->aclass ();
return PyBool_FromLong (theclass == LOC_BLOCK);
}
SYMPY_REQUIRE_VALID (self, symbol);
- theclass = SYMBOL_CLASS (symbol);
+ theclass = symbol->aclass ();
return PyBool_FromLong (!SYMBOL_IS_ARGUMENT (symbol)
&& (theclass == LOC_LOCAL || theclass == LOC_REGISTER
}
SYMPY_REQUIRE_VALID (self, symbol);
- if (SYMBOL_CLASS (symbol) == LOC_TYPEDEF)
+ if (symbol->aclass () == LOC_TYPEDEF)
{
PyErr_SetString (PyExc_TypeError, "cannot get the value of a typedef");
return NULL;
}
sym = TYPE_TEMPLATE_ARGUMENT (type, argno);
- if (SYMBOL_CLASS (sym) == LOC_TYPEDEF)
+ if (sym->aclass () == LOC_TYPEDEF)
return type_to_type_object (SYMBOL_TYPE (sym));
- else if (SYMBOL_CLASS (sym) == LOC_OPTIMIZED_OUT)
+ else if (sym->aclass () == 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,
VAR_DOMAIN);
- if (sym.symbol != nullptr && SYMBOL_CLASS (sym.symbol) != LOC_TYPEDEF)
+ if (sym.symbol != nullptr && sym.symbol->aclass () != LOC_TYPEDEF)
return make_operation<var_value_operation> (sym);
struct type *type = nullptr;
if (sym.symbol != nullptr)
{
- gdb_assert (SYMBOL_CLASS (sym.symbol) == LOC_TYPEDEF);
+ gdb_assert (sym.symbol->aclass () == LOC_TYPEDEF);
type = SYMBOL_TYPE (sym.symbol);
}
if (type == nullptr)
/* Make the default place to list be the function `main'
if one exists. */
block_symbol bsym = lookup_symbol (main_name (), 0, VAR_DOMAIN, 0);
- if (bsym.symbol != nullptr && SYMBOL_CLASS (bsym.symbol) == LOC_BLOCK)
+ if (bsym.symbol != nullptr && bsym.symbol->aclass () == LOC_BLOCK)
{
symtab_and_line sal = find_function_start_sal (bsym.symbol, true);
if (sal.symtab == NULL)
struct symbol *prev_sym;
prev_sym = local_symbols->symbol[local_symbols->nsyms - 1];
- if ((SYMBOL_CLASS (prev_sym) == LOC_REF_ARG
- || SYMBOL_CLASS (prev_sym) == LOC_ARG)
+ if ((prev_sym->aclass () == LOC_REF_ARG
+ || prev_sym->aclass () == LOC_ARG)
&& strcmp (prev_sym->linkage_name (),
sym->linkage_name ()) == 0)
{
{
/* We have to convert LOC_REGISTER to LOC_REGPARM_ADDR (for
variables passed in a register). */
- if (SYMBOL_CLASS (sym) == LOC_REGISTER)
+ if (sym->aclass () == LOC_REGISTER)
sym->set_aclass_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 (SYMBOL_CLASS (sym) == LOC_ARG)
+ else if (sym->aclass () == LOC_ARG)
sym->set_aclass_index (LOC_REF_ARG);
}
{
struct symbol *sym = ppt->symbol[i];
- if (SYMBOL_CLASS (sym) == LOC_TYPEDEF
+ if (sym->aclass () == LOC_TYPEDEF
&& SYMBOL_DOMAIN (sym) == STRUCT_DOMAIN
&& (SYMBOL_TYPE (sym)->code () == code)
&& strcmp (sym->linkage_name (), type_name) == 0)
{
struct symbol *sym = ppt->symbol[i];
- if (SYMBOL_CLASS (sym) == LOC_TYPEDEF
+ if (sym->aclass () == LOC_TYPEDEF
&& SYMBOL_DOMAIN (sym) == STRUCT_DOMAIN
&& (SYMBOL_TYPE (sym)->code () == (*type)->code ())
&& ((*type)->instance_flags ()
the same symbol if there are multiple references. */
if (sym)
{
- if (SYMBOL_CLASS (sym) == LOC_BLOCK)
+ if (sym->aclass () == LOC_BLOCK)
{
fix_common_block (sym,
MSYMBOL_VALUE_ADDRESS (resolve_objfile,
SET_SYMBOL_VALUE_ADDRESS (prev, 0);
/* Complain about unresolved common block symbols. */
- if (SYMBOL_CLASS (prev) == LOC_STATIC)
+ if (prev->aclass () == LOC_STATIC)
prev->set_aclass_index (LOC_UNRESOLVED);
else
complaint (_("%s: common block `%s' from "
break;
}
- switch (SYMBOL_CLASS (sym))
+ switch (sym->aclass ())
{
case LOC_ARG:
case LOC_REF_ARG:
nsym = lookup_symbol_search_name (sym->search_name (),
b, VAR_DOMAIN).symbol;
gdb_assert (nsym != NULL);
- if (SYMBOL_CLASS (nsym) == LOC_REGISTER
+ if (nsym->aclass () == LOC_REGISTER
&& !SYMBOL_IS_ARGUMENT (nsym))
{
/* There is a LOC_ARG/LOC_REGISTER pair. This means
ALL_BLOCK_SYMBOLS (b, iter, sym)
{
- switch (SYMBOL_CLASS (sym))
+ switch (sym->aclass ())
{
case LOC_CONST:
case LOC_LOCAL:
}
else
{
- if (SYMBOL_CLASS (symbol) == LOC_TYPEDEF)
+ if (symbol->aclass () == LOC_TYPEDEF)
fprintf_filtered (outfile, "typedef ");
if (SYMBOL_TYPE (symbol))
{
else
fprintf_filtered (outfile, "%s ", symbol->print_name ());
- switch (SYMBOL_CLASS (symbol))
+ switch (symbol->aclass ())
{
case LOC_CONST:
fprintf_filtered (outfile, "const %s (%s)",
default:
fprintf_filtered (outfile, "botched symbol class %x",
- SYMBOL_CLASS (symbol));
+ symbol->aclass ());
break;
}
}
/* We should have an objfile by now. */
gdb_assert (objfile);
- switch (SYMBOL_CLASS (sym))
+ switch (sym->aclass ())
{
case LOC_STATIC:
case LOC_LABEL:
ALL_BLOCK_SYMBOLS (b, iter, sym)
{
- if (SYMBOL_CLASS (sym) == LOC_STATIC
+ if (sym->aclass () == LOC_STATIC
&& SYMBOL_VALUE_ADDRESS (sym) == addr)
return sym;
}
symbol *sym = find_pc_function (func_addr);
if (sym != NULL
- && SYMBOL_CLASS (sym) == LOC_BLOCK
+ && sym->aclass () == LOC_BLOCK
&& BLOCK_ENTRY_PC (SYMBOL_BLOCK_VALUE (sym)) == func_addr)
return sym;
|| preg->exec (sym->natural_name (), 0,
NULL, 0) == 0)
&& ((kind == VARIABLES_DOMAIN
- && SYMBOL_CLASS (sym) != LOC_TYPEDEF
- && SYMBOL_CLASS (sym) != LOC_UNRESOLVED
- && SYMBOL_CLASS (sym) != LOC_BLOCK
+ && sym->aclass () != LOC_TYPEDEF
+ && sym->aclass () != LOC_UNRESOLVED
+ && sym->aclass () != LOC_BLOCK
/* LOC_CONST can be used for more than
just enums, e.g., c++ static const
members. We only want to skip enums
here. */
- && !(SYMBOL_CLASS (sym) == LOC_CONST
+ && !(sym->aclass () == LOC_CONST
&& (SYMBOL_TYPE (sym)->code ()
== TYPE_CODE_ENUM))
&& (!treg.has_value ()
|| treg_matches_sym_type_name (*treg, sym)))
|| (kind == FUNCTIONS_DOMAIN
- && SYMBOL_CLASS (sym) == LOC_BLOCK
+ && sym->aclass () == LOC_BLOCK
&& (!treg.has_value ()
|| treg_matches_sym_type_name (*treg,
sym)))
|| (kind == TYPES_DOMAIN
- && SYMBOL_CLASS (sym) == LOC_TYPEDEF
+ && sym->aclass () == LOC_TYPEDEF
&& SYMBOL_DOMAIN (sym) != MODULE_DOMAIN)
|| (kind == MODULES_DOMAIN
&& SYMBOL_DOMAIN (sym) == MODULE_DOMAIN
string_file tmp_stream;
type_print (SYMBOL_TYPE (sym),
- (SYMBOL_CLASS (sym) == LOC_TYPEDEF
+ (sym->aclass () == LOC_TYPEDEF
? "" : sym->print_name ()),
&tmp_stream, 0);
tracker. */
if (sym->language () == language_cplus
&& SYMBOL_DOMAIN (sym) == VAR_DOMAIN
- && SYMBOL_CLASS (sym) == LOC_BLOCK)
+ && sym->aclass () == 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 (SYMBOL_CLASS (sym) == LOC_TYPEDEF)
+ if (sym->aclass () == LOC_TYPEDEF)
{
struct type *t = SYMBOL_TYPE (sym);
enum type_code c = t->code ();
bound_minimal_symbol
find_gnu_ifunc (const symbol *sym)
{
- if (SYMBOL_CLASS (sym) != LOC_BLOCK)
+ if (sym->aclass () != LOC_BLOCK)
return {};
lookup_name_info lookup_name (sym->search_name (),
get_symbol_address (const struct symbol *sym)
{
gdb_assert (sym->maybe_copied);
- gdb_assert (SYMBOL_CLASS (sym) == LOC_STATIC);
+ gdb_assert (sym->aclass () == LOC_STATIC);
const char *linkage_name = sym->linkage_name ();
return symbol_impls[this->aclass_index ()];
}
+ address_class aclass () const
+ {
+ return this->impl ().aclass;
+ }
+
/* Data type of value */
struct type *type = nullptr;
"private". */
#define SYMBOL_DOMAIN(symbol) (symbol)->domain
-#define SYMBOL_CLASS(symbol) ((symbol)->impl ().aclass)
#define SYMBOL_OBJFILE_OWNED(symbol) ((symbol)->is_objfile_owned)
#define SYMBOL_IS_ARGUMENT(symbol) (symbol)->is_argument
#define SYMBOL_INLINED(symbol) (symbol)->is_inlined
(exp->op.get ()));
sym = vvop->get_symbol ();
- if (SYMBOL_CLASS (sym) == LOC_CONST)
+ if (sym->aclass () == LOC_CONST)
{
error (_("constant `%s' (value %s) "
"will not be collected."),
sym->print_name (),
plongest (SYMBOL_VALUE (sym)));
}
- else if (SYMBOL_CLASS (sym) == LOC_OPTIMIZED_OUT)
+ else if (sym->aclass () == LOC_OPTIMIZED_OUT)
{
error (_("`%s' is optimized away "
"and cannot be collected."),
int treat_as_expr = 0;
len = TYPE_LENGTH (check_typedef (SYMBOL_TYPE (sym)));
- switch (SYMBOL_CLASS (sym))
+ switch (sym->aclass ())
{
default:
printf_filtered ("%s: don't know symbol class %d\n",
- sym->print_name (), SYMBOL_CLASS (sym));
+ sym->print_name (), sym->aclass ());
break;
case LOC_CONST:
printf_filtered ("constant %s (value %s) will not be collected.\n",
gdb_stdout);
else
{
- switch (SYMBOL_CLASS (sym))
+ switch (sym->aclass ())
{
default:
case LOC_UNDEF: /* Messed up symbol? */
printf_filtered ("a bogus symbol, class %d.\n",
- SYMBOL_CLASS (sym));
+ sym->aclass ());
count--; /* Don't count this one. */
continue;
case LOC_CONST:
void **slot;
/* We only want type-valued template parameters in the hash. */
- if (SYMBOL_CLASS (TYPE_TEMPLATE_ARGUMENT (t, i)) != LOC_TYPEDEF)
+ if (TYPE_TEMPLATE_ARGUMENT (t, i)->aclass () != LOC_TYPEDEF)
continue;
tf = XOBNEW (&m_storage, struct decl_field);
sym = lookup_symbol (name, 0, VAR_DOMAIN, 0);
if (sym.symbol != NULL)
{
- if (SYMBOL_CLASS (sym.symbol) != LOC_BLOCK)
+ if (sym.symbol->aclass () != LOC_BLOCK)
{
error (_("\"%s\" exists in this program but is not a function."),
name);
if (sym.symbol == NULL)
return NULL;
else if ((noside == EVAL_AVOID_SIDE_EFFECTS)
- && (SYMBOL_CLASS (sym.symbol) == LOC_TYPEDEF))
+ && (sym.symbol->aclass () == LOC_TYPEDEF))
result = allocate_value (SYMBOL_TYPE (sym.symbol));
else
result = value_of_variable (sym.symbol, sym.block);