This is the mail archive of the
mailing list for the GDB project.
RE: [RFA] testsuite/gdb.base/fullname.exp fix
> -----Message d'origine-----
> De?: email@example.com [mailto:gdb-patches-
> firstname.lastname@example.org] De la part de Eli Zaretskii
> Envoyé?: Sunday, June 21, 2009 3:48 PM
> À?: Pedro Alves
> Cc?: email@example.com; firstname.lastname@example.org
> Objet?: Re: [RFA] testsuite/gdb.base/fullname.exp fix
> > From: Pedro Alves <email@example.com>
> > Date: Sun, 21 Jun 2009 02:27:47 +0100
> > Cc: "Pierre Muller" <firstname.lastname@example.org>
> > (I think Cygwin has now some magic to be able
> > to remove open files? Maybe I'm dreaming.)
> 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
delete the file despite the open handles.
But the problem is that if you try that:
(gdb) shell echo dummy > gdb.base/fullname.exe
sh: gdb.base/fullname.exe: Permission denied.
So when trying to recompile fullname.exe
GNU ld first erases the existing binary (=> success)
and later tries to write the new binary (=> failure).
What is the use of allowing delete operation and not write operation?