* target.c (target_mourn_inferior): Call bfd_cache_close_all
authorJoel Brobecker <brobecker@gnat.com>
Tue, 14 Apr 2009 16:48:07 +0000 (16:48 +0000)
committerJoel Brobecker <brobecker@gnat.com>
Tue, 14 Apr 2009 16:48:07 +0000 (16:48 +0000)
        after having executed the target mourn_inferior routine.

gdb/ChangeLog
gdb/target.c

index 52964cae4abab248f4ea0ea35130e84f5b02f9e5..7e403858d9321cc6eb4986de0d1bc9682252fa2a 100644 (file)
@@ -1,3 +1,8 @@
+2009-04-14  Joel Brobecker  <brobecker@adacore.com>
+
+       * target.c (target_mourn_inferior): Call bfd_cache_close_all
+       after having executed the target mourn_inferior routine.
+
 2009-04-14  Eli Zaretskii  <eliz@gnu.org>
 
        * config/djgpp/djconfig.sh (DEPDIR): Define to "_deps", if
index 86cdb71b78901292c9ba37b397b7deaa43106ed9..f7366f82d0f2ad7032fc62e45de1a079ed2f930d 100644 (file)
@@ -1941,6 +1941,12 @@ target_mourn_inferior (void)
          t->to_mourn_inferior (t);
          if (targetdebug)
            fprintf_unfiltered (gdb_stdlog, "target_mourn_inferior ()\n");
+
+          /* We no longer need to keep handles on any of the object files.
+             Make sure to release them to avoid unnecessarily locking any
+             of them while we're not actually debugging.  */
+          bfd_cache_close_all ();
+
          return;
        }
     }