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: [RFC] Fix source path lookup immediately after substitute-path


Before I answer your question, I just wanted to point out that I did
review the patch, and that it seemed good to me (progress, even) :).

> last_source_visited is the direct cause of the problem I've fixed with
> this patch.  External circumstances, like "dir" or "cd" or "set
> substitute-path" have to be able to invalidate the cache, so it has to
> be accessible outside the function.  Have I misunderstood?

The comments for last_source_visited are saying that this variable
is meant to help us avoid printing the file-does-not-exist error
message more than once if we repeateadly try to list that same file.
However, in practice, this variable is also used to cache the result
of the lookup. If we deem the caching action unnecessary, and limit
its use to exclusively preventing the error message from being printed
more than once, then this variable can be made static; it would be
easier to understand the purpose of this variable and follow its life
cycle.  That being said, the "if" here is whether the caching is
sufficiently desirable that we want to use that variable for both
aspects.

Again, this can be discussed seperately from your patch.


-- 
Joel


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