{
struct objfile *objfile = nullptr;
if (block != nullptr)
- objfile = block_objfile (block);
+ objfile = block->objfile ();
struct bound_minimal_symbol msym
= ada_lookup_simple_minsym (decoded_name.c_str (), objfile);
/* See block.h. */
struct objfile *
-block_objfile (const struct block *block)
+block::objfile () const
{
const struct global_block *global_block;
- if (block->function () != nullptr)
- return block->function ()->objfile ();
+ if (function () != nullptr)
+ return function ()->objfile ();
- global_block = (struct global_block *) block_global_block (block);
+ global_block = (struct global_block *) block_global_block (this);
return global_block->compunit_symtab->objfile ();
}
if (block->function () != nullptr)
return block->function ()->arch ();
- return block_objfile (block)->arch ();
+ return block->objfile ()->arch ();
}
/* See block.h. */
struct dynamic_prop *
block_static_link (const struct block *block)
{
- struct objfile *objfile = block_objfile (block);
+ struct objfile *objfile = block->objfile ();
/* Only objfile-owned blocks that materialize top function scopes can have
static links. */
return this->ranges ()[0].start ();
}
+ /* Return the objfile of this block. */
+
+ struct objfile *objfile () const;
+
/* Addresses in the executable code that are in this block. */
CORE_ADDR m_start;
struct block *m_blocks[1];
};
-/* Return the objfile of BLOCK, which must be non-NULL. */
-
-extern struct objfile *block_objfile (const struct block *block);
-
/* Return the architecture of BLOCK, which must be non-NULL. */
extern struct gdbarch *block_gdbarch (const struct block *block);
symbols which match. */
const block *block = get_selected_block (0);
- struct objfile *current_objfile = block ? block_objfile (block) : nullptr;
+ struct objfile *current_objfile = block ? block->objfile () : nullptr;
gdbarch_iterate_over_objfiles_in_search_order
(current_objfile ? current_objfile->arch () : target_gdbarch (),
bool
check_objfile (const struct block *block, struct objfile *objfile)
{
- return check_objfile (block_objfile (block), objfile);
+ return check_objfile (block->objfile (), objfile);
}
void
struct objfile *bl_objf = nullptr;
if (d->block != nullptr)
{
- bl_objf = block_objfile (d->block);
+ bl_objf = d->block->objfile ();
if (bl_objf->separate_debug_objfile_backlink != nullptr)
bl_objf = bl_objf->separate_debug_objfile_backlink;
}
symbol_lookup_debug_printf_v ("lookup_language_this (%s, %s (objfile %s))",
lang->name (), host_address_to_string (block),
- objfile_debug_name (block_objfile (block)));
+ objfile_debug_name (block->objfile ()));
while (block)
{
if (symbol_lookup_debug)
{
struct objfile *objfile = (block == nullptr
- ? nullptr : block_objfile (block));
+ ? nullptr : block->objfile ());
symbol_lookup_debug_printf
("demangled symbol name = \"%s\", block @ %s (objfile %s)",
if (symbol_lookup_debug)
{
struct objfile *objfile
- = block == nullptr ? nullptr : block_objfile (block);
+ = block == nullptr ? nullptr : block->objfile ();
symbol_lookup_debug_printf_v
("lookup_symbol_in_block (%s, %s (objfile %s), %s)",
if (symbol_lookup_debug)
{
struct objfile *objfile = (block == nullptr
- ? nullptr : block_objfile (block));
+ ? nullptr : block->objfile ());
symbol_lookup_debug_printf
("lookup_symbol_in_static_block (%s, %s (objfile %s), %s)",
struct objfile *objfile = nullptr;
if (block != nullptr)
{
- objfile = block_objfile (block);
+ objfile = block->objfile ();
if (objfile->separate_debug_objfile_backlink != nullptr)
objfile = objfile->separate_debug_objfile_backlink;
}
{
if (var->root->valid_block != nullptr)
{
- struct objfile *bl_objfile = block_objfile (var->root->valid_block);
+ struct objfile *bl_objfile = var->root->valid_block->objfile ();
if (bl_objfile->separate_debug_objfile_backlink != nullptr)
bl_objfile = bl_objfile->separate_debug_objfile_backlink;