This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFC] Fix source path lookup immediately after substitute-path
On Tue, Sep 22, 2009 at 03:03:02PM -0700, Joel Brobecker wrote:
> 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) :).
Yes, thank you :-)
> > 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.
Oh, I understand now. In the specific case of a failed lookup, it's
used as a cache. It's never used to cache a successful lookup - if
!last_source_error, we'll always call openp again.
I agree that this is not particularly important either way. Thanks
for explaining!
--
Daniel Jacobowitz
CodeSourcery