This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: [RFA] testsuite/gdb.base/fullname.exp fix


> -----Message d'origine-----
> De?: gdb-patches-owner@sourceware.org [mailto:gdb-patches-
> owner@sourceware.org] De la part de Eli Zaretskii
> Envoyé?: Sunday, June 21, 2009 3:48 PM
> À?: Pedro Alves
> Cc?: gdb-patches@sourceware.org; muller@ics.u-strasbg.fr
> Objet?: Re: [RFA] testsuite/gdb.base/fullname.exp fix
> 
> > From: Pedro Alves <pedro@codesourcery.com>
> > Date: Sun, 21 Jun 2009 02:27:47 +0100
> > Cc: "Pierre Muller" <muller@ics.u-strasbg.fr>
> >
> > (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
you get:
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?

Pierre


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]