* symfile.c (decrement_reading_symtab): Add assert.
authorDoug Evans <dje@google.com>
Thu, 9 May 2013 17:24:55 +0000 (17:24 +0000)
committerDoug Evans <dje@google.com>
Thu, 9 May 2013 17:24:55 +0000 (17:24 +0000)
(increment_reading_symtab): Ditto.

gdb/ChangeLog
gdb/symfile.c

index 2d1e3e1c04a57c606f75edd5127848fe94a517cc..f997abf495d4343a38a9f24168b9c65a3f6bab27 100644 (file)
@@ -1,3 +1,8 @@
+2013-05-09  Doug Evans  <dje@google.com>
+
+       * symfile.c (decrement_reading_symtab): Add assert.
+       (increment_reading_symtab): Ditto.
+
 2013-05-09  Joel Brobecker  <brobecker@adacore.com>
 
        * source.c (forward_search_command): Replace call to getc
index 32d6ad052bb4b959e363aca4d52a19687de79410..36f5918b098818a8b3426f5f0b47f0041f7ce185 100644 (file)
@@ -160,6 +160,7 @@ static void
 decrement_reading_symtab (void *dummy)
 {
   currently_reading_symtab--;
+  gdb_assert (currently_reading_symtab >= 0);
 }
 
 /* Increment currently_reading_symtab and return a cleanup that can be
@@ -169,6 +170,7 @@ struct cleanup *
 increment_reading_symtab (void)
 {
   ++currently_reading_symtab;
+  gdb_assert (currently_reading_symtab > 0);
   return make_cleanup (decrement_reading_symtab, NULL);
 }