Replace symbol_arch with symbol::arch
This turns symbol_arch into a method on symbol.
This commit is contained in:
parent
e19b2d9465
commit
bcd6845e2b
7 changed files with 13 additions and 13 deletions
|
@ -60,7 +60,7 @@ struct gdbarch *
|
||||||
block_gdbarch (const struct block *block)
|
block_gdbarch (const struct block *block)
|
||||||
{
|
{
|
||||||
if (BLOCK_FUNCTION (block) != NULL)
|
if (BLOCK_FUNCTION (block) != NULL)
|
||||||
return symbol_arch (BLOCK_FUNCTION (block));
|
return BLOCK_FUNCTION (block)->arch ();
|
||||||
|
|
||||||
return block_objfile (block)->arch ();
|
return block_objfile (block)->arch ();
|
||||||
}
|
}
|
||||||
|
|
|
@ -753,7 +753,7 @@ language_defn::read_var_value (struct symbol *var,
|
||||||
lookup_data.name = var->linkage_name ();
|
lookup_data.name = var->linkage_name ();
|
||||||
|
|
||||||
gdbarch_iterate_over_objfiles_in_search_order
|
gdbarch_iterate_over_objfiles_in_search_order
|
||||||
(symbol_arch (var),
|
(var->arch (),
|
||||||
minsym_lookup_iterator_cb, &lookup_data,
|
minsym_lookup_iterator_cb, &lookup_data,
|
||||||
var->objfile ());
|
var->objfile ());
|
||||||
msym = lookup_data.result.minsym;
|
msym = lookup_data.result.minsym;
|
||||||
|
|
|
@ -115,7 +115,7 @@ syscm_get_symbol_map (struct symbol *symbol)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
struct gdbarch *gdbarch = symbol_arch (symbol);
|
struct gdbarch *gdbarch = symbol->arch ();
|
||||||
struct syscm_gdbarch_data *data
|
struct syscm_gdbarch_data *data
|
||||||
= (struct syscm_gdbarch_data *) gdbarch_data (gdbarch,
|
= (struct syscm_gdbarch_data *) gdbarch_data (gdbarch,
|
||||||
syscm_gdbarch_data_key);
|
syscm_gdbarch_data_key);
|
||||||
|
|
|
@ -1684,7 +1684,7 @@ info_address_command (const char *exp, int from_tty)
|
||||||
section = sym->obj_section (sym->objfile ());
|
section = sym->obj_section (sym->objfile ());
|
||||||
else
|
else
|
||||||
section = NULL;
|
section = NULL;
|
||||||
gdbarch = symbol_arch (sym);
|
gdbarch = sym->arch ();
|
||||||
|
|
||||||
if (SYMBOL_COMPUTED_OPS (sym) != NULL)
|
if (SYMBOL_COMPUTED_OPS (sym) != NULL)
|
||||||
{
|
{
|
||||||
|
|
|
@ -6602,11 +6602,11 @@ symbol::objfile () const
|
||||||
/* See symtab.h. */
|
/* See symtab.h. */
|
||||||
|
|
||||||
struct gdbarch *
|
struct gdbarch *
|
||||||
symbol_arch (const struct symbol *symbol)
|
symbol::arch () const
|
||||||
{
|
{
|
||||||
if (!symbol->is_objfile_owned ())
|
if (!is_objfile_owned ())
|
||||||
return symbol->owner.arch;
|
return owner.arch;
|
||||||
return symbol->owner.symtab->compunit ()->objfile ()->arch ();
|
return owner.symtab->compunit ()->objfile ()->arch ();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* See symtab.h. */
|
/* See symtab.h. */
|
||||||
|
|
|
@ -1382,6 +1382,10 @@ struct symbol : public general_symbol_info, public allocate_on_obstack
|
||||||
|
|
||||||
struct objfile *objfile () const;
|
struct objfile *objfile () const;
|
||||||
|
|
||||||
|
/* Return the ARCH of this symbol. */
|
||||||
|
|
||||||
|
struct gdbarch *arch () const;
|
||||||
|
|
||||||
/* Data type of value */
|
/* Data type of value */
|
||||||
|
|
||||||
struct type *m_type = nullptr;
|
struct type *m_type = nullptr;
|
||||||
|
@ -1498,10 +1502,6 @@ extern int register_symbol_block_impl (enum address_class aclass,
|
||||||
extern int register_symbol_register_impl (enum address_class,
|
extern int register_symbol_register_impl (enum address_class,
|
||||||
const struct symbol_register_ops *);
|
const struct symbol_register_ops *);
|
||||||
|
|
||||||
/* Return the ARCH of SYMBOL. */
|
|
||||||
|
|
||||||
extern struct gdbarch *symbol_arch (const struct symbol *symbol);
|
|
||||||
|
|
||||||
/* Return the SYMTAB of SYMBOL.
|
/* Return the SYMTAB of SYMBOL.
|
||||||
It is an error to call this if symbol.is_objfile_owned is false, which
|
It is an error to call this if symbol.is_objfile_owned is false, which
|
||||||
only happens for architecture-provided types. */
|
only happens for architecture-provided types. */
|
||||||
|
|
|
@ -2506,7 +2506,7 @@ info_scope_command (const char *args_in, int from_tty)
|
||||||
if (symname == NULL || *symname == '\0')
|
if (symname == NULL || *symname == '\0')
|
||||||
continue; /* Probably botched, certainly useless. */
|
continue; /* Probably botched, certainly useless. */
|
||||||
|
|
||||||
gdbarch = symbol_arch (sym);
|
gdbarch = sym->arch ();
|
||||||
|
|
||||||
gdb_printf ("Symbol %s is ", symname);
|
gdb_printf ("Symbol %s is ", symname);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue