static void fixup_psymbol_section (struct partial_symbol *psym,
struct objfile *objfile);
-static struct symtab *psymtab_to_symtab (struct objfile *objfile,
- struct partial_symtab *pst);
+static struct compunit_symtab *psymtab_to_symtab (struct objfile *objfile,
+ struct partial_symtab *pst);
/* Ensure that the partial symbols for OBJFILE have been loaded. This
function always returns its argument, as a convenience. */
int (*callback) (struct symtab *, void *),
void *data)
{
- struct symtab *last_made = objfile->symtabs;
+ struct compunit_symtab *last_made = objfile->compunit_symtabs;
/* Shared psymtabs should never be seen here. Instead they should
be handled properly by the caller. */
psymtab_to_symtab (objfile, pst);
return iterate_over_some_symtabs (name, real_path, callback, data,
- objfile->symtabs, last_made);
+ objfile->compunit_symtabs, last_made);
}
/* Implementation of the map_symtabs_matching_filename method. */
return NULL;
}
-static struct symtab *
-find_pc_sect_symtab_from_partial (struct objfile *objfile,
- struct bound_minimal_symbol msymbol,
- CORE_ADDR pc, struct obj_section *section,
- int warn_if_readin)
+static struct compunit_symtab *
+find_pc_sect_compunit_symtab_from_partial (struct objfile *objfile,
+ struct bound_minimal_symbol msymbol,
+ CORE_ADDR pc,
+ struct obj_section *section,
+ int warn_if_readin)
{
struct partial_symtab *ps = find_pc_sect_psymtab (objfile, pc, section,
msymbol);
(Internal error: pc %s in read in psymtab, but not in symtab.)\n"),
paddress (get_objfile_arch (objfile), pc));
psymtab_to_symtab (objfile, ps);
- return ps->symtab;
+ return ps->compunit_symtab;
}
return NULL;
}
fixup_section (&psym->ginfo, addr, objfile);
}
-static struct symtab *
+static struct compunit_symtab *
lookup_symbol_aux_psymtabs (struct objfile *objfile,
int block_index, const char *name,
const domain_enum domain)
{
struct partial_symtab *ps;
const int psymtab_index = (block_index == GLOBAL_BLOCK ? 1 : 0);
- struct symtab *stab_best = NULL;
+ struct compunit_symtab *stab_best = NULL;
ALL_OBJFILE_PSYMTABS_REQUIRED (objfile, ps)
{
psymtab_index, domain))
{
struct symbol *sym = NULL;
- struct symtab *stab = psymtab_to_symtab (objfile, ps);
+ struct compunit_symtab *stab = psymtab_to_symtab (objfile, ps);
/* Note: While psymtab_to_symtab can return NULL if the partial symtab
is empty, we can assume it won't here because lookup_partial_symbol
succeeded. */
- const struct blockvector *bv = SYMTAB_BLOCKVECTOR (stab);
+ const struct blockvector *bv = COMPUNIT_BLOCKVECTOR (stab);
struct block *block = BLOCKVECTOR_BLOCK (bv, block_index);
/* Some caution must be observed with overloaded functions
which can happen. Otherwise the result is the primary symtab
that contains PST. */
-static struct symtab *
+static struct compunit_symtab *
psymtab_to_symtab (struct objfile *objfile, struct partial_symtab *pst)
{
/* If it is a shared psymtab, find an unshared psymtab that includes
pst = pst->user;
/* If it's been looked up before, return it. */
- if (pst->symtab)
- return pst->symtab;
+ if (pst->compunit_symtab)
+ return pst->compunit_symtab;
/* If it has not yet been read in, read it. */
if (!pst->readin)
do_cleanups (back_to);
}
- if (pst->symtab != NULL)
- gdb_assert (pst->symtab->primary);
-
- return pst->symtab;
+ return pst->compunit_symtab;
}
static void
"readin pst found and no symtabs."));
}
else
- return psymtab_to_symtab (ofp, cs_pst);
+ {
+ struct compunit_symtab *cust = psymtab_to_symtab (ofp, cs_pst);
+
+ if (cust == NULL)
+ return NULL;
+ return compunit_primary_filetab (cust);
+ }
}
return NULL;
}
{
fprintf_filtered (outfile,
" Full symtab was read (at ");
- gdb_print_host_address (psymtab->symtab, outfile);
+ gdb_print_host_address (psymtab->compunit_symtab, outfile);
fprintf_filtered (outfile, " by function at ");
gdb_print_host_address (psymtab->read_symtab, outfile);
fprintf_filtered (outfile, ")\n");
|| match_partial_symbol (objfile, ps, global, name, namespace, match,
ordered_compare))
{
- struct symtab *s = psymtab_to_symtab (objfile, ps);
+ struct compunit_symtab *cust = psymtab_to_symtab (objfile, ps);
struct block *block;
- if (s == NULL)
+ if (cust == NULL)
continue;
- block = BLOCKVECTOR_BLOCK (SYMTAB_BLOCKVECTOR (s), block_kind);
+ block = BLOCKVECTOR_BLOCK (COMPUNIT_BLOCKVECTOR (cust), block_kind);
if (map_block (name, namespace, objfile, block,
callback, data, match))
return;
read_psymtabs_with_fullname,
map_matching_symbols_psymtab,
expand_symtabs_matching_via_partial,
- find_pc_sect_symtab_from_partial,
+ find_pc_sect_compunit_symtab_from_partial,
map_symbol_filenames_psymtab
};
memset (psymtab, 0, sizeof (struct partial_symtab));
psymtab->filename = bcache (filename, strlen (filename) + 1,
objfile->per_bfd->filename_cache);
- psymtab->symtab = NULL;
+ psymtab->compunit_symtab = NULL;
/* Prepend it to the psymtab list for the objfile it belongs to.
Psymtabs are searched in most recent inserted -> least recent
{
struct symbol *sym;
struct partial_symbol **psym;
- struct symtab *s = NULL;
+ struct compunit_symtab *cust = NULL;
struct partial_symtab *ps;
const struct blockvector *bv;
struct objfile *objfile;
/* We don't call psymtab_to_symtab here because that may cause symtab
expansion. When debugging a problem it helps if checkers leave
things unchanged. */
- s = ps->symtab;
+ cust = ps->compunit_symtab;
/* First do some checks that don't require the associated symtab. */
if (ps->texthigh < ps->textlow)
}
/* Now do checks requiring the associated symtab. */
- if (s == NULL)
+ if (cust == NULL)
continue;
- bv = SYMTAB_BLOCKVECTOR (s);
+ bv = COMPUNIT_BLOCKVECTOR (cust);
b = BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK);
psym = objfile->static_psymbols.list + ps->statics_offset;
length = ps->n_static_syms;