&& SYMBOL_TYPE (syms[i].symbol)->code () == TYPE_CODE_ENUM);
struct symtab *symtab = NULL;
- if (SYMBOL_OBJFILE_OWNED (syms[i].symbol))
+ if (syms[i].symbol->is_objfile_owned ())
symtab = symbol_symtab (syms[i].symbol);
if (SYMBOL_LINE (syms[i].symbol) != 0 && symtab != NULL)
/* Symbols for builtin types don't have a block.
For now don't cache such symbols. */
- if (sym != NULL && !SYMBOL_OBJFILE_OWNED (sym))
+ if (sym != NULL && !sym->is_objfile_owned ())
return;
/* If the symbol is a local symbol, then do not cache it, as a search
{
htab_t htab;
- if (SYMBOL_OBJFILE_OWNED (symbol))
+ if (symbol->is_objfile_owned ())
{
struct objfile *objfile = symbol_objfile (symbol);
= syscm_get_valid_symbol_smob_arg_unsafe (self, SCM_ARG1, FUNC_NAME);
const struct symbol *symbol = s_smob->symbol;
- if (!SYMBOL_OBJFILE_OWNED (symbol))
+ if (!symbol->is_objfile_owned ())
return SCM_BOOL_F;
return stscm_scm_from_symtab (symbol_symtab (symbol));
}
symbol->m_name = type->name ();
symbol->set_language (lang, nullptr);
symbol->owner.arch = gdbarch;
- SYMBOL_OBJFILE_OWNED (symbol) = 0;
+ symbol->set_is_objfile_owned (0);
symbol->set_section_index (0);
SYMBOL_TYPE (symbol) = type;
symbol->set_domain (VAR_DOMAIN);
puts_filtered (sym->print_name ());
printf_filtered ("\" is ");
val = SYMBOL_VALUE (sym);
- if (SYMBOL_OBJFILE_OWNED (sym))
+ if (sym->is_objfile_owned ())
section = sym->obj_section (symbol_objfile (sym));
else
section = NULL;
SYMPY_REQUIRE_VALID (self, symbol);
- if (!SYMBOL_OBJFILE_OWNED (symbol))
+ if (!symbol->is_objfile_owned ())
Py_RETURN_NONE;
return symtab_to_symtab_object (symbol_symtab (symbol));
{
obj->symbol = symbol;
obj->prev = NULL;
- if (SYMBOL_OBJFILE_OWNED (symbol)
+ if (symbol->is_objfile_owned ()
&& symbol_symtab (symbol) != NULL)
{
struct objfile *objfile = symbol_objfile (symbol);
if (sym_obj->prev)
sym_obj->prev->next = sym_obj->next;
else if (sym_obj->symbol != NULL
- && SYMBOL_OBJFILE_OWNED (sym_obj->symbol)
+ && sym_obj->symbol->is_objfile_owned ()
&& symbol_symtab (sym_obj->symbol) != NULL)
{
set_objfile_data (symbol_objfile (sym_obj->symbol),
{
struct obj_section *section;
- if (SYMBOL_OBJFILE_OWNED (symbol))
+ if (symbol->is_objfile_owned ())
section = symbol->obj_section (symbol_objfile (symbol));
else
section = NULL;
if (!sym)
return NULL;
- if (!SYMBOL_OBJFILE_OWNED (sym))
+ if (!sym->is_objfile_owned ())
return sym;
/* We either have an OBJFILE, or we can get at it from the sym's
struct objfile *
symbol_objfile (const struct symbol *symbol)
{
- gdb_assert (SYMBOL_OBJFILE_OWNED (symbol));
+ gdb_assert (symbol->is_objfile_owned ());
return symbol->owner.symtab->objfile ();
}
struct gdbarch *
symbol_arch (const struct symbol *symbol)
{
- if (!SYMBOL_OBJFILE_OWNED (symbol))
+ if (!symbol->is_objfile_owned ())
return symbol->owner.arch;
return symbol->owner.symtab->objfile ()->arch ();
}
struct symtab *
symbol_symtab (const struct symbol *symbol)
{
- gdb_assert (SYMBOL_OBJFILE_OWNED (symbol));
+ gdb_assert (symbol->is_objfile_owned ());
return symbol->owner.symtab;
}
void
symbol_set_symtab (struct symbol *symbol, struct symtab *symtab)
{
- gdb_assert (SYMBOL_OBJFILE_OWNED (symbol));
+ gdb_assert (symbol->is_objfile_owned ());
symbol->owner.symtab = symtab;
}
/* Class-initialization of bitfields is only allowed in C++20. */
: m_domain (UNDEF_DOMAIN),
m_aclass_index (0),
- is_objfile_owned (1),
+ m_is_objfile_owned (1),
is_argument (0),
is_inlined (0),
maybe_copied (0),
m_domain = domain;
}
+ bool is_objfile_owned () const
+ {
+ return m_is_objfile_owned;
+ }
+
+ void set_is_objfile_owned (bool is_objfile_owned)
+ {
+ m_is_objfile_owned = is_objfile_owned;
+ }
+
/* Data type of value */
struct type *type = nullptr;
/* If non-zero then symbol is objfile-owned, use owner.symtab.
Otherwise symbol is arch-owned, use owner.arch. */
- unsigned int is_objfile_owned : 1;
+ unsigned int m_is_objfile_owned : 1;
/* Whether this is an argument. */
/* Note: There is no accessor macro for symbol.owner because it is
"private". */
-#define SYMBOL_OBJFILE_OWNED(symbol) ((symbol)->is_objfile_owned)
#define SYMBOL_IS_ARGUMENT(symbol) (symbol)->is_argument
#define SYMBOL_INLINED(symbol) (symbol)->is_inlined
#define SYMBOL_IS_CPLUS_TEMPLATE_FUNCTION(symbol) \