Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: "Pierre Muller" <muller@ics.u-strasbg.fr>
Cc: pedro@codesourcery.com, gdb-patches@sourceware.org
Subject: Re: [RFA] testsuite/gdb.base/fullname.exp fix
Date: Sun, 21 Jun 2009 23:17:00 -0000	[thread overview]
Message-ID: <E1MIWHQ-00010J-Ns@fencepost.gnu.org> (raw)
In-Reply-To: <000301c9f28f$aa284220$fe78c660$@u-strasbg.fr> 	(muller@ics.u-strasbg.fr)

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


  reply	other threads:[~2009-06-21 23:17 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-19 22:15 Pierre Muller
2009-06-21  1:27 ` Pedro Alves
2009-06-21 13:48   ` Eli Zaretskii
2009-06-21 16:45     ` Pierre Muller
2009-06-21 23:17       ` Eli Zaretskii [this message]
2009-06-25 22:29         ` Pierre Muller
2009-06-27 14:39           ` Eli Zaretskii

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=E1MIWHQ-00010J-Ns@fencepost.gnu.org \
    --to=eliz@gnu.org \
    --cc=gdb-patches@sourceware.org \
    --cc=muller@ics.u-strasbg.fr \
    --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