From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20091 invoked by alias); 14 Apr 2009 16:51:37 -0000 Received: (qmail 20071 invoked by uid 22791); 14 Apr 2009 16:51:35 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 14 Apr 2009 16:51:29 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id CA9F92BAB7E; Tue, 14 Apr 2009 12:51:27 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id vLB1qfNoE4cH; Tue, 14 Apr 2009 12:51:27 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 90F332BAB79; Tue, 14 Apr 2009 12:51:27 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id 1FFD3F5A14; Tue, 14 Apr 2009 09:51:24 -0700 (PDT) Date: Tue, 14 Apr 2009 16:51:00 -0000 From: Joel Brobecker To: Pedro Alves Cc: gdb-patches@sourceware.org Subject: Re: [patch] release handle on object files after program exits Message-ID: <20090414165124.GO7535@adacore.com> References: <20090403164347.GN16605@adacore.com> <20090408164839.GD7535@adacore.com> <200904081814.46748.pedro@codesourcery.com> <20090408223829.GI7535@adacore.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="DIOMP1UsTsWJauNi" Content-Disposition: inline In-Reply-To: <20090408223829.GI7535@adacore.com> User-Agent: Mutt/1.5.18 (2008-05-17) 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/msg00263.txt.bz2 --DIOMP1UsTsWJauNi Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-length: 426 > 2009-04-08 Joel Brobecker > > * target.c (target_mourn_inferior): Call bfd_cache_close_all > after having executed the target mourn_inferior routine. I just checked this patch in. I also wrote the following testcase, which I checked in as well. 2009-04-14 Joel Brobecker * gdb.base/exe-lock.exp: New testcase. Tested on x86_64-linux. -- Joel --DIOMP1UsTsWJauNi Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="exe-lock.exp" Content-length: 2002 # Copyright 2009 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . if $tracelevel { strace $tracelevel } # The intent of this testcase is to verify that GDB does not keep # a filesystem lock on the executable file once the executable # is no longer running. set testfile "arrayidx" set srcfile ${testfile}.c set binfile ${objdir}/${subdir}/${testfile} if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } { untested "Couldn't compile ${srcfile}" return -1 } gdb_exit gdb_start gdb_reinitialize_dir $srcdir/$subdir gdb_load ${binfile} # Sanity-check: Verify that the executable exists. This is just to # make sure that, when we verify later that the file does not exist, # it really has been deleted. if { ! [file exists $binfile] } { fail "executable does not exist (${binfile})" return -1 } if ![runto_main] then { perror "couldn't run to breakpoint" continue } gdb_test "continue" \ ".*Program exited normally\\." \ "continue until program exits" # Try deleting the executable file, now that the program has exited, # and make sure that the deletion worked by verifying that the exe # is no longer there (the "file delete" tcl command does not return # any status, apparently). file delete $binfile if { [file exists $binfile] } { fail "executable still exists (${binfile})" } --DIOMP1UsTsWJauNi--