re_comp (known_runtime_file_name_patterns[i]);
if (re_exec (lbasename (sal.symtab->filename)))
return 1;
- if (sal.symtab->objfile () != NULL
- && re_exec (objfile_name (sal.symtab->objfile ())))
+ if (sal.symtab->compunit ()->objfile () != NULL
+ && re_exec (objfile_name (sal.symtab->compunit ()->objfile ())))
return 1;
}
return false;
annotate_source (s->fullname, line, (int) (*offsets)[line - 1],
- mid_statement, s->objfile ()->arch (),
+ mid_statement, s->compunit ()->objfile ()->arch (),
pc);
/* Update the current symtab and line. */
if (sal.section)
return sal.section->objfile->arch ();
if (sal.symtab)
- return sal.symtab->objfile ()->arch ();
+ return sal.symtab->compunit ()->objfile ()->arch ();
return NULL;
}
sym = block_linkage_function (b);
if (sym != NULL)
{
- fixup_symbol_section (sym, sal->symtab->objfile ());
- sal->section = sym->obj_section (sal->symtab->objfile ());
+ fixup_symbol_section (sym, sal->symtab->compunit ()->objfile ());
+ sal->section
+ = sym->obj_section (sal->symtab->compunit ()->objfile ());
}
else
{
breakpoint_free_objfile (struct objfile *objfile)
{
for (bp_location *loc : all_bp_locations ())
- if (loc->symtab != NULL && loc->symtab->objfile () == objfile)
+ if (loc->symtab != NULL && loc->symtab->compunit ()->objfile () == objfile)
loc->symtab = NULL;
}
error (_("No source file for address %s."),
paddress (get_current_arch (), sal.pc));
- gdbarch = sal.symtab->objfile ()->arch ();
+ gdbarch = sal.symtab->compunit ()->objfile ()->arch ();
sym = find_pc_function (sal.pc);
if (sym)
gdb_printf ("%s is in %s (%s:%d).\n",
error (_("No source file for address %s."),
paddress (get_current_arch (), sal.pc));
- gdbarch = sal.symtab->objfile ()->arch ();
+ gdbarch = sal.symtab->compunit ()->objfile ()->arch ();
sym = find_pc_function (sal.pc);
if (sym)
gdb_printf ("%s is in %s (%s:%d).\n",
static htab_t
stscm_objfile_symtab_map (struct symtab *symtab)
{
- struct objfile *objfile = symtab->objfile ();
+ struct objfile *objfile = symtab->compunit ()->objfile ();
htab_t htab = (htab_t) objfile_data (objfile, stscm_objfile_data_key);
if (htab == NULL)
= stscm_get_valid_symtab_smob_arg_unsafe (self, SCM_ARG1, FUNC_NAME);
const struct symtab *symtab = st_smob->symtab;
- return ofscm_scm_from_objfile (symtab->objfile ());
+ return ofscm_scm_from_objfile (symtab->compunit ()->objfile ());
}
/* (symtab-global-block <gdb:symtab>) -> <gdb:block>
blockvector = symtab->compunit ()->blockvector ();
block = BLOCKVECTOR_BLOCK (blockvector, GLOBAL_BLOCK);
- return bkscm_scm_from_block (block, symtab->objfile ());
+ return bkscm_scm_from_block (block, symtab->compunit ()->objfile ());
}
/* (symtab-static-block <gdb:symtab>) -> <gdb:block>
blockvector = symtab->compunit ()->blockvector ();
block = BLOCKVECTOR_BLOCK (blockvector, STATIC_BLOCK);
- return bkscm_scm_from_block (block, symtab->objfile ());
+ return bkscm_scm_from_block (block, symtab->compunit ()->objfile ());
}
\f
/* Administrivia for sal (symtab-and-line) smobs. */
{
set_current_program_space (symtab->pspace ());
iterate_over_minimal_symbols
- (symtab->objfile (), name,
+ (symtab->compunit ()->objfile (), name,
[&] (struct minimal_symbol *msym)
{
- add_minsym (msym, symtab->objfile (), symtab,
+ add_minsym (msym, symtab->compunit ()->objfile (), symtab,
info->state->list_mode, &minsyms);
return false;
});
already sorted by increasing values in the symbol table, so no
need to perform any other sorting. */
- gdbarch = s->objfile ()->arch ();
+ gdbarch = s->compunit ()->objfile ()->arch ();
ui_out_emit_list list_emitter (uiout, "lines");
if (s->linetable () != NULL && s->linetable ()->nitems > 0)
{
struct symtab_and_line cursal = get_current_source_symtab_and_line ();
- if (cursal.symtab && cursal.symtab->objfile () == this)
+ if (cursal.symtab && cursal.symtab->compunit ()->objfile () == this)
clear_current_source_symtab_and_line ();
}
STPY_REQUIRE_VALID (self, symtab);
- return objfile_to_objfile_object (symtab->objfile ()).release ();
+ return objfile_to_objfile_object (symtab->compunit ()->objfile ()).release ();
}
/* Getter function for symtab.producer. */
blockvector = symtab->compunit ()->blockvector ();
block = BLOCKVECTOR_BLOCK (blockvector, GLOBAL_BLOCK);
- return block_to_block_object (block, symtab->objfile ());
+ return block_to_block_object (block, symtab->compunit ()->objfile ());
}
/* Return the STATIC_BLOCK of the underlying symtab. */
blockvector = symtab->compunit ()->blockvector ();
block = BLOCKVECTOR_BLOCK (blockvector, STATIC_BLOCK);
- return block_to_block_object (block, symtab->objfile ());
+ return block_to_block_object (block, symtab->compunit ()->objfile ());
}
/* Implementation of gdb.Symtab.linetable (self) -> gdb.LineTable.
symtab->prev->next = symtab->next;
else if (symtab->symtab)
{
- set_objfile_data (symtab->symtab->objfile (),
+ set_objfile_data (symtab->symtab->compunit ()->objfile (),
stpy_objfile_data_key, symtab->next);
}
if (symtab->next)
self_sal->prev->next = self_sal->next;
else if (self_sal->symtab != Py_None)
set_objfile_data
- (symtab_object_to_symtab (self_sal->symtab)->objfile (),
+ (symtab_object_to_symtab (self_sal->symtab)->compunit ()->objfile (),
salpy_objfile_data_key, self_sal->next);
if (self_sal->next)
symtab *symtab = symtab_object_to_symtab (sal_obj->symtab);
sal_obj->next
- = ((sal_object *) objfile_data (symtab->objfile (),
+ = ((sal_object *) objfile_data (symtab->compunit ()->objfile (),
salpy_objfile_data_key));
if (sal_obj->next)
sal_obj->next->prev = sal_obj;
- set_objfile_data (symtab->objfile (),
+ set_objfile_data (symtab->compunit ()->objfile (),
salpy_objfile_data_key, sal_obj);
}
else
{
obj->next
= ((symtab_object *)
- objfile_data (symtab->objfile (), stpy_objfile_data_key));
+ objfile_data (symtab->compunit ()->objfile (),
+ stpy_objfile_data_key));
if (obj->next)
obj->next->prev = obj;
- set_objfile_data (symtab->objfile (), stpy_objfile_data_key, obj);
+ set_objfile_data (symtab->compunit ()->objfile (),
+ stpy_objfile_data_key, obj);
}
else
obj->next = NULL;
perror_with_name (symtab_to_filename_for_display (s));
time_t mtime = 0;
- if (s->objfile () != NULL && s->objfile ()->obfd != NULL)
- mtime = s->objfile ()->mtime;
+ if (s->compunit ()->objfile () != NULL
+ && s->compunit ()->objfile ()->obfd != NULL)
+ mtime = s->compunit ()->objfile ()->mtime;
else if (current_program_space->exec_bfd ())
mtime = current_program_space->ebfd_mtime;
else if (sal.line > 0
&& find_line_pc_range (sal, &start_pc, &end_pc))
{
- struct gdbarch *gdbarch = sal.symtab->objfile ()->arch ();
+ gdbarch *gdbarch = sal.symtab->compunit ()->objfile ()->arch ();
if (start_pc == end_pc)
{
gdb_printf ("%s at %s",
symtab_to_filename_for_display (symtab),
host_address_to_string (symtab));
- if (symtab->objfile () != objfile)
+ if (symtab->compunit ()->objfile () != objfile)
gdb_printf (", NOT ON CHAIN!");
gdb_printf ("\n");
}
static void
dump_symtab_1 (struct symtab *symtab, struct ui_file *outfile)
{
- struct objfile *objfile = symtab->objfile ();
+ struct objfile *objfile = symtab->compunit ()->objfile ();
struct gdbarch *gdbarch = objfile->arch ();
int i;
struct mdict_iterator miter;
program_space *
symtab::pspace () const
{
- return this->objfile ()->pspace;
+ return this->compunit ()->objfile ()->pspace;
}
/* See symtab.h. */
&& (sal.symtab->compunit ()->locations_valid ()
|| sal.symtab->language () == language_asm))
{
- struct gdbarch *gdbarch = sal.symtab->objfile ()->arch ();
+ struct gdbarch *gdbarch = sal.symtab->compunit ()->objfile ()->arch ();
sal.pc = func_addr;
if (gdbarch_skip_entrypoint_p (gdbarch))
symbol_objfile (const struct symbol *symbol)
{
gdb_assert (symbol->is_objfile_owned ());
- return symbol->owner.symtab->objfile ();
+ return symbol->owner.symtab->compunit ()->objfile ();
}
/* See symtab.h. */
{
if (!symbol->is_objfile_owned ())
return symbol->owner.arch;
- return symbol->owner.symtab->objfile ()->arch ();
+ return symbol->owner.symtab->compunit ()->objfile ()->arch ();
}
/* See symtab.h. */
m_language = language;
}
- struct objfile *objfile () const;
-
program_space *pspace () const;
/* Unordered chain of all filetabs in the compunit, with the exception
using compunit_symtab_range = next_range<compunit_symtab>;
-inline struct objfile *
-symtab::objfile () const
-{
- return this->compunit ()->objfile ();
-}
-
/* Return the language of CUST. */
extern enum language compunit_language (const struct compunit_symtab *cust);
m_fullname = make_unique_xstrdup (symtab_to_fullname (s));
cur_line = 0;
- m_gdbarch = s->objfile ()->arch ();
+ m_gdbarch = s->compunit ()->objfile ()->arch ();
m_start_line_or_addr.loa = LOA_LINE;
cur_line_no = m_start_line_or_addr.u.line_no = line_no;
if (sal.symtab != nullptr)
{
find_line_pc (sal.symtab, sal.line, &sal.pc);
- gdbarch = sal.symtab->objfile ()->arch ();
+ gdbarch = sal.symtab->compunit ()->objfile ()->arch ();
}
for (struct tui_source_window_base *win_info : tui_source_windows ())