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


Eli Zaretskii wrote:

>> From: Vladimir Prus <vladimir@codesourcery.com>
>> Date: Sat, 14 Jun 2008 16:14:07 +0400
>> Cc: gdb-patches@sources.redhat.com
>> 
>> Speaking of the issues you've raised in:
>> 
>> http://sourceware.org/ml/gdb-patches/2005-05/msg00612.html
>> 
>> I think that:
>> 
>> 1. The order of slashes is a cosmetic issue.
>> 2. The case of filenames is also a cosmetic issues.
> 
> Would it surprise you that I disagree?
> 
> Fixing those is not a big deal, so how about making gdb_realpath
> correct both cosmetically and behavior-wise?

I'm not sure how big deal that is, but it appears we have a major
functionality bug for 3 years already, at least. I'm interested in
fixing that bug, and if somebody (for example you) find those cosmetic
changes important, I think they can be address by follow-up patches.

>> 3. The matter of filename existance is a behaviour issue, and I think
>> I can modify gdb_realpath to perform a check explicitly. OTOH, it's not
>> clear if any code actually expects file existane check to be performed.
> 
> I don't think it matters whether the callers expect it or not.  As
> long as we use realpath, which always checks the result for existence,
> we should do the same in the other branches, so that the resulting GDB
> function behaves consistently.  

If no caller of that function cares about this aspect of behaviour, why
should we bother about consistency. But anyway...

> Alternatively, we could refrain from 
> using realpath, in which case we should consistently _not_ require
> that the file exists.

... as I've said, I can modify gdb_realpath to check for file existance,
on Windows, which will make the behaviour of gdb_realpath the same
everywhere. 

- Volodya



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