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: Better realpath


> Date: Sun, 15 Jun 2008 21:29:33 -0400
> From: Daniel Jacobowitz <drow@false.org>
> Cc: vladimir@codesourcery.com, gdb-patches@sources.redhat.com
> 
> On Sun, Jun 15, 2008 at 08:58:29PM +0300, Eli Zaretskii wrote:
> > I don't mind doing so, although libiberty has other customers, which
> > could make it harder for us to do what we think is right (if it
> > happens to be different from what lrealpath does now).  Note that
> > right now, lrealpath does not behave consistently with realpath (if
> > the latter is unavailable), so it cannot be regarded as a portable
> > version of realpath, at least not entirely so.
> 
> I assume that it is simply an oversight when Windows support was
> added

But canonicalize_filename also behaves like the Windows version does.

> > Not just for GDB, in general as well: it doesn't seem right to me to
> > expand a file name and check for its existence in the same primitive,
> > not to mention refuse to produce an expansion if the file does not
> > exist.  These are two separate tests, so they should be kept separate.
> > (I actually suspect that realpath was used because it's more
> > convenient -- no messy memory allocation issues -- but I have no facts
> > to back this up.)
> 
> On the other hand, it seems perfectly reasonable to me; we can't know
> where the file would really be if it existed, unless it exists, since
> we don't know whether it would be a symlink.

I don't see any problem with this behavior for non-existing files.
And, if we want to resolve symlinks, the Windows code should also do
that.


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