From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10434 invoked by alias); 8 Apr 2009 17:14:15 -0000 Received: (qmail 10426 invoked by uid 22791); 8 Apr 2009 17:14:13 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (65.74.133.4) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 08 Apr 2009 17:14:08 +0000 Received: (qmail 23614 invoked from network); 8 Apr 2009 17:14:06 -0000 Received: from unknown (HELO orlando.local) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 8 Apr 2009 17:14:06 -0000 From: Pedro Alves To: gdb-patches@sourceware.org Subject: Re: [patch] release handle on object files after program exits Date: Wed, 08 Apr 2009 17:14:00 -0000 User-Agent: KMail/1.9.10 Cc: Joel Brobecker , Tom Tromey References: <20090403164347.GN16605@adacore.com> <20090408164839.GD7535@adacore.com> In-Reply-To: <20090408164839.GD7535@adacore.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200904081814.46748.pedro@codesourcery.com> X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2009-04/txt/msg00152.txt.bz2 A Wednesday 08 April 2009 17:48:39, Joel Brobecker wrote: > Hi Tom, > > > Joel> 2009-04-03 Joel Brobecker > > Joel> * target.c (target_mourn_inferior): Call bfd_cache_close_all. > > > > I wonder how this will interact with the multi-process support. > > It seems like too big a hammer. > > I finally had time to look deeper into this - I came up with the patch > while looking at what we did for the "kill" command, so I didn't have > to think too much about this. > > As far as I can tell, things should still be fine, because the file > should automatically be re-opened if GDB tries to read from the bfd > again. Perhaps we could possibly improve the situation, but I propose > we do that if the current approach becomes an actual problem? (in which > case we can look at fixing both cases - kill and exit) > I'm left wondering if generic_mourn_inferior wouldn't be a better place for this. That is, at the tail end of mourning, instead of before mourning, which e.g., has a better change of not triggering a file reopen. generic_mourn_inferior already calls reopen_exec_file, which conditionaly calls bfd_cache_close_all. -- Pedro Alves