int array_arity = 0;
struct type *callee_t = nullptr;
if (vvo == nullptr
- || SYMBOL_DOMAIN (vvo->get_symbol ()) != UNDEF_DOMAIN)
+ || vvo->get_symbol ()->domain () != UNDEF_DOMAIN)
{
struct value *callee_v = callee->evaluate (nullptr,
pstate->expout.get (),
{
struct symbol *sym = new (&temp_parse_space) symbol ();
- SYMBOL_DOMAIN (sym) = UNDEF_DOMAIN;
+ sym->set_domain (UNDEF_DOMAIN);
sym->set_linkage_name (obstack_strndup (&temp_parse_space, name, len));
sym->set_language (language_ada, nullptr);
{
if (sym0 == sym1)
return 1;
- if (SYMBOL_DOMAIN (sym0) != SYMBOL_DOMAIN (sym1)
+ if (sym0->domain () != sym1->domain ()
|| sym0->aclass () != sym1->aclass ())
return 0;
sym != NULL;
sym = block_iter_match_next (lookup_name, &iter))
{
- if (symbol_matches_domain (sym->language (), SYMBOL_DOMAIN (sym), domain))
+ if (symbol_matches_domain (sym->language (), sym->domain (), domain))
{
if (sym->aclass () != LOC_UNRESOLVED)
{
ALL_BLOCK_SYMBOLS (block, iter, sym)
{
if (symbol_matches_domain (sym->language (),
- SYMBOL_DOMAIN (sym), domain))
+ sym->domain (), domain))
{
int cmp;
{
symbol *sym = std::get<0> (m_storage).symbol;
- if (SYMBOL_DOMAIN (sym) == UNDEF_DOMAIN)
+ if (sym->domain () == UNDEF_DOMAIN)
/* Only encountered when an unresolved symbol occurs in a
context other than a function call, in which case, it is
invalid. */
struct type *context_type)
{
symbol *sym = std::get<0> (m_storage).symbol;
- if (SYMBOL_DOMAIN (sym) == UNDEF_DOMAIN)
+ if (sym->domain () == UNDEF_DOMAIN)
{
block_symbol resolved
= ada_resolve_variable (sym, std::get<0> (m_storage).block,
ada_var_value_operation *avv
= dynamic_cast<ada_var_value_operation *> (callee_op.get ());
if (avv != nullptr
- && SYMBOL_DOMAIN (avv->get_symbol ()) == UNDEF_DOMAIN)
+ && avv->get_symbol ()->domain () == UNDEF_DOMAIN)
error (_("Unexpected unresolved symbol, %s, during evaluation"),
avv->get_symbol ()->print_name ());
return false;
symbol *sym = avv->get_symbol ();
- if (SYMBOL_DOMAIN (sym) != UNDEF_DOMAIN)
+ if (sym->domain () != UNDEF_DOMAIN)
return false;
const std::vector<operation_up> &args_up = std::get<1> (m_storage);
bool
best_symbol (struct symbol *a, const domain_enum domain)
{
- return (SYMBOL_DOMAIN (a) == domain
+ return (a->domain () == domain
&& a->aclass () != LOC_UNRESOLVED);
}
if (b == NULL)
return a;
- if (SYMBOL_DOMAIN (a) == domain
- && SYMBOL_DOMAIN (b) != domain)
+ if (a->domain () == domain && b->domain () != domain)
return a;
- if (SYMBOL_DOMAIN (b) == domain
- && SYMBOL_DOMAIN (a) != domain)
+
+ if (b->domain () == domain && a->domain () != domain)
return b;
if (a->aclass () != LOC_UNRESOLVED && b->aclass () == LOC_UNRESOLVED)
make sure there is no "better" matching symbol, i.e., one with
exactly the same domain. PR 16253. */
if (symbol_matches_domain (sym->language (),
- SYMBOL_DOMAIN (sym), domain))
+ sym->domain (), domain))
other = better_symbol (other, sym, domain);
}
return other;
ALL_BLOCK_SYMBOLS_WITH_NAME (block, lookup_name, iter, sym)
{
if (symbol_matches_domain (sym->language (),
- SYMBOL_DOMAIN (sym), domain))
+ sym->domain (), domain))
{
sym_found = sym;
if (!SYMBOL_IS_ARGUMENT (sym))
STRUCT vs VAR domain symbols. So if a matching symbol is found,
make sure there is no "better" matching symbol, i.e., one with
exactly the same domain. PR 16253. */
- if (symbol_matches_domain (sym->language (), SYMBOL_DOMAIN (sym), domain))
+ if (symbol_matches_domain (sym->language (), sym->domain (), domain))
other = better_symbol (other, sym, domain);
}
{
/* MATCHER is deliberately called second here so that it never sees
a non-domain-matching symbol. */
- if (symbol_matches_domain (sym->language (), SYMBOL_DOMAIN (sym), domain)
+ if (symbol_matches_domain (sym->language (), sym->domain (), domain)
&& matcher (sym, data))
return sym;
}
but search the whole chain, as there may be several syms
from different files with the same name. */
if (real_sym->aclass () == LOC_TYPEDEF
- && SYMBOL_DOMAIN (real_sym) == VAR_DOMAIN
+ && real_sym->domain () == VAR_DOMAIN
&& SYMBOL_TYPE (real_sym)->code () == TYPE_CODE_PTR
&& TYPE_LENGTH (TYPE_TARGET_TYPE (SYMBOL_TYPE (real_sym))) != 0)
{
/* default assumptions */
SYMBOL_VALUE (sym) = cs->c_value;
- SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
+ sym->set_domain (VAR_DOMAIN);
sym->set_section_index (cs_to_section (cs, objfile));
if (ISFCN (cs->c_type))
case C_TPDEF:
sym->set_aclass_index (LOC_TYPEDEF);
- SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
+ sym->set_domain (VAR_DOMAIN);
/* If type has no name, give it one. */
if (SYMBOL_TYPE (sym)->name () == 0)
case C_UNTAG:
case C_ENTAG:
sym->set_aclass_index (LOC_TYPEDEF);
- SYMBOL_DOMAIN (sym) = STRUCT_DOMAIN;
+ sym->set_domain (STRUCT_DOMAIN);
/* Some compilers try to be helpful by inventing "fake"
names for anonymous enums, structures, and unions, like
name = obstack_strdup (&objfile->objfile_obstack, name);
sym->set_linkage_name (name);
sym->set_aclass_index (LOC_CONST);
- SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
+ sym->set_domain (VAR_DOMAIN);
SYMBOL_VALUE (sym) = ms->c_value;
add_symbol_to_list (sym, symlist);
nsyms++;
else
sym_type = context->convert_type (SYMBOL_TYPE (sym.symbol));
- if (SYMBOL_DOMAIN (sym.symbol) == STRUCT_DOMAIN)
+ if (sym.symbol->domain () == STRUCT_DOMAIN)
{
/* Binding a tag, so we don't need to build a decl. */
context->plugin ().tagbind (sym.symbol->natural_name (),
else
sym_type = instance->convert_type (SYMBOL_TYPE (sym.symbol));
- if (SYMBOL_DOMAIN (sym.symbol) == STRUCT_DOMAIN)
+ if (sym.symbol->domain () == STRUCT_DOMAIN)
{
/* Nothing to do. */
}
{
found = true;
convert_symbol_sym (instance, identifier, it,
- SYMBOL_DOMAIN (it.symbol));
+ it.symbol->domain ());
}
}
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);
- SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
+ sym->set_domain (VAR_DOMAIN);
SYMBOL_TYPE (sym) = 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);
- SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
+ sym->set_domain (VAR_DOMAIN);
sym->set_aclass_index (LOC_OPTIMIZED_OUT);
if (type != nullptr)
case CTF_K_UNION:
case CTF_K_ENUM:
sym->set_aclass_index (LOC_TYPEDEF);
- SYMBOL_DOMAIN (sym) = STRUCT_DOMAIN;
+ sym->set_domain (STRUCT_DOMAIN);
break;
case CTF_K_FUNCTION:
sym->set_aclass_index (LOC_STATIC);
case CTF_K_INTEGER:
case CTF_K_FLOAT:
sym->set_aclass_index (LOC_TYPEDEF);
- SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
+ sym->set_domain (VAR_DOMAIN);
break;
case CTF_K_POINTER:
break;
sym = new (&ccp->of->objfile_obstack) symbol;
OBJSTAT (ccp->of, n_syms++);
SYMBOL_TYPE (sym) = type;
- SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
+ sym->set_domain (VAR_DOMAIN);
sym->set_aclass_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 ());
sym = new (&ccp->of->objfile_obstack) symbol;
OBJSTAT (ccp->of, n_syms++);
SYMBOL_TYPE (sym) = type;
- SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
+ sym->set_domain (VAR_DOMAIN);
sym->set_aclass_index (LOC_STATIC);
sym->compute_and_set_names (tname, false, ccp->of->per_bfd);
add_symbol_to_list (sym, ccp->builder->get_global_symbols ());
sym->compute_and_set_names (saved_package_name, false, objfile->per_bfd);
/* This is not VAR_DOMAIN because we want a way to ensure a lookup of,
e.g., "main" finds the "main" module and not C's main(). */
- SYMBOL_DOMAIN (sym) = STRUCT_DOMAIN;
+ sym->set_domain (STRUCT_DOMAIN);
sym->set_aclass_index (LOC_TYPEDEF);
SYMBOL_TYPE (sym) = type;
/* Default assumptions.
Use the passed type or decode it from the die. */
- SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
+ sym->set_domain (VAR_DOMAIN);
sym->set_aclass_index (LOC_OPTIMIZED_OUT);
if (type != NULL)
SYMBOL_TYPE (sym) = type;
else
sym->set_aclass_index (LOC_OPTIMIZED_OUT);
SYMBOL_TYPE (sym) = objfile_type (objfile)->builtin_core_addr;
- SYMBOL_DOMAIN (sym) = LABEL_DOMAIN;
+ sym->set_domain (LABEL_DOMAIN);
add_symbol_to_list (sym, cu->list_in_scope);
break;
case DW_TAG_subprogram:
case DW_TAG_set_type:
case DW_TAG_enumeration_type:
sym->set_aclass_index (LOC_TYPEDEF);
- SYMBOL_DOMAIN (sym) = STRUCT_DOMAIN;
+ sym->set_domain (STRUCT_DOMAIN);
{
/* NOTE: carlton/2003-11-10: C++ class symbols shouldn't
break;
case DW_TAG_typedef:
sym->set_aclass_index (LOC_TYPEDEF);
- SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
+ sym->set_domain (VAR_DOMAIN);
list_to_add = cu->list_in_scope;
break;
case DW_TAG_array_type:
case DW_TAG_base_type:
case DW_TAG_subrange_type:
sym->set_aclass_index (LOC_TYPEDEF);
- SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
+ sym->set_domain (VAR_DOMAIN);
list_to_add = cu->list_in_scope;
break;
case DW_TAG_enumerator:
break;
case DW_TAG_module:
sym->set_aclass_index (LOC_TYPEDEF);
- SYMBOL_DOMAIN (sym) = MODULE_DOMAIN;
+ 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);
- SYMBOL_DOMAIN (sym) = COMMON_BLOCK_DOMAIN;
+ sym->set_domain (COMMON_BLOCK_DOMAIN);
add_symbol_to_list (sym, cu->list_in_scope);
break;
default:
get_user_print_options (&opts);
ALL_BLOCK_SYMBOLS (block, iter, sym)
- if (SYMBOL_DOMAIN (sym) == COMMON_BLOCK_DOMAIN)
+ if (sym->domain () == COMMON_BLOCK_DOMAIN)
{
const struct common_block *common = SYMBOL_VALUE_COMMON_BLOCK (sym);
size_t index;
BLOCK_END (new_block) = (CORE_ADDR) gdb_block_iter.end;
/* The name. */
- SYMBOL_DOMAIN (block_name) = VAR_DOMAIN;
+ block_name->set_domain (VAR_DOMAIN);
block_name->set_aclass_index (LOC_BLOCK);
symbol_set_symtab (block_name, filetab);
SYMBOL_TYPE (block_name) = lookup_function_type (block_type);
SYMBOL_OBJFILE_OWNED (symbol) = 0;
symbol->set_section_index (0);
SYMBOL_TYPE (symbol) = type;
- SYMBOL_DOMAIN (symbol) = VAR_DOMAIN;
+ symbol->set_domain (VAR_DOMAIN);
symbol->set_aclass_index (LOC_TYPEDEF);
return symbol;
}
ALL_BLOCK_SYMBOLS (block, iter, sym)
{
if (symbol_matches_domain (sym->language (),
- SYMBOL_DOMAIN (sym), LABEL_DOMAIN)
+ sym->domain (), LABEL_DOMAIN)
&& cmp (sym->search_name (), name, name_len) == 0)
{
result->push_back ({sym, block});
struct symbol *s, int aclass_index, struct block *b,
struct objfile *objfile, const char *name)
{
- SYMBOL_DOMAIN (s) = VAR_DOMAIN;
+ s->set_domain (VAR_DOMAIN);
s->set_aclass_index (aclass_index);
add_symbol (s, top_stack->cur_st, b);
name = "this"; /* FIXME, not alloc'd in obstack. */
s = new_symbol (name);
- SYMBOL_DOMAIN (s) = VAR_DOMAIN;
+ s->set_domain (VAR_DOMAIN);
SYMBOL_IS_ARGUMENT (s) = 1;
switch (sh->sc)
{
case stLabel: /* label, goes into current block. */
s = new_symbol (name);
- SYMBOL_DOMAIN (s) = VAR_DOMAIN; /* So that it can be used */
+ s->set_domain (VAR_DOMAIN); /* So that it can be used */
s->set_aclass_index (LOC_LABEL); /* but not misused. */
SET_SYMBOL_VALUE_ADDRESS (s, (CORE_ADDR) sh->value);
SYMBOL_TYPE (s) = objfile_type (objfile)->builtin_int;
break;
}
s = new_symbol (name);
- SYMBOL_DOMAIN (s) = VAR_DOMAIN;
+ s->set_domain (VAR_DOMAIN);
s->set_aclass_index (LOC_BLOCK);
/* Type of the return value. */
if (SC_IS_UNDEF (sh->sc) || sh->sc == scNil)
f->name ()));
enum_sym->set_aclass_index (LOC_CONST);
SYMBOL_TYPE (enum_sym) = t;
- SYMBOL_DOMAIN (enum_sym) = VAR_DOMAIN;
+ enum_sym->set_domain (VAR_DOMAIN);
SYMBOL_VALUE (enum_sym) = tsym.value;
if (SYMBOL_VALUE (enum_sym) < 0)
unsigned_enum = 0;
}
s = new_symbol (name);
- SYMBOL_DOMAIN (s) = STRUCT_DOMAIN;
+ s->set_domain (STRUCT_DOMAIN);
s->set_aclass_index (LOC_TYPEDEF);
SYMBOL_VALUE (s) = 0;
SYMBOL_TYPE (s) = t;
/* Make up special symbol to contain procedure specific info. */
s = new_symbol (MDEBUG_EFI_SYMBOL_NAME);
- SYMBOL_DOMAIN (s) = LABEL_DOMAIN;
+ s->set_domain (LABEL_DOMAIN);
s->set_aclass_index (LOC_CONST);
SYMBOL_TYPE (s) = objfile_type (mdebugread_objfile)->builtin_void;
e = OBSTACK_ZALLOC (&mdebugread_objfile->objfile_obstack,
if (has_opaque_xref (cur_fdr, sh))
break;
s = new_symbol (name);
- SYMBOL_DOMAIN (s) = VAR_DOMAIN;
+ s->set_domain (VAR_DOMAIN);
s->set_aclass_index (LOC_TYPEDEF);
SYMBOL_BLOCK_VALUE (s) = top_stack->cur_block;
SYMBOL_TYPE (s) = t;
#else
/* FIXME -- delete. We can't do symbol allocation now; it's all done. */
s = new_symbol (sh_name);
- SYMBOL_DOMAIN (s) = VAR_DOMAIN;
+ s->set_domain (VAR_DOMAIN);
SYMBOL_CLASS (s) = LOC_BLOCK;
/* Don't know its type, hope int is ok. */
SYMBOL_TYPE (s)
mdebug_extra_func_info);
struct symbol *s = new_symbol (MDEBUG_EFI_SYMBOL_NAME);
- SYMBOL_DOMAIN (s) = LABEL_DOMAIN;
+ s->set_domain (LABEL_DOMAIN);
s->set_aclass_index (LOC_CONST);
SYMBOL_TYPE (s) = objfile_type (objfile)->builtin_void;
SYMBOL_VALUE_BYTES (s) = (gdb_byte *) e;
ALL_BLOCK_SYMBOLS (block, iter, sym)
{
if (sym->linkage_name ()[0] == inc
- && SYMBOL_DOMAIN (sym) == domain
+ && sym->domain () == domain
&& sym->aclass () == theclass
&& strcmp (sym->linkage_name (), name) == 0)
return sym;
ld will remove it from the executable. There is then
a N_GSYM stab for it, but no regular (C_EXT) symbol. */
sym = new (&objfile->objfile_obstack) symbol;
- SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
+ sym->set_domain (VAR_DOMAIN);
sym->set_aclass_index (LOC_OPTIMIZED_OUT);
sym->set_linkage_name
(obstack_strndup (&objfile->objfile_obstack, name, pp - name));
{
sym->set_aclass_index (LOC_CONST);
SYMBOL_TYPE (sym) = error_type (&p, objfile);
- SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
+ sym->set_domain (VAR_DOMAIN);
add_symbol_to_list (sym, get_file_symbols ());
return sym;
}
{
sym->set_aclass_index (LOC_CONST);
SYMBOL_TYPE (sym) = error_type (&p, objfile);
- SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
+ sym->set_domain (VAR_DOMAIN);
add_symbol_to_list (sym, get_file_symbols ());
return sym;
}
{
sym->set_aclass_index (LOC_CONST);
SYMBOL_TYPE (sym) = error_type (&p, objfile);
- SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
+ sym->set_domain (VAR_DOMAIN);
add_symbol_to_list (sym, get_file_symbols ());
return sym;
}
SYMBOL_TYPE (sym) = error_type (&p, objfile);
}
}
- SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
+ sym->set_domain (VAR_DOMAIN);
add_symbol_to_list (sym, get_file_symbols ());
return sym;
/* The name of a caught exception. */
SYMBOL_TYPE (sym) = read_type (&p, objfile);
sym->set_aclass_index (LOC_LABEL);
- SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
+ sym->set_domain (VAR_DOMAIN);
SET_SYMBOL_VALUE_ADDRESS (sym, valu);
add_symbol_to_list (sym, get_local_symbols ());
break;
/* A static function definition. */
SYMBOL_TYPE (sym) = read_type (&p, objfile);
sym->set_aclass_index (LOC_BLOCK);
- SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
+ sym->set_domain (VAR_DOMAIN);
add_symbol_to_list (sym, get_file_symbols ());
/* fall into process_function_types. */
/* A global function definition. */
SYMBOL_TYPE (sym) = read_type (&p, objfile);
sym->set_aclass_index (LOC_BLOCK);
- SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
+ sym->set_domain (VAR_DOMAIN);
add_symbol_to_list (sym, get_global_symbols ());
goto process_function_types;
These definitions appear at the end of the namelist. */
SYMBOL_TYPE (sym) = read_type (&p, objfile);
sym->set_aclass_index (LOC_STATIC);
- SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
+ sym->set_domain (VAR_DOMAIN);
/* Don't add symbol references to global_sym_chain.
Symbol references don't have valid names and wont't match up with
minimal symbols when the global_sym_chain is relocated.
SYMBOL_TYPE (sym) = read_type (&p, objfile);
sym->set_aclass_index (LOC_LOCAL);
SYMBOL_VALUE (sym) = valu;
- SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
+ sym->set_domain (VAR_DOMAIN);
add_symbol_to_list (sym, get_local_symbols ());
break;
sym->set_aclass_index (LOC_ARG);
SYMBOL_VALUE (sym) = valu;
- SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
+ sym->set_domain (VAR_DOMAIN);
SYMBOL_IS_ARGUMENT (sym) = 1;
add_symbol_to_list (sym, get_local_symbols ());
sym->set_aclass_index (stab_register_index);
SYMBOL_IS_ARGUMENT (sym) = 1;
SYMBOL_VALUE (sym) = valu;
- SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
+ sym->set_domain (VAR_DOMAIN);
add_symbol_to_list (sym, get_local_symbols ());
break;
SYMBOL_TYPE (sym) = read_type (&p, objfile);
sym->set_aclass_index (stab_register_index);
SYMBOL_VALUE (sym) = valu;
- SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
+ sym->set_domain (VAR_DOMAIN);
if (within_function)
{
/* Sun cc uses a pair of symbols, one 'p' and one 'r', with
SYMBOL_TYPE (sym) = read_type (&p, objfile);
sym->set_aclass_index (LOC_STATIC);
SET_SYMBOL_VALUE_ADDRESS (sym, valu);
- SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
+ sym->set_domain (VAR_DOMAIN);
add_symbol_to_list (sym, get_file_symbols ());
break;
sym->set_aclass_index (LOC_TYPEDEF);
SYMBOL_VALUE (sym) = valu;
- SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
+ sym->set_domain (VAR_DOMAIN);
/* C++ vagaries: we may have a type which is derived from
a base type which did not have its name defined when the
derived class was output. We fill in the derived class's
*struct_sym = *sym;
struct_sym->set_aclass_index (LOC_TYPEDEF);
SYMBOL_VALUE (struct_sym) = valu;
- SYMBOL_DOMAIN (struct_sym) = STRUCT_DOMAIN;
+ struct_sym->set_domain (STRUCT_DOMAIN);
if (SYMBOL_TYPE (sym)->name () == 0)
SYMBOL_TYPE (sym)->set_name
(obconcat (&objfile->objfile_obstack, sym->linkage_name (),
sym->set_aclass_index (LOC_TYPEDEF);
SYMBOL_VALUE (sym) = valu;
- SYMBOL_DOMAIN (sym) = STRUCT_DOMAIN;
+ sym->set_domain (STRUCT_DOMAIN);
if (SYMBOL_TYPE (sym)->name () == 0)
SYMBOL_TYPE (sym)->set_name
(obconcat (&objfile->objfile_obstack, sym->linkage_name (),
*typedef_sym = *sym;
typedef_sym->set_aclass_index (LOC_TYPEDEF);
SYMBOL_VALUE (typedef_sym) = valu;
- SYMBOL_DOMAIN (typedef_sym) = VAR_DOMAIN;
+ typedef_sym->set_domain (VAR_DOMAIN);
if (SYMBOL_TYPE (sym)->name () == 0)
SYMBOL_TYPE (sym)->set_name
(obconcat (&objfile->objfile_obstack, sym->linkage_name (),
SYMBOL_TYPE (sym) = read_type (&p, objfile);
sym->set_aclass_index (LOC_STATIC);
SET_SYMBOL_VALUE_ADDRESS (sym, valu);
- SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
+ sym->set_domain (VAR_DOMAIN);
add_symbol_to_list (sym, get_local_symbols ());
break;
sym->set_aclass_index (LOC_REF_ARG);
SYMBOL_IS_ARGUMENT (sym) = 1;
SYMBOL_VALUE (sym) = valu;
- SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
+ sym->set_domain (VAR_DOMAIN);
add_symbol_to_list (sym, get_local_symbols ());
break;
sym->set_aclass_index (stab_regparm_index);
SYMBOL_IS_ARGUMENT (sym) = 1;
SYMBOL_VALUE (sym) = valu;
- SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
+ sym->set_domain (VAR_DOMAIN);
add_symbol_to_list (sym, get_local_symbols ());
break;
SYMBOL_TYPE (sym) = read_type (&p, objfile);
sym->set_aclass_index (LOC_LOCAL);
SYMBOL_VALUE (sym) = valu;
- SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
+ sym->set_domain (VAR_DOMAIN);
add_symbol_to_list (sym, get_local_symbols ());
break;
SYMBOL_TYPE (sym) = error_type (&p, objfile);
sym->set_aclass_index (LOC_CONST);
SYMBOL_VALUE (sym) = 0;
- SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
+ sym->set_domain (VAR_DOMAIN);
add_symbol_to_list (sym, get_file_symbols ());
break;
}
struct symbol *sym = ppt->symbol[i];
if (sym->aclass () == LOC_TYPEDEF
- && SYMBOL_DOMAIN (sym) == STRUCT_DOMAIN
+ && sym->domain () == STRUCT_DOMAIN
&& (SYMBOL_TYPE (sym)->code () == code)
&& strcmp (sym->linkage_name (), type_name) == 0)
{
sym->set_language (get_current_subfile ()->language,
&objfile->objfile_obstack);
sym->set_aclass_index (LOC_CONST);
- SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
+ sym->set_domain (VAR_DOMAIN);
SYMBOL_VALUE (sym) = n;
if (n < 0)
unsigned_enum = 0;
struct symbol *sym = ppt->symbol[i];
if (sym->aclass () == LOC_TYPEDEF
- && SYMBOL_DOMAIN (sym) == STRUCT_DOMAIN
+ && sym->domain () == STRUCT_DOMAIN
&& (SYMBOL_TYPE (sym)->code () == (*type)->code ())
&& ((*type)->instance_flags ()
== SYMBOL_TYPE (sym)->instance_flags ())
case LOC_OPTIMIZED_OUT:
if (SYMBOL_IS_ARGUMENT (sym))
break;
- if (SYMBOL_DOMAIN (sym) == COMMON_BLOCK_DOMAIN)
+ if (sym->domain () == COMMON_BLOCK_DOMAIN)
break;
(*cb) (sym->print_name (), sym, cb_data);
break;
section = NULL;
print_spaces_filtered (depth, outfile);
- if (SYMBOL_DOMAIN (symbol) == LABEL_DOMAIN)
+ if (symbol->domain () == LABEL_DOMAIN)
{
fprintf_filtered (outfile, "label %s at ", symbol->print_name ());
fputs_filtered (paddress (gdbarch, SYMBOL_VALUE_ADDRESS (symbol)),
return;
}
- if (SYMBOL_DOMAIN (symbol) == STRUCT_DOMAIN)
+ if (symbol->domain () == STRUCT_DOMAIN)
{
if (SYMBOL_TYPE (symbol)->name ())
{
else
{
slot_name = slot->value.found.symbol->search_name ();
- slot_domain = SYMBOL_DOMAIN (slot->value.found.symbol);
+ slot_domain = slot->value.found.symbol->domain ();
}
/* NULL names match. */
printf_filtered (" [%4u] = %s, %s %s\n", i,
host_address_to_string (context),
found->print_name (),
- domain_name (SYMBOL_DOMAIN (found)));
+ domain_name (found->domain ()));
break;
}
}
break;
}
if (symbol_matches_domain (result.symbol->language (),
- SYMBOL_DOMAIN (result.symbol), domain))
+ result.symbol->domain (), domain))
{
struct symbol *better
= better_symbol (other.symbol, result.symbol, domain);
ALL_BLOCK_SYMBOLS_WITH_NAME (block, name, iter, sym)
{
- if (symbol_matches_domain (sym->language (), SYMBOL_DOMAIN (sym), domain))
+ if (symbol_matches_domain (sym->language (), sym->domain (), domain))
{
struct block_symbol block_sym = {sym, block};
sym)))
|| (kind == TYPES_DOMAIN
&& sym->aclass () == LOC_TYPEDEF
- && SYMBOL_DOMAIN (sym) != MODULE_DOMAIN)
+ && sym->domain () != MODULE_DOMAIN)
|| (kind == MODULES_DOMAIN
- && SYMBOL_DOMAIN (sym) == MODULE_DOMAIN
+ && sym->domain () == MODULE_DOMAIN
&& SYMBOL_LINE (sym) != 0))))
{
if (result_set->size () < m_max_search_results)
/* Typedef that is not a C++ class. */
if (kind == TYPES_DOMAIN
- && SYMBOL_DOMAIN (sym) != STRUCT_DOMAIN)
+ && sym->domain () != STRUCT_DOMAIN)
{
string_file tmp_stream;
/* variable, func, or typedef-that-is-c++-class. */
else if (kind < TYPES_DOMAIN
|| (kind == TYPES_DOMAIN
- && SYMBOL_DOMAIN (sym) == STRUCT_DOMAIN))
+ && sym->domain () == STRUCT_DOMAIN))
{
string_file tmp_stream;
the msymbol name and removes the msymbol name from the completion
tracker. */
if (sym->language () == language_cplus
- && SYMBOL_DOMAIN (sym) == VAR_DOMAIN
+ && sym->domain () == VAR_DOMAIN
&& sym->aclass () == LOC_BLOCK)
{
/* The call to canonicalize returns the empty string if the input
continue;
if (code == TYPE_CODE_UNDEF
- || (SYMBOL_DOMAIN (sym) == STRUCT_DOMAIN
+ || (sym->domain () == STRUCT_DOMAIN
&& SYMBOL_TYPE (sym)->code () == code))
completion_list_add_symbol (tracker, sym,
lookup_name,
completion_list_add_fields (tracker, sym, lookup_name,
sym_text, word);
}
- else if (SYMBOL_DOMAIN (sym) == STRUCT_DOMAIN
+ else if (sym->domain () == STRUCT_DOMAIN
&& SYMBOL_TYPE (sym)->code () == code)
completion_list_add_symbol (tracker, sym, lookup_name,
sym_text, word);
{
symbol ()
/* Class-initialization of bitfields is only allowed in C++20. */
- : domain (UNDEF_DOMAIN),
+ : m_domain (UNDEF_DOMAIN),
m_aclass_index (0),
is_objfile_owned (1),
is_argument (0),
return this->impl ().aclass;
}
+ domain_enum domain () const
+ {
+ return m_domain;
+ }
+
+ void set_domain (domain_enum domain)
+ {
+ m_domain = domain;
+ }
+
/* Data type of value */
struct type *type = nullptr;
/* Domain code. */
- ENUM_BITFIELD(domain_enum_tag) domain : SYMBOL_DOMAIN_BITS;
+ ENUM_BITFIELD(domain_enum_tag) 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,
/* Note: There is no accessor macro for symbol.owner because it is
"private". */
-#define SYMBOL_DOMAIN(symbol) (symbol)->domain
#define SYMBOL_OBJFILE_OWNED(symbol) ((symbol)->is_objfile_owned)
#define SYMBOL_IS_ARGUMENT(symbol) (symbol)->is_argument
#define SYMBOL_INLINED(symbol) (symbol)->is_inlined
/* default assumptions */
SET_SYMBOL_VALUE_ADDRESS (sym, cs->c_value + off);
- SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
+ sym->set_domain (VAR_DOMAIN);
sym->set_section_index (secnum_to_section (cs->c_secnum, objfile));
if (ISFCN (cs->c_type))