From: Joel Brobecker <brobecker@adacore.com>
To: Pedro Alves <pedro@codesourcery.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [patch] release handle on object files after program exits
Date: Tue, 14 Apr 2009 16:51:00 -0000 [thread overview]
Message-ID: <20090414165124.GO7535@adacore.com> (raw)
In-Reply-To: <20090408223829.GI7535@adacore.com>
[-- Attachment #1: Type: text/plain, Size: 426 bytes --]
> 2009-04-08 Joel Brobecker <brobecker@adacore.com>
>
> * 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 <brobecker@adacore.com>
* gdb.base/exe-lock.exp: New testcase.
Tested on x86_64-linux.
--
Joel
[-- Attachment #2: exe-lock.exp --]
[-- Type: text/plain, Size: 2002 bytes --]
# 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 <http://www.gnu.org/licenses/>.
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})"
}
prev parent reply other threads:[~2009-04-14 16:51 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-04-03 16:44 Joel Brobecker
2009-04-03 18:41 ` Tom Tromey
2009-04-08 16:48 ` Joel Brobecker
2009-04-08 17:14 ` Pedro Alves
2009-04-08 22:51 ` Joel Brobecker
2009-04-08 23:12 ` Pedro Alves
2009-04-14 16:51 ` Joel Brobecker [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090414165124.GO7535@adacore.com \
--to=brobecker@adacore.com \
--cc=gdb-patches@sourceware.org \
--cc=pedro@codesourcery.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox