From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9504 invoked by alias); 29 Jul 2004 14:04:01 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 9482 invoked from network); 29 Jul 2004 14:04:00 -0000 Received: from unknown (HELO dublin.act-europe.fr) (212.157.227.154) by sourceware.org with SMTP; 29 Jul 2004 14:04:00 -0000 Received: from localhost (province.act-europe.fr [10.10.0.214]) by filtered-dublin.act-europe.fr (Postfix) with ESMTP id 504F922A3DB; Thu, 29 Jul 2004 16:03:59 +0200 (MET DST) Received: from dublin.act-europe.fr ([10.10.0.154]) by localhost (province.act-europe.fr [10.10.0.214]) (amavisd-new, port 10024) with ESMTP id 17013-07; Thu, 29 Jul 2004 16:03:59 +0200 (CEST) Received: from berne.act-europe.fr (berne.act-europe.fr [10.10.0.165]) by dublin.act-europe.fr (Postfix) with ESMTP id F10B622A3D9; Thu, 29 Jul 2004 16:03:58 +0200 (MET DST) Received: by berne.act-europe.fr (Postfix, from userid 560) id D49FE592B; Thu, 29 Jul 2004 11:03:57 -0400 (EDT) Date: Thu, 29 Jul 2004 14:04:00 -0000 From: Jerome Guitton To: Andrew Cagney Cc: gdb-patches@sources.redhat.com Subject: Re: [RFA] win32: bfd_cache_close after kill Message-ID: <20040729150357.GA2697@act-europe.fr> References: <20040524115048.GA27758@act-europe.fr> <20040617132031.GA10371@act-europe.fr> <40D1FB3F.3060904@gnu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="7AUc2qLy4jB3hD7Z" Content-Disposition: inline In-Reply-To: <40D1FB3F.3060904@gnu.org> User-Agent: Mutt/1.4i X-Virus-Scanned: by amavisd-new at act-europe.fr X-SW-Source: 2004-07/txt/msg00439.txt.bz2 --7AUc2qLy4jB3hD7Z Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-length: 519 Andrew Cagney (cagney@gnu.org): > >>When the inferior is killed, it is safe the release the different file > >>>handles that BFD keeps open. It is particularly useful on Win32 (and > >>>presumably on HP UX) to be able to recompile and restart a new debugging > >>>session without quitting GDB... > > > > > Can it now go in the symbol-table reader that opened the file? I finally had time (at last!) to complete the implementation. New patch in attachment. Still no regression on i686 linux. OK to apply? -- Jerome --7AUc2qLy4jB3hD7Z Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="bfd_cache_close.dif" Content-length: 2706 2004-07-29 Jerome Guitton * inflow.c (kill_command): release file handles in BFD. * exec.c (exec_file_attach): release exec_bfd file handle. * symfile.c (symbol_file_add_with_addrs_or_offsets): release bfd file handle. * Makefile.in: Update inflow.c's dependencies. Index: Makefile.in =================================================================== RCS file: /cvs/src/src/gdb/Makefile.in,v retrieving revision 1.596 diff -u -p -r1.596 Makefile.in --- Makefile.in 23 Jul 2004 10:33:36 -0000 1.596 +++ Makefile.in 29 Jul 2004 13:48:09 -0000 @@ -1974,7 +1974,7 @@ inf-loop.o: inf-loop.c $(defs_h) $(infer $(event_top_h) $(inf_loop_h) $(remote_h) inflow.o: inflow.c $(defs_h) $(frame_h) $(inferior_h) $(command_h) \ $(serial_h) $(terminal_h) $(target_h) $(gdbthread_h) $(gdb_string_h) \ - $(inflow_h) + $(inflow_h) $(bfd_h) infptrace.o: infptrace.c $(defs_h) $(frame_h) $(inferior_h) $(target_h) \ $(gdb_string_h) $(regcache_h) $(gdb_wait_h) $(command_h) \ $(gdb_dirent_h) $(gdbcore_h) $(gdb_stat_h) Index: exec.c =================================================================== RCS file: /cvs/src/src/gdb/exec.c,v retrieving revision 1.38 diff -u -p -r1.38 exec.c --- exec.c 26 Jul 2004 14:52:59 -0000 1.38 +++ exec.c 29 Jul 2004 13:48:09 -0000 @@ -270,6 +270,8 @@ exec_file_attach (char *filename, int fr if (deprecated_exec_file_display_hook) (*deprecated_exec_file_display_hook) (filename); } + if (exec_bfd) + bfd_cache_close (exec_bfd); } /* Process the first arg in ARGS as the new exec file. Index: inflow.c =================================================================== RCS file: /cvs/src/src/gdb/inflow.c,v retrieving revision 1.22 diff -u -p -r1.22 inflow.c --- inflow.c 28 Apr 2004 16:36:25 -0000 1.22 +++ inflow.c 29 Jul 2004 13:48:09 -0000 @@ -21,6 +21,7 @@ Boston, MA 02111-1307, USA. */ #include "defs.h" +#include "bfd.h" #include "frame.h" #include "inferior.h" #include "command.h" @@ -597,6 +598,8 @@ kill_command (char *arg, int from_tty) else print_stack_frame (get_selected_frame (), 1, SRC_AND_LOC); } + + bfd_cache_close_all (); } /* Call set_sigint_trap when you need to pass a signal on to an attached Index: symfile.c =================================================================== RCS file: /cvs/src/src/gdb/symfile.c,v retrieving revision 1.135 diff -u -p -r1.135 symfile.c --- symfile.c 26 Jul 2004 14:53:05 -0000 1.135 +++ symfile.c 29 Jul 2004 13:48:10 -0000 @@ -894,6 +894,7 @@ symbol_file_add_with_addrs_or_offsets (b if (deprecated_target_new_objfile_hook) deprecated_target_new_objfile_hook (objfile); + bfd_cache_close (abfd); return (objfile); } --7AUc2qLy4jB3hD7Z--