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


> From: "Pierre Muller" <muller@ics.u-strasbg.fr>
> Cc: <gdb-patches@sourceware.org>
> Date: Sun, 21 Jun 2009 18:45:18 +0200
> Content-Language: en-us
> 
> OK, now I understand:
>   bfd seems to use these special flags,

Actually, it probably doesn't.  See below.

> 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?

That is all in the flags used when opening the file.  With the right
flags, write will also be permitted.  But I think for that we will
need our own emulation of `open' and friends, because the one in the
Windows runtime doesn't use them.  And even then, what NTFS does is
not fully Posix compliant: for example, the deleted file is still
visible in the filesystem, as long as at least one program has an open
handle for it, try running `ls' and you will see it.

So, on balance, I'd suggest to fix the testsuite not to expect this
Posix semantics, at least not on DOS/Windows.


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