int, const char *);
static void parse_partial_symbols (minimal_symbol_reader &,
+ psymtab_storage *,
struct objfile *);
static int has_opaque_xref (FDR *, SYMR *);
static void sort_blocks (struct symtab *);
-static legacy_psymtab *new_psymtab (const char *, struct objfile *);
+static legacy_psymtab *new_psymtab (const char *, psymtab_storage *,
+ struct objfile *);
static void mdebug_expand_psymtab (legacy_psymtab *pst,
struct objfile *objfile);
static struct linetable *shrink_linetable (struct linetable *);
-static void handle_psymbol_enumerators (struct objfile *, partial_symtab *,
+static void handle_psymbol_enumerators (struct objfile *, psymtab_storage *,
+ partial_symtab *,
FDR *, int, CORE_ADDR);
static const char *mdebug_next_symbol_text (struct objfile *);
(*swap->swap_fdr_in) (objfile->obfd, fdr_src, fdr_ptr);
}
- parse_partial_symbols (reader, objfile);
+ psymbol_functions *psf = new psymbol_functions ();
+ psymtab_storage *partial_symtabs = psf->get_partial_symtabs ().get ();
+ objfile->qf.emplace_front (psf);
+ parse_partial_symbols (reader, partial_symtabs, objfile);
#if 0
/* Check to make sure file was compiled with -g. If not, warn the
static void
parse_partial_symbols (minimal_symbol_reader &reader,
+ psymtab_storage *partial_symtabs,
struct objfile *objfile)
{
struct gdbarch *gdbarch = objfile->arch ();
fdr_to_pst = fdr_to_pst_holder.data ();
fdr_to_pst++;
{
- legacy_psymtab *new_pst = new_psymtab ("", objfile);
+ legacy_psymtab *new_pst = new_psymtab ("", partial_symtabs, objfile);
fdr_to_pst[-1].pst = new_pst;
FDR_IDX (new_pst) = -1;
textlow = fh->adr;
else
textlow = 0;
- pst = new legacy_psymtab (fdr_name (fh), objfile, textlow);
+ pst = new legacy_psymtab (fdr_name (fh), partial_symtabs,
+ objfile->per_bfd, textlow);
pst->read_symtab_private = XOBNEW (&objfile->objfile_obstack, symloc);
memset (pst->read_symtab_private, 0, sizeof (struct symloc));
SECT_OFF_DATA (objfile),
psymbol_placement::STATIC,
sh.value,
- psymtab_language, objfile);
+ psymtab_language,
+ partial_symtabs, objfile);
continue;
case 'G':
/* The addresses in these entries are reported
SECT_OFF_DATA (objfile),
psymbol_placement::GLOBAL,
sh.value,
- psymtab_language, objfile);
+ psymtab_language,
+ partial_symtabs, objfile);
continue;
case 'T':
(gdb::string_view (namestring, p - namestring),
true, STRUCT_DOMAIN, LOC_TYPEDEF, -1,
psymbol_placement::STATIC, 0, psymtab_language,
- objfile);
+ partial_symtabs, objfile);
if (p[2] == 't')
{
/* Also a typedef with the same name. */
p - namestring),
true, VAR_DOMAIN, LOC_TYPEDEF, -1,
psymbol_placement::STATIC, 0,
- psymtab_language, objfile);
+ psymtab_language,
+ partial_symtabs, objfile);
p += 1;
}
}
p - namestring),
true, VAR_DOMAIN, LOC_TYPEDEF, -1,
psymbol_placement::STATIC, 0, psymtab_language,
- objfile);
+ partial_symtabs, objfile);
}
check_enum:
/* If this is an enumerated type, we need to add
LOC_CONST, -1,
psymbol_placement::STATIC,
0, psymtab_language,
- objfile);
+ partial_symtabs, objfile);
/* Point past the name. */
p = q;
/* Skip over the value. */
p - namestring),
true, VAR_DOMAIN, LOC_CONST, -1,
psymbol_placement::STATIC,
- 0, psymtab_language, objfile);
+ 0, psymtab_language,
+ partial_symtabs, objfile);
continue;
case 'f':
SECT_OFF_TEXT (objfile),
psymbol_placement::STATIC,
sh.value,
- psymtab_language, objfile);
+ psymtab_language,
+ partial_symtabs, objfile);
continue;
/* Global functions were ignored here, but now they
SECT_OFF_TEXT (objfile),
psymbol_placement::GLOBAL,
sh.value,
- psymtab_language, objfile);
+ psymtab_language,
+ partial_symtabs, objfile);
continue;
/* Two things show up here (hopefully); static
VAR_DOMAIN, LOC_BLOCK,
section,
psymbol_placement::GLOBAL,
- sh.value, psymtab_language, objfile);
+ sh.value, psymtab_language,
+ partial_symtabs, objfile);
else
pst->add_psymbol (sym_name, true,
VAR_DOMAIN, LOC_BLOCK,
section,
psymbol_placement::STATIC,
- sh.value, psymtab_language, objfile);
+ sh.value, psymtab_language,
+ partial_symtabs, objfile);
procaddr = sh.value;
pst->add_psymbol (sym_name, true,
STRUCT_DOMAIN, LOC_TYPEDEF, -1,
psymbol_placement::STATIC,
- 0, psymtab_language, objfile);
+ 0, psymtab_language,
+ partial_symtabs, objfile);
}
- handle_psymbol_enumerators (objfile, pst, fh,
- sh.st, sh.value);
+ handle_psymbol_enumerators (objfile, partial_symtabs,
+ pst, fh, sh.st, sh.value);
/* Skip over the block. */
new_sdx = sh.index;
pst->add_psymbol (sym_name, true,
VAR_DOMAIN, theclass, section,
psymbol_placement::STATIC,
- sh.value, psymtab_language, objfile);
+ sh.value, psymtab_language,
+ partial_symtabs, objfile);
skip:
cur_sdx++; /* Go to next file symbol. */
}
VAR_DOMAIN, theclass,
section,
psymbol_placement::GLOBAL,
- svalue, psymtab_language, objfile);
+ svalue, psymtab_language,
+ partial_symtabs, objfile);
}
}
/* Link pst to FDR. dbx_end_psymtab returns NULL if the psymtab was
empty and put on the free list. */
fdr_to_pst[f_idx].pst
- = dbx_end_psymtab (objfile, save_pst,
+ = dbx_end_psymtab (objfile, partial_symtabs, save_pst,
psymtab_include_list, includes_used,
-1, save_pst->raw_text_high (),
dependency_list, dependencies_used,
&& save_pst->text_low_valid
&& !(objfile->flags & OBJF_REORDERED))
{
- for (partial_symtab *iter : objfile->psymtabs ())
+ for (partial_symtab *iter : partial_symtabs->range ())
{
if (save_pst != iter
&& save_pst->raw_text_low () >= iter->raw_text_low ()
source files or a reverse .h -> .c dependency for header files. */
pst->number_of_dependencies = 0;
pst->dependencies
- = objfile->partial_symtabs->allocate_dependencies (fh->crfd - 1);
+ = partial_symtabs->allocate_dependencies (fh->crfd - 1);
for (s_idx = 1; s_idx < fh->crfd; s_idx++)
{
RFDT rh;
/* Remove the dummy psymtab created for -O3 images above, if it is
still empty, to enable the detection of stripped executables. */
- partial_symtab *pst_del = objfile->partial_symtabs->psymtabs;
+ partial_symtab *pst_del = partial_symtabs->psymtabs;
if (pst_del->next == NULL
&& pst_del->number_of_dependencies == 0
&& pst_del->empty ())
- objfile->partial_symtabs->discard_psymtab (pst_del);
+ partial_symtabs->discard_psymtab (pst_del);
}
/* If the current psymbol has an enumerated type, we need to add
all the enum constants to the partial symbol table. */
static void
-handle_psymbol_enumerators (struct objfile *objfile, partial_symtab *pst,
+handle_psymbol_enumerators (struct objfile *objfile,
+ psymtab_storage *partial_symtabs,
+ partial_symtab *pst,
FDR *fh, int stype, CORE_ADDR svalue)
{
const bfd_size_type external_sym_size = debug_swap->external_sym_size;
pst->add_psymbol (name, true,
VAR_DOMAIN, LOC_CONST, -1,
psymbol_placement::STATIC, 0,
- psymtab_language, objfile);
+ psymtab_language, partial_symtabs, objfile);
ext_sym += external_sym_size;
}
}
/* Allocate a new partial_symtab NAME. */
static legacy_psymtab *
-new_psymtab (const char *name, struct objfile *objfile)
+new_psymtab (const char *name, psymtab_storage *partial_symtabs,
+ struct objfile *objfile)
{
legacy_psymtab *psymtab;
- psymtab = new legacy_psymtab (name, objfile);
+ psymtab = new legacy_psymtab (name, partial_symtabs, objfile->per_bfd);
/* Keep a backpointer to the file's symbols. */