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


> From:  Vladimir Prus <vladimir@codesourcery.com>
> Date:  Sun, 15 Jun 2008 00:03:26 +0400
> 
> > 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.

That can be said about every patch submitted here.  We still request
that contributors do a clean job, instead of allowing their patches to
go in, and then fixing their job by follow-up patches.  I'm saying
let's do a clean job in this case.

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

Because gdb_realpath is an infrastructure function, so we should care
about future, as yet non-existent, callers, not only about the
existing ones.

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

The question is, what kind of consistent behavior do we want.
Personally, I think realpath's behavior is wrong for most GDB usages,
that's why I suggested the alternative.


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