+2018-07-16 Tom Tromey <tom@tromey.com>
+
+ * xcoffread.c (xcoff_initial_scan): Don't call
+ free_pending_blocks.
+ * dbxread.c (dbx_symfile_read): Don't call free_pending_blocks.
+ * buildsym.h (class scoped_free_pendings): Add constructor.
+ (free_pending_blocks): Don't declare.
+ * buildsym.c (scoped_free_pendings::scoped_free_pendings): New.
+ (free_pending_blocks): Now static.
+
2018-07-16 Tom Tromey <tom@tromey.com>
* buildsym.h (push_subfile, pop_subfile): Update declarations.
struct block *block,
struct pending_block *opblock);
+static void free_pending_blocks ();
+
/* Initial sizes of data structures. These are realloc'd larger if
needed, and realloc'd down to the size actually used, when
completed. */
return (NULL);
}
+scoped_free_pendings::scoped_free_pendings ()
+{
+ gdb_assert (pending_blocks == nullptr);
+}
+
/* At end of reading syms, or in case of quit, ensure everything
associated with building symtabs is freed.
/* This function is called to discard any pending blocks. */
-void
-free_pending_blocks (void)
+static void
+free_pending_blocks ()
{
if (pending_blocks != NULL)
{
{
public:
- scoped_free_pendings () = default;
+ scoped_free_pendings ();
~scoped_free_pendings ();
DISABLE_COPY_AND_ASSIGN (scoped_free_pendings);
extern void restart_symtab (struct compunit_symtab *cust,
const char *name, CORE_ADDR start_addr);
-extern void free_pending_blocks (void);
-
/* Record the name of the debug format in the current pending symbol
table. FORMAT must be a string with a lifetime at least as long as
the symtab's objfile. */
symbol_size = DBX_SYMBOL_SIZE (objfile);
symbol_table_offset = DBX_SYMTAB_OFFSET (objfile);
- free_pending_blocks ();
scoped_free_pendings free_pending;
minimal_symbol_reader reader (objfile);
include N_SLINE. */
init_psymbol_list (objfile, num_symbols);
- free_pending_blocks ();
-
scoped_free_pendings free_pending;
minimal_symbol_reader reader (objfile);