Add assert in prepare_for_building
authorTom Tromey <tom@tromey.com>
Sun, 20 May 2018 16:25:53 +0000 (10:25 -0600)
committerTom Tromey <tom@tromey.com>
Mon, 16 Jul 2018 14:55:14 +0000 (08:55 -0600)
This adds an assertion in prepare_for_building.  This was useful for
verifying whether some subsequent changes were valid.

gdb/ChangeLog
2018-07-16  Tom Tromey  <tom@tromey.com>

* buildsym.c (prepare_for_building): Add assert.

gdb/ChangeLog
gdb/buildsym.c

index 29df4a0..0a0d00c 100644 (file)
@@ -1,5 +1,9 @@
 2018-07-16  Tom Tromey  <tom@tromey.com>
 
+       * buildsym.c (prepare_for_building): Add assert.
+
+2018-07-16  Tom Tromey  <tom@tromey.com>
+
        * buildsym.c (~buildsym_compunit): Update.
        (struct buildsym_compunit) <comp_unit>: Now a unique_xmalloc_ptr.
        (start_subfile, patch_subfile_names)
index b548c52..035bdb2 100644 (file)
@@ -1021,6 +1021,7 @@ prepare_for_building (const char *name, CORE_ADDR start_addr)
   gdb_assert (pending_macros == NULL);
   gdb_assert (pending_addrmap == NULL);
   gdb_assert (current_subfile == NULL);
+  gdb_assert (buildsym_compunit == nullptr);
 }
 
 /* Start a new symtab for a new source file in OBJFILE.  Called, for example,