+2018-07-20 Tom Tromey <tom@tromey.com>
+
+ * coffread.c (coff_symtab_read): Update.
+ * xcoffread.c (xcoff_psymtab_to_symtab_1): Update.
+ (xcoff_new_init): Update.
+ * mipsread.c (mipscoff_new_init): Update.
+ * mdebugread.c (mdebug_build_psymtabs): Update.
+ * elfread.c (elf_new_init): Update.
+ * dwarf2read.c (process_full_comp_unit, process_full_type_unit):
+ Update.
+ * dbxread.c (dbx_new_init, dbx_psymtab_to_symtab_1)
+ (coffstab_build_psymtabs, elfstab_build_psymtabs)
+ (stabsect_build_psymtabs): Update.
+ * buildsym.h (buildsym_init): Don't declare.
+ * buildsym.c: Update comment.
+ (prepare_for_building): Remove.
+ (start_symtab, restart_symtab): Update.
+ (reset_symtab_globals): Update comment.
+ (buildsym_init): Remove.
+
2018-07-20 Tom Tromey <tom@tromey.com>
* xcoffread.c (read_xcoff_symtab, process_xcoff_symbol): Update.
The basic way this module is used is as follows:
- buildsym_init ();
scoped_free_pendings free_pending;
cust = start_symtab (...);
... read debug info ...
Reading DWARF Type Units is another variation:
- buildsym_init ();
scoped_free_pendings free_pending;
cust = start_symtab (...);
... read debug info ...
And then reading subsequent Type Units within the containing "Comp Unit"
will use a second flow:
- buildsym_init ();
scoped_free_pendings free_pending;
cust = restart_symtab (...);
... read debug info ...
dbxread.c and xcoffread.c use another variation:
- buildsym_init ();
scoped_free_pendings free_pending;
cust = start_symtab (...);
... read debug info ...
return buildsym_compunit->get_macro_table ();
}
\f
-/* Init state to prepare for building a symtab.
- Note: This can't be done in buildsym_init because dbxread.c and xcoffread.c
- can call start_symtab+end_symtab multiple times after one call to
- buildsym_init. */
-
-static void
-prepare_for_building ()
-{
- /* These should have been reset either by successful completion of building
- a symtab, or by the scoped_free_pendings destructor. */
- gdb_assert (buildsym_compunit == nullptr);
-}
-
/* Start a new symtab for a new source file in OBJFILE. Called, for example,
when a stabs symbol of type N_SO is seen, or when a DWARF
TAG_compile_unit DIE is seen. It indicates the start of data for
start_symtab (struct objfile *objfile, const char *name, const char *comp_dir,
CORE_ADDR start_addr, enum language language)
{
- prepare_for_building ();
+ /* These should have been reset either by successful completion of building
+ a symtab, or by the scoped_free_pendings destructor. */
+ gdb_assert (buildsym_compunit == nullptr);
buildsym_compunit = new struct buildsym_compunit (objfile, name, comp_dir,
language, start_addr);
restart_symtab (struct compunit_symtab *cust,
const char *name, CORE_ADDR start_addr)
{
- prepare_for_building ();
+ /* These should have been reset either by successful completion of building
+ a symtab, or by the scoped_free_pendings destructor. */
+ gdb_assert (buildsym_compunit == nullptr);
buildsym_compunit
= new struct buildsym_compunit (COMPUNIT_OBJFILE (cust),
}
}
-/* Reset state after a successful building of a symtab.
- This exists because dbxread.c and xcoffread.c can call
- start_symtab+end_symtab multiple times after one call to buildsym_init,
- and before the scoped_free_pendings destructor is called.
- We keep the free_pendings list around for dbx/xcoff sake. */
+/* Reset state after a successful building of a symtab. */
static void
reset_symtab_globals (void)
gdb_assert (buildsym_compunit != nullptr);
return &buildsym_compunit->m_global_symbols;
}
-
-\f
-
-/* Initialize anything that needs initializing when starting to read a
- fresh piece of a symbol file, e.g. reading in the stuff
- corresponding to a psymtab. */
-
-void
-buildsym_init ()
-{
-}