lookup_function_type (decode_function_type (cs, cs->c_type,
aux, objfile));
- SYMBOL_ACLASS_INDEX (sym) = LOC_BLOCK;
+ sym->set_aclass_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:
- SYMBOL_ACLASS_INDEX (sym) = LOC_LOCAL;
+ sym->set_aclass_index (LOC_LOCAL);
add_symbol_to_list (sym, get_local_symbols ());
break;
case C_THUMBEXT:
case C_THUMBEXTFUNC:
case C_EXT:
- SYMBOL_ACLASS_INDEX (sym) = LOC_STATIC;
+ sym->set_aclass_index (LOC_STATIC);
SET_SYMBOL_VALUE_ADDRESS (sym,
(CORE_ADDR) cs->c_value
+ objfile->section_offsets[SECT_OFF_TEXT (objfile)]);
case C_THUMBSTAT:
case C_THUMBSTATFUNC:
case C_STAT:
- SYMBOL_ACLASS_INDEX (sym) = LOC_STATIC;
+ sym->set_aclass_index (LOC_STATIC);
SET_SYMBOL_VALUE_ADDRESS (sym,
(CORE_ADDR) cs->c_value
+ objfile->section_offsets[SECT_OFF_TEXT (objfile)]);
case C_GLBLREG:
#endif
case C_REG:
- SYMBOL_ACLASS_INDEX (sym) = coff_register_index;
+ sym->set_aclass_index (coff_register_index);
SYMBOL_VALUE (sym) = cs->c_value;
add_symbol_to_list (sym, get_local_symbols ());
break;
break;
case C_ARG:
- SYMBOL_ACLASS_INDEX (sym) = LOC_ARG;
+ sym->set_aclass_index (LOC_ARG);
SYMBOL_IS_ARGUMENT (sym) = 1;
add_symbol_to_list (sym, get_local_symbols ());
break;
case C_REGPARM:
- SYMBOL_ACLASS_INDEX (sym) = coff_register_index;
+ sym->set_aclass_index (coff_register_index);
SYMBOL_IS_ARGUMENT (sym) = 1;
SYMBOL_VALUE (sym) = cs->c_value;
add_symbol_to_list (sym, get_local_symbols ());
break;
case C_TPDEF:
- SYMBOL_ACLASS_INDEX (sym) = LOC_TYPEDEF;
+ sym->set_aclass_index (LOC_TYPEDEF);
SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
/* If type has no name, give it one. */
case C_STRTAG:
case C_UNTAG:
case C_ENTAG:
- SYMBOL_ACLASS_INDEX (sym) = LOC_TYPEDEF;
+ sym->set_aclass_index (LOC_TYPEDEF);
SYMBOL_DOMAIN (sym) = STRUCT_DOMAIN;
/* Some compilers try to be helpful by inventing "fake"
name = obstack_strdup (&objfile->objfile_obstack, name);
sym->set_linkage_name (name);
- SYMBOL_ACLASS_INDEX (sym) = LOC_CONST;
+ sym->set_aclass_index (LOC_CONST);
SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
SYMBOL_VALUE (sym) = ms->c_value;
add_symbol_to_list (sym, symlist);
if (msym.minsym != NULL)
{
SET_SYMBOL_VALUE_ADDRESS (sym, BMSYMBOL_VALUE_ADDRESS (msym));
- SYMBOL_ACLASS_INDEX (sym) = LOC_STATIC;
+ sym->set_aclass_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);
- SYMBOL_ACLASS_INDEX (sym) = LOC_CONST;
+ sym->set_aclass_index (LOC_CONST);
SYMBOL_DOMAIN (sym) = 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;
- SYMBOL_ACLASS_INDEX (sym) = LOC_OPTIMIZED_OUT;
+ sym->set_aclass_index (LOC_OPTIMIZED_OUT);
if (type != nullptr)
SYMBOL_TYPE (sym) = type;
case CTF_K_STRUCT:
case CTF_K_UNION:
case CTF_K_ENUM:
- SYMBOL_ACLASS_INDEX (sym) = LOC_TYPEDEF;
+ sym->set_aclass_index (LOC_TYPEDEF);
SYMBOL_DOMAIN (sym) = STRUCT_DOMAIN;
break;
case CTF_K_FUNCTION:
- SYMBOL_ACLASS_INDEX (sym) = LOC_STATIC;
+ sym->set_aclass_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:
- SYMBOL_ACLASS_INDEX (sym) = LOC_TYPEDEF;
+ sym->set_aclass_index (LOC_TYPEDEF);
SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
break;
case CTF_K_POINTER:
OBJSTAT (ccp->of, n_syms++);
SYMBOL_TYPE (sym) = type;
SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
- SYMBOL_ACLASS_INDEX (sym) = LOC_OPTIMIZED_OUT;
+ 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 ());
break;
OBJSTAT (ccp->of, n_syms++);
SYMBOL_TYPE (sym) = type;
SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
- SYMBOL_ACLASS_INDEX (sym) = LOC_STATIC;
+ 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 ());
set_symbol_address (ccp->of, sym, tname);
/* 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;
- SYMBOL_ACLASS_INDEX (sym) = LOC_TYPEDEF;
+ sym->set_aclass_index (LOC_TYPEDEF);
SYMBOL_TYPE (sym) = type;
add_symbol_to_list (sym, cu->get_builder ()->get_global_symbols ());
gdb_assert (ptr - baton->data == baton->size);
SYMBOL_LOCATION_BATON (sym) = baton;
- SYMBOL_ACLASS_INDEX (sym) = dwarf2_locexpr_index;
+ sym->set_aclass_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)
{
- SYMBOL_ACLASS_INDEX (sym) = LOC_OPTIMIZED_OUT;
+ sym->set_aclass_index (LOC_OPTIMIZED_OUT);
return;
}
SET_SYMBOL_VALUE_ADDRESS
(sym, read_addr_index_from_leb128 (cu, block->data + 1,
&dummy));
- SYMBOL_ACLASS_INDEX (sym) = LOC_STATIC;
+ sym->set_aclass_index (LOC_STATIC);
fixup_symbol_section (sym, objfile);
SET_SYMBOL_VALUE_ADDRESS
(sym,
/* Default assumptions.
Use the passed type or decode it from the die. */
SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
- SYMBOL_ACLASS_INDEX (sym) = LOC_OPTIMIZED_OUT;
+ sym->set_aclass_index (LOC_OPTIMIZED_OUT);
if (type != NULL)
SYMBOL_TYPE (sym) = type;
else
addr = attr->as_address ();
addr = gdbarch_adjust_dwarf2_addr (gdbarch, addr + baseaddr);
SET_SYMBOL_VALUE_ADDRESS (sym, addr);
- SYMBOL_ACLASS_INDEX (sym) = LOC_LABEL;
+ sym->set_aclass_index (LOC_LABEL);
}
else
- SYMBOL_ACLASS_INDEX (sym) = LOC_OPTIMIZED_OUT;
+ sym->set_aclass_index (LOC_OPTIMIZED_OUT);
SYMBOL_TYPE (sym) = objfile_type (objfile)->builtin_core_addr;
SYMBOL_DOMAIN (sym) = LABEL_DOMAIN;
add_symbol_to_list (sym, cu->list_in_scope);
case DW_TAG_subprogram:
/* SYMBOL_BLOCK_VALUE (sym) will be filled in later by
finish_block. */
- SYMBOL_ACLASS_INDEX (sym) = LOC_BLOCK;
+ sym->set_aclass_index (LOC_BLOCK);
attr2 = dwarf2_attr (die, DW_AT_external, cu);
if ((attr2 != nullptr && attr2->as_boolean ())
|| cu->per_cu->lang == language_ada
case DW_TAG_inlined_subroutine:
/* SYMBOL_BLOCK_VALUE (sym) will be filled in later by
finish_block. */
- SYMBOL_ACLASS_INDEX (sym) = LOC_BLOCK;
+ sym->set_aclass_index (LOC_BLOCK);
SYMBOL_INLINED (sym) = 1;
list_to_add = cu->list_in_scope;
break;
? cu->get_builder ()->get_global_symbols ()
: cu->list_in_scope);
- SYMBOL_ACLASS_INDEX (sym) = LOC_UNRESOLVED;
+ sym->set_aclass_index (LOC_UNRESOLVED);
}
else if (!die_is_declaration (die, cu))
{
case DW_TAG_union_type:
case DW_TAG_set_type:
case DW_TAG_enumeration_type:
- SYMBOL_ACLASS_INDEX (sym) = LOC_TYPEDEF;
+ sym->set_aclass_index (LOC_TYPEDEF);
SYMBOL_DOMAIN (sym) = STRUCT_DOMAIN;
{
}
break;
case DW_TAG_typedef:
- SYMBOL_ACLASS_INDEX (sym) = LOC_TYPEDEF;
+ sym->set_aclass_index (LOC_TYPEDEF);
SYMBOL_DOMAIN (sym) = 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:
- SYMBOL_ACLASS_INDEX (sym) = LOC_TYPEDEF;
+ sym->set_aclass_index (LOC_TYPEDEF);
SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
list_to_add = cu->list_in_scope;
break;
break;
case DW_TAG_imported_declaration:
case DW_TAG_namespace:
- SYMBOL_ACLASS_INDEX (sym) = LOC_TYPEDEF;
+ sym->set_aclass_index (LOC_TYPEDEF);
list_to_add = cu->get_builder ()->get_global_symbols ();
break;
case DW_TAG_module:
- SYMBOL_ACLASS_INDEX (sym) = LOC_TYPEDEF;
+ sym->set_aclass_index (LOC_TYPEDEF);
SYMBOL_DOMAIN (sym) = MODULE_DOMAIN;
list_to_add = cu->get_builder ()->get_global_symbols ();
break;
case DW_TAG_common_block:
- SYMBOL_ACLASS_INDEX (sym) = LOC_COMMON_BLOCK;
+ sym->set_aclass_index (LOC_COMMON_BLOCK);
SYMBOL_DOMAIN (sym) = COMMON_BLOCK_DOMAIN;
add_symbol_to_list (sym, cu->list_in_scope);
break;
if (baton != NULL)
{
SYMBOL_LOCATION_BATON (sym) = baton;
- SYMBOL_ACLASS_INDEX (sym) = dwarf2_locexpr_index;
+ sym->set_aclass_index (dwarf2_locexpr_index);
}
else if (bytes != NULL)
{
SYMBOL_VALUE_BYTES (sym) = bytes;
- SYMBOL_ACLASS_INDEX (sym) = LOC_CONST_BYTES;
+ sym->set_aclass_index (LOC_CONST_BYTES);
}
else
{
SYMBOL_VALUE (sym) = value;
- SYMBOL_ACLASS_INDEX (sym) = LOC_CONST;
+ sym->set_aclass_index (LOC_CONST);
}
}
complaint (_("Location list used without "
"specifying the CU base address."));
- SYMBOL_ACLASS_INDEX (sym) = (is_block
- ? dwarf2_loclist_block_index
- : dwarf2_loclist_index);
+ sym->set_aclass_index ((is_block
+ ? dwarf2_loclist_block_index
+ : dwarf2_loclist_index));
SYMBOL_LOCATION_BATON (sym) = baton;
}
else
baton->size = 0;
}
- SYMBOL_ACLASS_INDEX (sym) = (is_block
- ? dwarf2_locexpr_block_index
- : dwarf2_locexpr_index);
+ sym->set_aclass_index ((is_block
+ ? dwarf2_locexpr_block_index
+ : dwarf2_locexpr_index));
SYMBOL_LOCATION_BATON (sym) = baton;
}
}
/* The name. */
SYMBOL_DOMAIN (block_name) = VAR_DOMAIN;
- SYMBOL_ACLASS_INDEX (block_name) = LOC_BLOCK;
+ block_name->set_aclass_index (LOC_BLOCK);
symbol_set_symtab (block_name, filetab);
SYMBOL_TYPE (block_name) = lookup_function_type (block_type);
SYMBOL_BLOCK_VALUE (block_name) = new_block;
symbol->set_section_index (0);
SYMBOL_TYPE (symbol) = type;
SYMBOL_DOMAIN (symbol) = VAR_DOMAIN;
- SYMBOL_ACLASS_INDEX (symbol) = LOC_TYPEDEF;
+ symbol->set_aclass_index (LOC_TYPEDEF);
return symbol;
}
struct objfile *objfile, const char *name)
{
SYMBOL_DOMAIN (s) = VAR_DOMAIN;
- SYMBOL_ACLASS_INDEX (s) = aclass_index;
+ s->set_aclass_index (aclass_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. */
- SYMBOL_ACLASS_INDEX (s) = mdebug_register_index;
+ s->set_aclass_index (mdebug_register_index);
break;
case scVar:
/* Pass by reference on stack. */
- SYMBOL_ACLASS_INDEX (s) = LOC_REF_ARG;
+ s->set_aclass_index (LOC_REF_ARG);
break;
case scVarRegister:
/* Pass by reference in register. */
- SYMBOL_ACLASS_INDEX (s) = mdebug_regparm_index;
+ s->set_aclass_index (mdebug_regparm_index);
break;
default:
/* Pass by value on stack. */
- SYMBOL_ACLASS_INDEX (s) = LOC_ARG;
+ s->set_aclass_index (LOC_ARG);
break;
}
SYMBOL_VALUE (s) = svalue;
case stLabel: /* label, goes into current block. */
s = new_symbol (name);
SYMBOL_DOMAIN (s) = VAR_DOMAIN; /* So that it can be used */
- SYMBOL_ACLASS_INDEX (s) = LOC_LABEL; /* but not misused. */
+ 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;
add_symbol (s, top_stack->cur_st, top_stack->cur_block);
}
s = new_symbol (name);
SYMBOL_DOMAIN (s) = VAR_DOMAIN;
- SYMBOL_ACLASS_INDEX (s) = LOC_BLOCK;
+ s->set_aclass_index (LOC_BLOCK);
/* Type of the return value. */
if (SC_IS_UNDEF (sh->sc) || sh->sc == scNil)
t = objfile_type (objfile)->builtin_int;
enum_sym->set_linkage_name
(obstack_strdup (&mdebugread_objfile->objfile_obstack,
f->name ()));
- SYMBOL_ACLASS_INDEX (enum_sym) = LOC_CONST;
+ enum_sym->set_aclass_index (LOC_CONST);
SYMBOL_TYPE (enum_sym) = t;
SYMBOL_DOMAIN (enum_sym) = VAR_DOMAIN;
SYMBOL_VALUE (enum_sym) = tsym.value;
s = new_symbol (name);
SYMBOL_DOMAIN (s) = STRUCT_DOMAIN;
- SYMBOL_ACLASS_INDEX (s) = LOC_TYPEDEF;
+ s->set_aclass_index (LOC_TYPEDEF);
SYMBOL_VALUE (s) = 0;
SYMBOL_TYPE (s) = 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);
SYMBOL_DOMAIN (s) = LABEL_DOMAIN;
- SYMBOL_ACLASS_INDEX (s) = LOC_CONST;
+ s->set_aclass_index (LOC_CONST);
SYMBOL_TYPE (s) = objfile_type (mdebugread_objfile)->builtin_void;
e = OBSTACK_ZALLOC (&mdebugread_objfile->objfile_obstack,
mdebug_extra_func_info);
break;
s = new_symbol (name);
SYMBOL_DOMAIN (s) = VAR_DOMAIN;
- SYMBOL_ACLASS_INDEX (s) = LOC_TYPEDEF;
+ s->set_aclass_index (LOC_TYPEDEF);
SYMBOL_BLOCK_VALUE (s) = top_stack->cur_block;
SYMBOL_TYPE (s) = t;
add_symbol (s, top_stack->cur_st, top_stack->cur_block);
struct symbol *s = new_symbol (MDEBUG_EFI_SYMBOL_NAME);
SYMBOL_DOMAIN (s) = LABEL_DOMAIN;
- SYMBOL_ACLASS_INDEX (s) = LOC_CONST;
+ s->set_aclass_index (LOC_CONST);
SYMBOL_TYPE (s) = objfile_type (objfile)->builtin_void;
SYMBOL_VALUE_BYTES (s) = (gdb_byte *) e;
e->pdr.framereg = -1;
a N_GSYM stab for it, but no regular (C_EXT) symbol. */
sym = new (&objfile->objfile_obstack) symbol;
SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
- SYMBOL_ACLASS_INDEX (sym) = LOC_OPTIMIZED_OUT;
+ sym->set_aclass_index (LOC_OPTIMIZED_OUT);
sym->set_linkage_name
(obstack_strndup (&objfile->objfile_obstack, name, pp - name));
pp += 2;
(where type 6 is defined by "blobs:t6=eblob1:0,blob2:1,;"). */
if (*p != '=')
{
- SYMBOL_ACLASS_INDEX (sym) = LOC_CONST;
+ sym->set_aclass_index (LOC_CONST);
SYMBOL_TYPE (sym) = error_type (&p, objfile);
SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
add_symbol_to_list (sym, get_file_symbols ());
SYMBOL_TYPE (sym) = dbl_type;
SYMBOL_VALUE_BYTES (sym) = dbl_valu;
- SYMBOL_ACLASS_INDEX (sym) = LOC_CONST_BYTES;
+ sym->set_aclass_index (LOC_CONST_BYTES);
}
break;
case 'i':
SYMBOL_TYPE (sym) = objfile_type (objfile)->builtin_long;
SYMBOL_VALUE (sym) = atoi (p);
- SYMBOL_ACLASS_INDEX (sym) = LOC_CONST;
+ sym->set_aclass_index (LOC_CONST);
}
break;
{
SYMBOL_TYPE (sym) = objfile_type (objfile)->builtin_char;
SYMBOL_VALUE (sym) = atoi (p);
- SYMBOL_ACLASS_INDEX (sym) = LOC_CONST;
+ sym->set_aclass_index (LOC_CONST);
}
break;
if (quote != '\'' && quote != '"')
{
- SYMBOL_ACLASS_INDEX (sym) = LOC_CONST;
+ sym->set_aclass_index (LOC_CONST);
SYMBOL_TYPE (sym) = error_type (&p, objfile);
SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
add_symbol_to_list (sym, get_file_symbols ());
}
if (*p != quote)
{
- SYMBOL_ACLASS_INDEX (sym) = LOC_CONST;
+ sym->set_aclass_index (LOC_CONST);
SYMBOL_TYPE (sym) = error_type (&p, objfile);
SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
add_symbol_to_list (sym, get_file_symbols ());
p++;
SYMBOL_VALUE_BYTES (sym) = string_value;
- SYMBOL_ACLASS_INDEX (sym) = LOC_CONST_BYTES;
+ sym->set_aclass_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,;"). */
{
- SYMBOL_ACLASS_INDEX (sym) = LOC_CONST;
+ sym->set_aclass_index (LOC_CONST);
SYMBOL_TYPE (sym) = read_type (&p, objfile);
if (*p != ',')
break;
default:
{
- SYMBOL_ACLASS_INDEX (sym) = LOC_CONST;
+ sym->set_aclass_index (LOC_CONST);
SYMBOL_TYPE (sym) = error_type (&p, objfile);
}
}
case 'C':
/* The name of a caught exception. */
SYMBOL_TYPE (sym) = read_type (&p, objfile);
- SYMBOL_ACLASS_INDEX (sym) = LOC_LABEL;
+ sym->set_aclass_index (LOC_LABEL);
SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
SET_SYMBOL_VALUE_ADDRESS (sym, valu);
add_symbol_to_list (sym, get_local_symbols ());
case 'f':
/* A static function definition. */
SYMBOL_TYPE (sym) = read_type (&p, objfile);
- SYMBOL_ACLASS_INDEX (sym) = LOC_BLOCK;
+ sym->set_aclass_index (LOC_BLOCK);
SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
add_symbol_to_list (sym, get_file_symbols ());
/* fall into process_function_types. */
case 'F':
/* A global function definition. */
SYMBOL_TYPE (sym) = read_type (&p, objfile);
- SYMBOL_ACLASS_INDEX (sym) = LOC_BLOCK;
+ sym->set_aclass_index (LOC_BLOCK);
SYMBOL_DOMAIN (sym) = VAR_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. */
SYMBOL_TYPE (sym) = read_type (&p, objfile);
- SYMBOL_ACLASS_INDEX (sym) = LOC_STATIC;
+ sym->set_aclass_index (LOC_STATIC);
SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
/* Don't add symbol references to global_sym_chain.
Symbol references don't have valid names and wont't match up with
case 's':
case 'l':
SYMBOL_TYPE (sym) = read_type (&p, objfile);
- SYMBOL_ACLASS_INDEX (sym) = LOC_LOCAL;
+ sym->set_aclass_index (LOC_LOCAL);
SYMBOL_VALUE (sym) = valu;
SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
add_symbol_to_list (sym, get_local_symbols ());
else
SYMBOL_TYPE (sym) = read_type (&p, objfile);
- SYMBOL_ACLASS_INDEX (sym) = LOC_ARG;
+ sym->set_aclass_index (LOC_ARG);
SYMBOL_VALUE (sym) = valu;
SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
SYMBOL_IS_ARGUMENT (sym) = 1;
case 'R':
/* Parameter which is in a register. */
SYMBOL_TYPE (sym) = read_type (&p, objfile);
- SYMBOL_ACLASS_INDEX (sym) = stab_register_index;
+ sym->set_aclass_index (stab_register_index);
SYMBOL_IS_ARGUMENT (sym) = 1;
SYMBOL_VALUE (sym) = valu;
SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
case 'r':
/* Register variable (either global or local). */
SYMBOL_TYPE (sym) = read_type (&p, objfile);
- SYMBOL_ACLASS_INDEX (sym) = stab_register_index;
+ sym->set_aclass_index (stab_register_index);
SYMBOL_VALUE (sym) = valu;
SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
if (within_function)
&& strcmp (prev_sym->linkage_name (),
sym->linkage_name ()) == 0)
{
- SYMBOL_ACLASS_INDEX (prev_sym) = stab_register_index;
+ prev_sym->set_aclass_index (stab_register_index);
/* Use the type from the LOC_REGISTER; that is the type
that is actually in that register. */
SYMBOL_TYPE (prev_sym) = SYMBOL_TYPE (sym);
case 'S':
/* Static symbol at top level of file. */
SYMBOL_TYPE (sym) = read_type (&p, objfile);
- SYMBOL_ACLASS_INDEX (sym) = LOC_STATIC;
+ sym->set_aclass_index (LOC_STATIC);
SET_SYMBOL_VALUE_ADDRESS (sym, valu);
SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
add_symbol_to_list (sym, get_file_symbols ());
if (nameless)
return NULL;
- SYMBOL_ACLASS_INDEX (sym) = LOC_TYPEDEF;
+ sym->set_aclass_index (LOC_TYPEDEF);
SYMBOL_VALUE (sym) = valu;
SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
/* C++ vagaries: we may have a type which is derived from
struct symbol *struct_sym = new (&objfile->objfile_obstack) symbol;
*struct_sym = *sym;
- SYMBOL_ACLASS_INDEX (struct_sym) = LOC_TYPEDEF;
+ struct_sym->set_aclass_index (LOC_TYPEDEF);
SYMBOL_VALUE (struct_sym) = valu;
SYMBOL_DOMAIN (struct_sym) = STRUCT_DOMAIN;
if (SYMBOL_TYPE (sym)->name () == 0)
if (nameless)
return NULL;
- SYMBOL_ACLASS_INDEX (sym) = LOC_TYPEDEF;
+ sym->set_aclass_index (LOC_TYPEDEF);
SYMBOL_VALUE (sym) = valu;
SYMBOL_DOMAIN (sym) = STRUCT_DOMAIN;
if (SYMBOL_TYPE (sym)->name () == 0)
struct symbol *typedef_sym = new (&objfile->objfile_obstack) symbol;
*typedef_sym = *sym;
- SYMBOL_ACLASS_INDEX (typedef_sym) = LOC_TYPEDEF;
+ typedef_sym->set_aclass_index (LOC_TYPEDEF);
SYMBOL_VALUE (typedef_sym) = valu;
SYMBOL_DOMAIN (typedef_sym) = VAR_DOMAIN;
if (SYMBOL_TYPE (sym)->name () == 0)
case 'V':
/* Static symbol of local scope. */
SYMBOL_TYPE (sym) = read_type (&p, objfile);
- SYMBOL_ACLASS_INDEX (sym) = LOC_STATIC;
+ sym->set_aclass_index (LOC_STATIC);
SET_SYMBOL_VALUE_ADDRESS (sym, valu);
SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
add_symbol_to_list (sym, get_local_symbols ());
case 'v':
/* Reference parameter */
SYMBOL_TYPE (sym) = read_type (&p, objfile);
- SYMBOL_ACLASS_INDEX (sym) = LOC_REF_ARG;
+ sym->set_aclass_index (LOC_REF_ARG);
SYMBOL_IS_ARGUMENT (sym) = 1;
SYMBOL_VALUE (sym) = valu;
SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
case 'a':
/* Reference parameter which is in a register. */
SYMBOL_TYPE (sym) = read_type (&p, objfile);
- SYMBOL_ACLASS_INDEX (sym) = stab_regparm_index;
+ sym->set_aclass_index (stab_regparm_index);
SYMBOL_IS_ARGUMENT (sym) = 1;
SYMBOL_VALUE (sym) = valu;
SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
that Pascal uses it too, but when I tried it Pascal used
"x:3" (local symbol) instead. */
SYMBOL_TYPE (sym) = read_type (&p, objfile);
- SYMBOL_ACLASS_INDEX (sym) = LOC_LOCAL;
+ sym->set_aclass_index (LOC_LOCAL);
SYMBOL_VALUE (sym) = valu;
SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
add_symbol_to_list (sym, get_local_symbols ());
default:
SYMBOL_TYPE (sym) = error_type (&p, objfile);
- SYMBOL_ACLASS_INDEX (sym) = LOC_CONST;
+ sym->set_aclass_index (LOC_CONST);
SYMBOL_VALUE (sym) = 0;
SYMBOL_DOMAIN (sym) = 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 (SYMBOL_CLASS (sym) == LOC_REGISTER)
- SYMBOL_ACLASS_INDEX (sym) = LOC_REGPARM_ADDR;
+ 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)
- SYMBOL_ACLASS_INDEX (sym) = LOC_REF_ARG;
+ sym->set_aclass_index (LOC_REF_ARG);
}
return sym;
sym->set_linkage_name (name);
sym->set_language (get_current_subfile ()->language,
&objfile->objfile_obstack);
- SYMBOL_ACLASS_INDEX (sym) = LOC_CONST;
+ sym->set_aclass_index (LOC_CONST);
SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
SYMBOL_VALUE (sym) = 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);
- SYMBOL_ACLASS_INDEX (sym) = LOC_BLOCK;
+ sym->set_aclass_index (LOC_BLOCK);
/* Now we copy all the symbols which have been defined since the BCOMM. */
/* Complain about unresolved common block symbols. */
if (SYMBOL_CLASS (prev) == LOC_STATIC)
- SYMBOL_ACLASS_INDEX (prev) = LOC_UNRESOLVED;
+ prev->set_aclass_index (LOC_UNRESOLVED);
else
complaint (_("%s: common block `%s' from "
"global_sym_chain unresolved"),
symbol ()
/* Class-initialization of bitfields is only allowed in C++20. */
: domain (UNDEF_DOMAIN),
- aclass_index (0),
+ m_aclass_index (0),
is_objfile_owned (1),
is_argument (0),
is_inlined (0),
symbol (const symbol &) = default;
symbol &operator= (const symbol &) = default;
+ unsigned int aclass_index () const
+ {
+ return m_aclass_index;
+ }
+
+ void set_aclass_index (unsigned int aclass_index)
+ {
+ m_aclass_index = aclass_index;
+ }
+
/* Data type of value */
struct type *type = nullptr;
table. The actual enum address_class value is stored there,
alongside any per-class ops vectors. */
- unsigned int aclass_index : SYMBOL_ACLASS_BITS;
+ unsigned int m_aclass_index : SYMBOL_ACLASS_BITS;
/* If non-zero then symbol is objfile-owned, use owner.symtab.
Otherwise symbol is arch-owned, use owner.arch. */
"private". */
#define SYMBOL_DOMAIN(symbol) (symbol)->domain
-#define SYMBOL_IMPL(symbol) (symbol_impls[(symbol)->aclass_index])
-#define SYMBOL_ACLASS_INDEX(symbol) (symbol)->aclass_index
+#define SYMBOL_IMPL(symbol) (symbol_impls[(symbol)->aclass_index ()])
#define SYMBOL_CLASS(symbol) (SYMBOL_IMPL (symbol).aclass)
#define SYMBOL_OBJFILE_OWNED(symbol) ((symbol)->is_objfile_owned)
#define SYMBOL_IS_ARGUMENT(symbol) (symbol)->is_argument
sym->set_linkage_name (SYMNAME_ALLOC (name, symname_alloced));
SYMBOL_TYPE (sym) = objfile_type (objfile)->nodebug_text_symbol;
- SYMBOL_ACLASS_INDEX (sym) = LOC_BLOCK;
+ sym->set_aclass_index (LOC_BLOCK);
sym2 = new (&objfile->objfile_obstack) symbol (*sym);
if (cs->c_sclass == C_EXT || C_WEAKEXT)