This turns symbol_objfile into a method on symbol.
const struct global_block *global_block;
if (BLOCK_FUNCTION (block) != NULL)
- return symbol_objfile (BLOCK_FUNCTION (block));
+ return BLOCK_FUNCTION (block)->objfile ();
global_block = (struct global_block *) block_global_block (block);
return global_block->compunit_symtab->objfile ();
static inline bool
check_objfile (struct symbol *sym, struct objfile *objfile)
{
- return check_objfile (symbol_objfile (sym), objfile);
+ return check_objfile (sym->objfile (), objfile);
}
static inline bool
v = allocate_value (type);
if (overlay_debugging)
{
- struct objfile *var_objfile = symbol_objfile (var);
+ struct objfile *var_objfile = var->objfile ();
addr = symbol_overlayed_address (var->value_address (),
var->obj_section (var_objfile));
store_typed_address (value_contents_raw (v).data (), type, addr);
if (overlay_debugging)
addr
= symbol_overlayed_address (var->value_address (),
- var->obj_section (symbol_objfile (var)));
+ var->obj_section (var->objfile ()));
else
addr = var->value_address ();
break;
if (overlay_debugging)
addr = symbol_overlayed_address
(BLOCK_ENTRY_PC (var->value_block ()),
- var->obj_section (symbol_objfile (var)));
+ var->obj_section (var->objfile ()));
else
addr = BLOCK_ENTRY_PC (var->value_block ());
break;
gdbarch_iterate_over_objfiles_in_search_order
(symbol_arch (var),
minsym_lookup_iterator_cb, &lookup_data,
- symbol_objfile (var));
+ var->objfile ());
msym = lookup_data.result.minsym;
/* If we can't find the minsym there's a problem in the symbol info.
if (msym == NULL)
{
const char *flavour_name
- = objfile_flavour_name (symbol_objfile (var));
+ = objfile_flavour_name (var->objfile ());
/* We can't get here unless we've opened the file, so flavour_name
can't be NULL. */
if (block != NULL)
{
return bkscm_scm_from_block
- (block, symbol_objfile (BLOCK_FUNCTION (fn_block)));
+ (block, BLOCK_FUNCTION (fn_block)->objfile ());
}
return SCM_BOOL_F;
if (symbol->is_objfile_owned ())
{
- struct objfile *objfile = symbol_objfile (symbol);
+ struct objfile *objfile = symbol->objfile ();
htab = (htab_t) objfile_data (objfile, syscm_objfile_data_key);
if (htab == NULL)
struct obj_section *section;
fixup_symbol_section (sfn, 0);
- section = sfn->obj_section (symbol_objfile (sfn));
+ section = sfn->obj_section (sfn->objfile ());
if (section_is_overlay (section)
&& !section_is_mapped (section))
{
gdb_printf ("\" is ");
val = sym->value_longest ();
if (sym->is_objfile_owned ())
- section = sym->obj_section (symbol_objfile (sym));
+ section = sym->obj_section (sym->objfile ());
else
section = NULL;
gdbarch = symbol_arch (sym);
if (block)
{
return block_to_block_object
- (block, symbol_objfile (BLOCK_FUNCTION (fn_block)));
+ (block, BLOCK_FUNCTION (fn_block)->objfile ());
}
Py_RETURN_NONE;
if (symbol->is_objfile_owned ()
&& symbol_symtab (symbol) != NULL)
{
- struct objfile *objfile = symbol_objfile (symbol);
+ struct objfile *objfile = symbol->objfile ();
obj->next = ((symbol_object *)
objfile_data (objfile, sympy_objfile_data_key));
&& sym_obj->symbol->is_objfile_owned ()
&& symbol_symtab (sym_obj->symbol) != NULL)
{
- set_objfile_data (symbol_objfile (sym_obj->symbol),
+ set_objfile_data (sym_obj->symbol->objfile (),
sympy_objfile_data_key, sym_obj->next);
}
if (sym_obj->next)
struct obj_section *section;
if (symbol->is_objfile_owned ())
- section = symbol->obj_section (symbol_objfile (symbol));
+ section = symbol->obj_section (symbol->objfile ());
else
section = NULL;
gdb_assert (objfile || symbol_symtab (sym));
if (objfile == NULL)
- objfile = symbol_objfile (sym);
+ objfile = sym->objfile ();
if (sym->obj_section (objfile) != nullptr)
return sym;
fixup_symbol_section (sym, NULL);
symtab_and_line sal
= find_function_start_sal_1 (BLOCK_ENTRY_PC (sym->value_block ()),
- sym->obj_section (symbol_objfile (sym)),
+ sym->obj_section (sym->objfile ()),
funfirstline);
sal.symbol = sym;
return sal;
{
fixup_symbol_section (sym, NULL);
- objfile = symbol_objfile (sym);
+ objfile = sym->objfile ();
pc = BLOCK_ENTRY_PC (sym->value_block ());
section = sym->obj_section (objfile);
name = sym->linkage_name ();
lookup_name_info lookup_name (sym->search_name (),
symbol_name_match_type::SEARCH_NAME);
- struct objfile *objfile = symbol_objfile (sym);
+ struct objfile *objfile = sym->objfile ();
CORE_ADDR address = BLOCK_ENTRY_PC (sym->value_block ());
minimal_symbol *ifunc = NULL;
/* See symtab.h. */
struct objfile *
-symbol_objfile (const struct symbol *symbol)
+symbol::objfile () const
{
- gdb_assert (symbol->is_objfile_owned ());
- return symbol->owner.symtab->compunit ()->objfile ();
+ gdb_assert (is_objfile_owned ());
+ return owner.symtab->compunit ()->objfile ();
}
/* See symtab.h. */
m_artificial = artificial;
}
+ /* Return the OBJFILE of this symbol. It is an error to call this
+ if is_objfile_owned is false, which only happens for
+ architecture-provided types. */
+
+ struct objfile *objfile () 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 OBJFILE of SYMBOL.
- It is an error to call this if symbol.is_objfile_owned is false, which
- only happens for architecture-provided types. */
-
-extern struct objfile *symbol_objfile (const struct symbol *symbol);
-
/* Return the ARCH of SYMBOL. */
extern struct gdbarch *symbol_arch (const struct symbol *symbol);
}
if (objf_p)
- *objf_p = symbol_objfile (sym.symbol);
+ *objf_p = sym.symbol->objfile ();
return value_of_variable (sym.symbol, sym.block);
}