psymtab that contains a symbol whose address is closest to PC. */
static struct partial_symtab *
-find_pc_sect_psymtab (struct objfile *objfile, CORE_ADDR pc,
+find_pc_sect_psymtab (struct objfile *objfile,
+ psymtab_storage *partial_symtabs,
+ CORE_ADDR pc,
struct obj_section *section,
struct bound_minimal_symbol msymbol)
{
partial symtabs then we will end up returning a pointer to an object
that is not a partial_symtab, which doesn't end well. */
- if (objfile->partial_symtabs->psymtabs != NULL
- && objfile->partial_symtabs->psymtabs_addrmap != NULL)
+ if (partial_symtabs->psymtabs != NULL
+ && partial_symtabs->psymtabs_addrmap != NULL)
{
CORE_ADDR baseaddr = objfile->text_section_offset ();
struct partial_symtab *pst
= ((struct partial_symtab *)
- addrmap_find (objfile->partial_symtabs->psymtabs_addrmap,
+ addrmap_find (partial_symtabs->psymtabs_addrmap,
pc - baseaddr));
if (pst != NULL)
{
struct obj_section *section,
int warn_if_readin)
{
- struct partial_symtab *ps = find_pc_sect_psymtab (objfile, pc, section,
+ struct partial_symtab *ps = find_pc_sect_psymtab (objfile,
+ m_partial_symtabs.get (),
+ pc, section,
msymbol);
if (ps != NULL)
{
printf_filtered (_(" Number of psym tables (not yet expanded): %d\n"),
i);
printf_filtered (_(" Total memory used for psymbol cache: %d\n"),
- objfile->partial_symtabs->psymbol_cache.memory_used ());
+ m_partial_symtabs->psymbol_cache.memory_used ());
}
else
{
printf_filtered (_("Psymbol byte cache statistics:\n"));
- objfile->partial_symtabs->psymbol_cache.print_statistics
+ m_partial_symtabs->psymbol_cache.print_statistics
("partial symbol cache");
}
}
{
struct partial_symtab *psymtab;
- if (objfile->partial_symtabs->psymtabs)
+ if (m_partial_symtabs->psymtabs)
{
printf_filtered ("Psymtabs:\n");
- for (psymtab = objfile->partial_symtabs->psymtabs;
+ for (psymtab = m_partial_symtabs->psymtabs;
psymtab != NULL;
psymtab = psymtab->next)
{
for (partial_symtab *ps : require_partial_symbols (objfile, true))
ps->searched_flag = PST_NOT_SEARCHED;
- for (partial_symtab *ps : objfile->psymtabs ())
+ for (partial_symtab *ps : m_partial_symtabs->range ())
{
QUIT;
bool
psymbol_functions::has_symbols (struct objfile *objfile)
{
- return objfile->partial_symtabs->psymtabs != NULL;
+ return m_partial_symtabs->psymtabs != NULL;
}
/* Helper function for psym_find_compunit_symtab_by_address that fills
}
quick_symbol_functions_up
-make_psymbol_functions ()
+make_psymbol_functions (const std::shared_ptr<psymtab_storage> &storage)
{
- return quick_symbol_functions_up (new psymbol_functions);
+ return quick_symbol_functions_up (new psymbol_functions (storage));
}
\f
of PSYMTAB. If PSYMTAB is NULL print the entire addrmap. */
static void
-dump_psymtab_addrmap (struct objfile *objfile, struct partial_symtab *psymtab,
+dump_psymtab_addrmap (struct objfile *objfile,
+ psymtab_storage *partial_symtabs,
+ struct partial_symtab *psymtab,
struct ui_file *outfile)
{
struct dump_psymtab_addrmap_data addrmap_dump_data;
if ((psymtab == NULL
|| psymtab->psymtabs_addrmap_supported)
- && objfile->partial_symtabs->psymtabs_addrmap != NULL)
+ && partial_symtabs->psymtabs_addrmap != NULL)
{
addrmap_dump_data.objfile = objfile;
addrmap_dump_data.psymtab = psymtab;
addrmap_dump_data.previous_matched = 0;
fprintf_filtered (outfile, "%sddress map:\n",
psymtab == NULL ? "Entire a" : " A");
- addrmap_foreach (objfile->partial_symtabs->psymtabs_addrmap,
+ addrmap_foreach (partial_symtabs->psymtabs_addrmap,
dump_psymtab_addrmap_1, &addrmap_dump_data);
}
}
if (!print_for_objfile)
continue;
+ psymtab_storage *partial_symtabs = objfile->partial_symtabs.get ();
+
if (address_arg != NULL)
{
struct bound_minimal_symbol msymbol = { NULL, NULL };
/* We don't assume each pc has a unique objfile (this is for
debugging). */
- struct partial_symtab *ps = find_pc_sect_psymtab (objfile, pc,
- section, msymbol);
+ struct partial_symtab *ps
+ = find_pc_sect_psymtab (objfile, partial_symtabs, pc,
+ section, msymbol);
if (ps != NULL)
{
if (!printed_objfile_header)
printed_objfile_header = 1;
}
dump_psymtab (objfile, ps, outfile);
- dump_psymtab_addrmap (objfile, ps, outfile);
+ dump_psymtab_addrmap (objfile, partial_symtabs, ps, outfile);
found = 1;
}
}
printed_objfile_header = 1;
}
dump_psymtab (objfile, ps, outfile);
- dump_psymtab_addrmap (objfile, ps, outfile);
+ dump_psymtab_addrmap (objfile, partial_symtabs, ps,
+ outfile);
}
}
}
&& objfile->partial_symtabs->psymtabs_addrmap != NULL)
{
outfile->puts ("\n");
- dump_psymtab_addrmap (objfile, NULL, outfile);
+ dump_psymtab_addrmap (objfile, partial_symtabs, NULL, outfile);
}
}