static void dwarf2_find_base_address (struct die_info *die,
struct dwarf2_cu *cu);
-static struct partial_symtab *create_partial_symtab
+static dwarf2_psymtab *create_partial_symtab
(struct dwarf2_per_cu_data *per_cu, const char *name);
static void build_type_psymtabs_reader (const struct die_reader_specs *reader,
CORE_ADDR *lowpc, CORE_ADDR *highpc,
int need_pc, struct dwarf2_cu *cu);
-static void dwarf2_read_symtab (struct partial_symtab *,
- struct objfile *);
-
-static void psymtab_to_symtab_1 (struct partial_symtab *);
+static void psymtab_to_symtab_1 (dwarf2_psymtab *);
static abbrev_table_up abbrev_table_read_table
(struct dwarf2_per_objfile *dwarf2_per_objfile, struct dwarf2_section_info *,
struct dwarf2_cu *cu);
static void dwarf_decode_lines (struct line_header *, const char *,
- struct dwarf2_cu *, struct partial_symtab *,
+ struct dwarf2_cu *, dwarf2_psymtab *,
CORE_ADDR, int decode_mapping);
static void dwarf2_start_subfile (struct dwarf2_cu *, const char *,
static void read_variable (struct die_info *die, struct dwarf2_cu *cu);
static int dwarf2_ranges_read (unsigned, CORE_ADDR *, CORE_ADDR *,
- struct dwarf2_cu *, struct partial_symtab *);
+ struct dwarf2_cu *, dwarf2_psymtab *);
/* How dwarf2_get_pc_bounds constructed its *LOWPC and *HIGHPC return
values. Keep the items ordered with increasing constraints compliance. */
static enum pc_bounds_kind dwarf2_get_pc_bounds (struct die_info *,
CORE_ADDR *, CORE_ADDR *,
struct dwarf2_cu *,
- struct partial_symtab *);
+ dwarf2_psymtab *);
static void get_scope_pc_bounds (struct die_info *,
CORE_ADDR *, CORE_ADDR *,
partial symtab as being an include of PST. */
static void
-dwarf2_create_include_psymtab (const char *name, struct partial_symtab *pst,
+dwarf2_create_include_psymtab (const char *name, dwarf2_psymtab *pst,
struct objfile *objfile)
{
- struct partial_symtab *subpst = new partial_symtab (name, objfile);
+ dwarf2_psymtab *subpst = new dwarf2_psymtab (name, objfile);
if (!IS_ABSOLUTE_PATH (subpst->filename))
{
subpst->dependencies[0] = pst;
subpst->number_of_dependencies = 1;
- subpst->read_symtab = pst->read_symtab;
-
/* No private part is necessary for include psymtabs. This property
can be used to differentiate between such include psymtabs and
the regular ones. */
- subpst->read_symtab_private = NULL;
+ subpst->per_cu_data = nullptr;
}
/* Read the Line Number Program data and extract the list of files
static void
dwarf2_build_include_psymtabs (struct dwarf2_cu *cu,
struct die_info *die,
- struct partial_symtab *pst)
+ dwarf2_psymtab *pst)
{
line_header_up lh;
struct attribute *attr;
else
{
unsigned int line_offset = to_underlying (line_offset_struct);
- struct partial_symtab *pst;
+ dwarf2_psymtab *pst;
std::string name;
/* Give the symtab a useful name for debug purposes. */
The caller must fill in the following details:
dirname, textlow, texthigh. */
-static struct partial_symtab *
+static dwarf2_psymtab *
create_partial_symtab (struct dwarf2_per_cu_data *per_cu, const char *name)
{
struct objfile *objfile = per_cu->dwarf2_per_objfile->objfile;
- struct partial_symtab *pst;
+ dwarf2_psymtab *pst;
- pst = new partial_symtab (name, objfile, 0);
+ pst = new dwarf2_psymtab (name, objfile, 0);
pst->psymtabs_addrmap_supported = true;
/* This is the glue that links PST into GDB's symbol API. */
- pst->read_symtab_private = per_cu;
- pst->read_symtab = dwarf2_read_symtab;
+ pst->per_cu_data = per_cu;
per_cu->v.psymtab = pst;
return pst;
struct dwarf2_per_cu_data *per_cu = cu->per_cu;
CORE_ADDR baseaddr;
CORE_ADDR best_lowpc = 0, best_highpc = 0;
- struct partial_symtab *pst;
+ dwarf2_psymtab *pst;
enum pc_bounds_kind cu_bounds_kind;
const char *filename;
struct attribute *attr;
struct partial_die_info *first_die;
CORE_ADDR lowpc, highpc;
- struct partial_symtab *pst;
+ dwarf2_psymtab *pst;
gdb_assert (per_cu->is_debug_types);
sig_type = (struct signatured_type *) per_cu;
struct objfile *objfile = dwarf2_per_objfile->objfile;
struct type_unit_group *tu_group = (struct type_unit_group *) *slot;
struct dwarf2_per_cu_data *per_cu = &tu_group->per_cu;
- struct partial_symtab *pst = per_cu->v.psymtab;
+ dwarf2_psymtab *pst = per_cu->v.psymtab;
int len = (tu_group->tus == nullptr) ? 0 : tu_group->tus->size ();
int i;
{
for (dwarf2_per_cu_data *per_cu : dwarf2_per_objfile->all_comp_units)
{
- struct partial_symtab *pst = per_cu->v.psymtab;
+ dwarf2_psymtab *pst = per_cu->v.psymtab;
if (pst == NULL)
continue;
/* Expand this partial symbol table into a full symbol table. SELF is
not NULL. */
-static void
-dwarf2_read_symtab (struct partial_symtab *self,
- struct objfile *objfile)
+void
+dwarf2_psymtab::read_symtab (struct objfile *objfile)
{
struct dwarf2_per_objfile *dwarf2_per_objfile
= get_dwarf2_per_objfile (objfile);
- if (self->readin)
+ if (readin)
{
warning (_("bug: psymtab for %s is already read in."),
- self->filename);
+ filename);
}
else
{
if (info_verbose)
{
printf_filtered (_("Reading in symbols for %s..."),
- self->filename);
+ filename);
gdb_flush (gdb_stdout);
}
dwarf2_per_objfile->reading_partial_symbols = 0;
- psymtab_to_symtab_1 (self);
+ psymtab_to_symtab_1 (this);
/* Finish up the debug error message. */
if (info_verbose)
/* Read in full symbols for PST, and anything it depends on. */
static void
-psymtab_to_symtab_1 (struct partial_symtab *pst)
+psymtab_to_symtab_1 (dwarf2_psymtab *pst)
{
struct dwarf2_per_cu_data *per_cu;
int i;
wrap_here (""); /* Flush output. */
gdb_flush (gdb_stdout);
}
- psymtab_to_symtab_1 (pst->dependencies[i]);
+ psymtab_to_symtab_1 ((dwarf2_psymtab *) pst->dependencies[i]);
}
- per_cu = (struct dwarf2_per_cu_data *) pst->read_symtab_private;
+ per_cu = pst->per_cu_data;
if (per_cu == NULL)
{
per_cu->v.quick->compunit_symtab = cust;
else
{
- struct partial_symtab *pst = per_cu->v.psymtab;
+ dwarf2_psymtab *pst = per_cu->v.psymtab;
pst->compunit_symtab = cust;
pst->readin = true;
}
per_cu->v.quick->compunit_symtab = cust;
else
{
- struct partial_symtab *pst = per_cu->v.psymtab;
+ dwarf2_psymtab *pst = per_cu->v.psymtab;
pst->compunit_symtab = cust;
pst->readin = true;
}
static int
dwarf2_ranges_read (unsigned offset, CORE_ADDR *low_return,
CORE_ADDR *high_return, struct dwarf2_cu *cu,
- struct partial_symtab *ranges_pst)
+ dwarf2_psymtab *ranges_pst)
{
struct objfile *objfile = cu->per_cu->dwarf2_per_objfile->objfile;
struct gdbarch *gdbarch = get_objfile_arch (objfile);
static enum pc_bounds_kind
dwarf2_get_pc_bounds (struct die_info *die, CORE_ADDR *lowpc,
CORE_ADDR *highpc, struct dwarf2_cu *cu,
- struct partial_symtab *pst)
+ dwarf2_psymtab *pst)
{
struct dwarf2_per_objfile *dwarf2_per_objfile
= cu->per_cu->dwarf2_per_objfile;
static const char *
psymtab_include_file_name (const struct line_header *lh, const file_entry &fe,
- const struct partial_symtab *pst,
+ const dwarf2_psymtab *pst,
const char *comp_dir,
gdb::unique_xmalloc_ptr<char> *name_holder)
{
static void
dwarf_decode_lines (struct line_header *lh, const char *comp_dir,
- struct dwarf2_cu *cu, struct partial_symtab *pst,
+ struct dwarf2_cu *cu, dwarf2_psymtab *pst,
CORE_ADDR lowpc, int decode_mapping)
{
struct objfile *objfile = cu->per_cu->dwarf2_per_objfile->objfile;