From 939643d727a6988e89a4b521aa9b8bb898696eb6 Mon Sep 17 00:00:00 2001 From: Daniel Jacobowitz Date: Wed, 30 Apr 2008 18:22:37 +0000 Subject: [PATCH] * corefile.c (reopen_exec_file): Close any open files. --- gdb/ChangeLog | 4 ++++ gdb/corefile.c | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index b5a31dda5c2..36f56709d62 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,7 @@ +2008-04-30 Daniel Jacobowitz + + * corefile.c (reopen_exec_file): Close any open files. + 2008-04-29 Joel Brobecker * ia64-tdep.c (ia64_memory_remove_breakpoint): Set diff --git a/gdb/corefile.c b/gdb/corefile.c index b1dbc6b6b63..1da2b2a8393 100644 --- a/gdb/corefile.c +++ b/gdb/corefile.c @@ -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 } -- 2.30.2