This turns symbol_arch into a method on symbol.
block_gdbarch (const struct block *block)
{
if (BLOCK_FUNCTION (block) != NULL)
- return symbol_arch (BLOCK_FUNCTION (block));
+ return BLOCK_FUNCTION (block)->arch ();
return block_objfile (block)->arch ();
}
lookup_data.name = var->linkage_name ();
gdbarch_iterate_over_objfiles_in_search_order
- (symbol_arch (var),
+ (var->arch (),
minsym_lookup_iterator_cb, &lookup_data,
var->objfile ());
msym = lookup_data.result.minsym;
}
else
{
- struct gdbarch *gdbarch = symbol_arch (symbol);
+ struct gdbarch *gdbarch = symbol->arch ();
struct syscm_gdbarch_data *data
= (struct syscm_gdbarch_data *) gdbarch_data (gdbarch,
syscm_gdbarch_data_key);
section = sym->obj_section (sym->objfile ());
else
section = NULL;
- gdbarch = symbol_arch (sym);
+ gdbarch = sym->arch ();
if (SYMBOL_COMPUTED_OPS (sym) != NULL)
{
/* See symtab.h. */
struct gdbarch *
-symbol_arch (const struct symbol *symbol)
+symbol::arch () const
{
- if (!symbol->is_objfile_owned ())
- return symbol->owner.arch;
- return symbol->owner.symtab->compunit ()->objfile ()->arch ();
+ if (!is_objfile_owned ())
+ return owner.arch;
+ return owner.symtab->compunit ()->objfile ()->arch ();
}
/* See symtab.h. */
struct objfile *objfile () const;
+ /* Return the ARCH of this symbol. */
+
+ struct gdbarch *arch () const;
+
/* Data type of value */
struct type *m_type = nullptr;
extern int register_symbol_register_impl (enum address_class,
const struct symbol_register_ops *);
-/* Return the ARCH of SYMBOL. */
-
-extern struct gdbarch *symbol_arch (const struct symbol *symbol);
-
/* Return the SYMTAB of SYMBOL.
It is an error to call this if symbol.is_objfile_owned is false, which
only happens for architecture-provided types. */
if (symname == NULL || *symname == '\0')
continue; /* Probably botched, certainly useless. */
- gdbarch = symbol_arch (sym);
+ gdbarch = sym->arch ();
gdb_printf ("Symbol %s is ", symname);