+2021-03-20 Tom Tromey <tom@tromey.com>
+
+ * xcoffread.c (xcoff_end_psymtab): Add partial_symtabs parameter.
+ (xcoff_end_psymtab): Update.
+ (scan_xcoff_symtab): Add partial_symtabs parameter.
+ (xcoff_initial_scan): Update.
+ * stabsread.h (dbx_end_psymtab): Add partial_symtabs parameter.
+ * mdebugread.c (mdebug_build_psymtabs): Update.
+ (parse_partial_symbols): Add partial_symtabs parameter.
+ * dbxread.c (dbx_symfile_read): Update.
+ (read_dbx_symtab): Add partial_symtabs parameter.
+ (read_dbx_symtab): Update.
+ (dbx_end_psymtab): Add partial_symtabs parameter.
+
2021-03-20 Tom Tromey <tom@tromey.com>
* quick-symbol.h (struct quick_symbol_functions)
static void dbx_expand_psymtab (legacy_psymtab *, struct objfile *);
-static void read_dbx_symtab (minimal_symbol_reader &, struct objfile *);
+static void read_dbx_symtab (minimal_symbol_reader &, psymtab_storage *,
+ struct objfile *);
static legacy_psymtab *find_corresponding_bincl_psymtab (const char *,
int);
/* Read stabs data from executable file and define symbols. */
- read_dbx_symtab (reader, objfile);
+ psymtab_storage *partial_symtabs = objfile->partial_symtabs.get ();
+ read_dbx_symtab (reader, partial_symtabs, objfile);
/* Install any minimal symbols that have been collected as the current
minimal symbols for this objfile. */
debugging information is available. */
static void
-read_dbx_symtab (minimal_symbol_reader &reader, struct objfile *objfile)
+read_dbx_symtab (minimal_symbol_reader &reader,
+ psymtab_storage *partial_symtabs,
+ struct objfile *objfile)
{
struct gdbarch *gdbarch = objfile->arch ();
struct external_nlist *bufp = 0; /* =0 avoids gcc -Wall glitch. */
which are not the address. */
&& nlist.n_value >= pst->raw_text_low ())
{
- dbx_end_psymtab (objfile, pst, psymtab_include_list,
+ dbx_end_psymtab (objfile, partial_symtabs,
+ pst, psymtab_include_list,
includes_used, symnum * symbol_size,
nlist.n_value > pst->raw_text_high ()
? nlist.n_value : pst->raw_text_high (),
if (pst)
{
- dbx_end_psymtab (objfile, pst, psymtab_include_list,
+ dbx_end_psymtab (objfile, partial_symtabs,
+ pst, psymtab_include_list,
includes_used, symnum * symbol_size,
(valu > pst->raw_text_high ()
? valu : pst->raw_text_high ()),
compiled without debugging info follows this module. */
if (pst && gdbarch_sofun_address_maybe_missing (gdbarch))
{
- dbx_end_psymtab (objfile, pst,
+ dbx_end_psymtab (objfile, partial_symtabs, pst,
psymtab_include_list, includes_used,
symnum * symbol_size,
(CORE_ADDR) 0, dependency_list,
: lowest_text_address)
+ text_size;
- dbx_end_psymtab (objfile, pst, psymtab_include_list, includes_used,
+ dbx_end_psymtab (objfile, partial_symtabs,
+ pst, psymtab_include_list, includes_used,
symnum * symbol_size,
(text_end > pst->raw_text_high ()
? text_end : pst->raw_text_high ()),
FIXME: List variables and peculiarities of same. */
legacy_psymtab *
-dbx_end_psymtab (struct objfile *objfile, legacy_psymtab *pst,
+dbx_end_psymtab (struct objfile *objfile, psymtab_storage *partial_symtabs,
+ legacy_psymtab *pst,
const char **include_list, int num_includes,
int capping_symbol_offset, CORE_ADDR capping_text,
legacy_psymtab **dependency_list,
address, set it to our starting address. Take care to not set our
own ending address to our starting address. */
- for (partial_symtab *p1 : objfile->psymtabs ())
+ for (partial_symtab *p1 : partial_symtabs->range ())
if (!p1->text_high_valid && p1->text_low_valid && p1 != pst)
p1->set_text_high (pst->raw_text_low ());
}
if (number_dependencies)
{
pst->dependencies
- = objfile->partial_symtabs->allocate_dependencies (number_dependencies);
+ = partial_symtabs->allocate_dependencies (number_dependencies);
memcpy (pst->dependencies, dependency_list,
number_dependencies * sizeof (legacy_psymtab *));
}
/* We could save slight bits of space by only making one of these,
shared by the entire set of include files. FIXME-someday. */
subpst->dependencies =
- objfile->partial_symtabs->allocate_dependencies (1);
+ partial_symtabs->allocate_dependencies (1);
subpst->dependencies[0] = pst;
subpst->number_of_dependencies = 1;
is not empty, but we don't realize that. Fixing that without slowing
things down might be tricky. */
- objfile->partial_symtabs->discard_psymtab (pst);
+ partial_symtabs->discard_psymtab (pst);
/* Indicate that psymtab was thrown away. */
pst = NULL;
int, const char *);
static void parse_partial_symbols (minimal_symbol_reader &,
+ psymtab_storage *,
struct objfile *);
static int has_opaque_xref (FDR *, SYMR *);
(*swap->swap_fdr_in) (objfile->obfd, fdr_src, fdr_ptr);
}
- parse_partial_symbols (reader, objfile);
+ psymtab_storage *partial_symtabs = objfile->partial_symtabs.get ();
+ 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 ();
/* 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
they are only used by some stabs readers. */
extern legacy_psymtab *dbx_end_psymtab
- (struct objfile *objfile, legacy_psymtab *pst,
+ (struct objfile *objfile, psymtab_storage *partial_symtabs,
+ legacy_psymtab *pst,
const char **include_list, int num_includes,
int capping_symbol_offset, CORE_ADDR capping_text,
legacy_psymtab **dependency_list, int number_dependencies,
static void xcoff_initial_scan (struct objfile *, symfile_add_flags);
static void scan_xcoff_symtab (minimal_symbol_reader &,
+ psymtab_storage *partial_symtabs,
struct objfile *);
static const char *xcoff_next_symbol_text (struct objfile *);
are the information for includes and dependencies. */
static legacy_psymtab *
-xcoff_end_psymtab (struct objfile *objfile, legacy_psymtab *pst,
+xcoff_end_psymtab (struct objfile *objfile, psymtab_storage *partial_symtabs,
+ legacy_psymtab *pst,
const char **include_list, int num_includes,
int capping_symbol_number,
legacy_psymtab **dependency_list,
if (number_dependencies)
{
pst->dependencies
- = objfile->partial_symtabs->allocate_dependencies (number_dependencies);
+ = partial_symtabs->allocate_dependencies (number_dependencies);
memcpy (pst->dependencies, dependency_list,
number_dependencies * sizeof (legacy_psymtab *));
}
/* We could save slight bits of space by only making one of these,
shared by the entire set of include files. FIXME-someday. */
subpst->dependencies =
- objfile->partial_symtabs->allocate_dependencies (1);
+ partial_symtabs->allocate_dependencies (1);
subpst->dependencies[0] = pst;
subpst->number_of_dependencies = 1;
/* Empty psymtabs happen as a result of header files which don't have
any symbols in them. There can be a lot of them. */
- objfile->partial_symtabs->discard_psymtab (pst);
+ partial_symtabs->discard_psymtab (pst);
/* Indicate that psymtab was thrown away. */
pst = NULL;
static void
scan_xcoff_symtab (minimal_symbol_reader &reader,
+ psymtab_storage *partial_symtabs,
struct objfile *objfile)
{
CORE_ADDR toc_offset = 0; /* toc offset value in data section. */
each program csect, because their text
sections need not be adjacent. */
xcoff_end_psymtab
- (objfile, pst, psymtab_include_list,
+ (objfile, partial_symtabs, pst, psymtab_include_list,
includes_used, symnum_before, dependency_list,
dependencies_used, textlow_not_set);
includes_used = 0;
if (pst)
{
- xcoff_end_psymtab (objfile, pst, psymtab_include_list,
+ xcoff_end_psymtab (objfile, partial_symtabs,
+ pst, psymtab_include_list,
includes_used, symnum_before,
dependency_list, dependencies_used,
textlow_not_set);
if (pst)
{
- xcoff_end_psymtab (objfile, pst, psymtab_include_list, includes_used,
+ xcoff_end_psymtab (objfile, partial_symtabs,
+ pst, psymtab_include_list, includes_used,
ssymnum, dependency_list,
dependencies_used, textlow_not_set);
}
/* Now that the symbol table data of the executable file are all in core,
process them and define symbols accordingly. */
- scan_xcoff_symtab (reader, objfile);
+ psymtab_storage *partial_symtabs = objfile->partial_symtabs.get ();
+ scan_xcoff_symtab (reader, partial_symtabs, objfile);
/* Install any minimal symbols that have been collected as the current
minimal symbols for this objfile. */