From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29304 invoked by alias); 21 Jun 2009 16:45:37 -0000 Received: (qmail 29294 invoked by uid 22791); 21 Jun 2009 16:45:36 -0000 X-SWARE-Spam-Status: No, hits=-2.2 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from mailhost.u-strasbg.fr (HELO mailhost.u-strasbg.fr) (130.79.200.152) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 21 Jun 2009 16:45:27 +0000 Received: from baal.u-strasbg.fr (baal.u-strasbg.fr [IPv6:2001:660:2402::41]) by mailhost.u-strasbg.fr (8.14.2/jtpda-5.5pre1) with ESMTP id n5LGjG7f041380 ; Sun, 21 Jun 2009 18:45:16 +0200 (CEST) Received: from mailserver.u-strasbg.fr (ms2.u-strasbg.fr [IPv6:2001:660:2402:d::11]) by baal.u-strasbg.fr (8.14.0/jtpda-5.5pre1) with ESMTP id n5LGjGwg004724 ; Sun, 21 Jun 2009 18:45:16 +0200 (CEST) (envelope-from muller@ics.u-strasbg.fr) Received: from d620muller (lec67-4-82-230-53-140.fbx.proxad.net [82.230.53.140]) (user=mullerp mech=LOGIN) by mailserver.u-strasbg.fr (8.14.3/jtpda-5.5pre1) with ESMTP id n5LGjEM5006711 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO) ; Sun, 21 Jun 2009 18:45:15 +0200 (CEST) (envelope-from muller@ics.u-strasbg.fr) From: "Pierre Muller" To: "'Eli Zaretskii'" , "'Pedro Alves'" Cc: References: <000501c9f12b$68c860e0$3a5922a0$@u-strasbg.fr> <200906210227.48175.pedro@codesourcery.com> In-Reply-To: Subject: RE: [RFA] testsuite/gdb.base/fullname.exp fix Date: Sun, 21 Jun 2009 16:45:00 -0000 Message-ID: <000301c9f28f$aa284220$fe78c660$@u-strasbg.fr> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable 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-06/txt/msg00548.txt.bz2 > -----Message d'origine----- > De=A0: gdb-patches-owner@sourceware.org [mailto:gdb-patches- > owner@sourceware.org] De la part de Eli Zaretskii > Envoy=E9=A0: Sunday, June 21, 2009 3:48 PM > =C0=A0: Pedro Alves > Cc=A0: gdb-patches@sourceware.org; muller@ics.u-strasbg.fr > Objet=A0: Re: [RFA] testsuite/gdb.base/fullname.exp fix >=20 > > From: Pedro Alves > > Date: Sun, 21 Jun 2009 02:27:47 +0100 > > Cc: "Pierre Muller" > > > > (I think Cygwin has now some magic to be able > > to remove open files? Maybe I'm dreaming.) >=20 > You can do that on Windows (only with NTFS, IIRC), but only if you use > CreateFile with the right flags to open the file. Guess what the MS > runtime does in its emulation of `open', `fopen' and friends. OK, now I understand: bfd seems to use these special flags, so that after putting a breakpoint on main you end up with two open handles on the executable (I found that out by debugging gdb with itself) and if you issue: (gdb) shell rm gdb.base/fullname.exe All works, in the sense that you are able to=20 delete the file despite the open handles. But the problem is that if you try that: (gdb) shell echo dummy > gdb.base/fullname.exe you get: sh: gdb.base/fullname.exe: Permission denied. So when trying to recompile fullname.exe GNU ld first erases the existing binary (=3D> success) and later tries to write the new binary (=3D> failure). What is the use of allowing delete operation and not write operation? Pierre