* corefile.c (reopen_exec_file): Close any open files.
authorDaniel Jacobowitz <drow@false.org>
Wed, 30 Apr 2008 18:22:37 +0000 (18:22 +0000)
committerDaniel Jacobowitz <drow@false.org>
Wed, 30 Apr 2008 18:22:37 +0000 (18:22 +0000)
gdb/ChangeLog
gdb/corefile.c

index b5a31dda5c27f005bdefd2e445ad8262067159ae..36f56709d62cfa7d3775efc130d20dc593195337 100644 (file)
@@ -1,3 +1,7 @@
+2008-04-30  Daniel Jacobowitz  <dan@codesourcery.com>
+
+       * corefile.c (reopen_exec_file): Close any open files.
+
 2008-04-29  Joel Brobecker  <brobecker@adacore.com>
 
        * ia64-tdep.c (ia64_memory_remove_breakpoint): Set
index b1dbc6b6b63d66f53d01a02f2dcbf99d2cc77b7f..1da2b2a8393853f623ae9b2251fa340ee074c135 100644 (file)
@@ -164,6 +164,11 @@ reopen_exec_file (void)
 
   if (exec_bfd_mtime && exec_bfd_mtime != st.st_mtime)
     exec_file_attach (filename, 0);
+  else
+    /* If we accessed the file since last opening it, close it now;
+       this stops GDB from holding the executable open after it
+       exits.  */
+    bfd_cache_close_all ();
 #endif
 }
 \f