+2020-01-26 Tom Tromey <tom@tromey.com>
+
+ * xcoffread.c (xcoff_start_psymtab): Use new.
+ * psymtab.c (partial_symtab::partial_symtab): New constructor,
+ renamed from start_psymtab_common.
+ * psympriv.h (struct partial_symtab): Add new constructor.
+ (start_psymtab_common): Don't declare.
+ * mdebugread.c (parse_partial_symbols): Use new.
+ * dwarf2read.c (create_partial_symtab): Use new.
+ * dbxread.c (start_psymtab): Use new.
+ * ctfread.c (create_partial_symtab): Use new.
+
2020-01-26 Tom Tromey <tom@tromey.com>
* xcoffread.c (xcoff_end_psymtab): Use new.
struct partial_symtab *pst;
struct ctf_context *ccx;
- pst = start_psymtab_common (objfile, name, 0);
+ pst = new partial_symtab (name, objfile, 0);
ccx = XOBNEW (&objfile->objfile_obstack, struct ctf_context);
ccx->fp = cfp;
start_psymtab (struct objfile *objfile, const char *filename, CORE_ADDR textlow,
int ldsymoff)
{
- struct partial_symtab *result =
- start_psymtab_common (objfile, filename, textlow);
+ struct partial_symtab *result = new partial_symtab (filename, objfile,
+ textlow);
result->read_symtab_private =
XOBNEW (&objfile->objfile_obstack, struct symloc);
struct objfile *objfile = per_cu->dwarf2_per_objfile->objfile;
struct partial_symtab *pst;
- pst = start_psymtab_common (objfile, name, 0);
+ pst = new partial_symtab (name, objfile, 0);
pst->psymtabs_addrmap_supported = true;
textlow = fh->adr;
else
textlow = 0;
- pst = start_psymtab_common (objfile,
- fdr_name (fh),
- textlow);
+ pst = new partial_symtab (fdr_name (fh), objfile, textlow);
pst->read_symtab_private = XOBNEW (&objfile->objfile_obstack, symloc);
memset (pst->read_symtab_private, 0, sizeof (struct symloc));
partial_symtab (const char *filename, struct objfile *objfile)
ATTRIBUTE_NONNULL (2) ATTRIBUTE_NONNULL (3);
+ /* Like the above, but also sets the initial text low and text high
+ from the ADDR argument, and sets the global- and
+ static-offsets. */
+
+ partial_symtab (const char *filename, struct objfile *objfile,
+ CORE_ADDR addr)
+ ATTRIBUTE_NONNULL (2) ATTRIBUTE_NONNULL (3);
+
/* Return the raw low text address of this partial_symtab. */
CORE_ADDR raw_text_low () const
{
extern void init_psymbol_list (struct objfile *objfile, int total_symbols);
-extern struct partial_symtab *start_psymtab_common (struct objfile *,
- const char *, CORE_ADDR);
-
extern void end_psymtab_common (struct objfile *, struct partial_symtab *);
static inline void
});
}
-/* Allocate and partially fill a partial symtab. It will be
- completely filled at the end of the symbol list.
+/* Partially fill a partial symtab. It will be completely filled at
+ the end of the symbol list. */
- FILENAME is the name of the symbol-file we are reading from. */
-
-struct partial_symtab *
-start_psymtab_common (struct objfile *objfile,
- const char *filename,
- CORE_ADDR textlow)
+partial_symtab::partial_symtab (const char *filename,
+ struct objfile *objfile,
+ CORE_ADDR textlow)
+ : partial_symtab (filename, objfile)
{
- struct partial_symtab *psymtab;
-
- psymtab = new partial_symtab (filename, objfile);
- psymtab->set_text_low (textlow);
- psymtab->set_text_high (psymtab->raw_text_low ()); /* default */
- psymtab->globals_offset = objfile->partial_symtabs->global_psymbols.size ();
- psymtab->statics_offset = objfile->partial_symtabs->static_psymbols.size ();
- return psymtab;
+ set_text_low (textlow);
+ set_text_high (raw_text_low ()); /* default */
+ globals_offset = objfile->partial_symtabs->global_psymbols.size ();
+ statics_offset = objfile->partial_symtabs->static_psymbols.size ();
}
/* Perform "finishing up" operations of a partial symtab. */
xcoff_start_psymtab (struct objfile *objfile,
const char *filename, int first_symnum)
{
- struct partial_symtab *result =
- start_psymtab_common (objfile,
- filename,
- /* We fill in textlow later. */
- 0);
+ /* We fill in textlow later. */
+ struct partial_symtab *result = new partial_symtab (filename, objfile, 0);
result->read_symtab_private =
XOBNEW (&objfile->objfile_obstack, struct symloc);