Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Joel Brobecker <brobecker@adacore.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: gdb-patches@sourceware.org
Subject: Re: [RFA/commit] Improve gdb_realpath for Windows hosts
Date: Thu, 22 Dec 2011 18:16:00 -0000	[thread overview]
Message-ID: <20111222175918.GU23376@adacore.com> (raw)
In-Reply-To: <837h1ozf6p.fsf@gnu.org>

> > gdb/ChangeLog:
> > 
> >         * utils.c (gdb_realpath): Add better support for Windows hosts.
> > 
> > Tested on x86-windows. Any objection to this?
> 
> Looks good to me.  Although there's a subtle semantic difference
> between `realpath' on Posix platforms and GetFullPathName: the former
> requires the file to exist, while the latter does not.  But I reckon
> we handle this somewhere...

Thanks for taking a look!

I was not aware of its behavior when the file does not exist.
It's strange, because MSN says:

    This function does not verify that the resulting path and file
    name are valid, or that they see an existing file on the associated
    volume.

It's ambiguous, and you're probably right. But it explains
my surprise.

That being said, it's treated as a normalization error, and
we fallback to xstrdup in that case, hoping that the user then
uses the a filename that matches according to filename_cmp
(it deals with casing and directory separators, but not the
case of consecutive directory separators). In other words,
if the file does not exist, we're back to where we were before
this patch.

> Did you test this with UNC file names?

I did not test with UNC file names, no. Mostly because it never
entered my mind. I'm not a Windows person I'm afraid, never used it
unless asked to fix a bug that reproduces on this system only. And
I don't know if this is something I could do with our machines at
work.

That being said, MSDN does confirm that it should work (I think!):

    Share and volume names are valid input for lpFileName. For example,
    the following list identities the returned path and file names if
    test-2 is a remote computer [...]:

        # If you specify "\\test-2\q$\lh" the path returned is
          "\\test-2\q$\lh"

        # If you specify "\\?\UNC\test-2\q$\lh" the path returned is
          "\\?\UNC\test-2\q$\lh"

-- 
Joel


  reply	other threads:[~2011-12-22 17:59 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-22 17:31 Joel Brobecker
2011-12-22 17:59 ` Eli Zaretskii
2011-12-22 18:16   ` Joel Brobecker [this message]
2011-12-27  4:11 ` Checked in: " Joel Brobecker
2011-12-27 12:40 ` asmwarrior
2011-12-27 13:47   ` Joel Brobecker
2011-12-27 14:00     ` asmwarrior
2011-12-27 14:12     ` asmwarrior
2011-12-27 14:35       ` Joel Brobecker
2011-12-27 16:26         ` asmwarrior

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=20111222175918.GU23376@adacore.com \
    --to=brobecker@adacore.com \
    --cc=eliz@gnu.org \
    --cc=gdb-patches@sourceware.org \
    /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