From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3392 invoked by alias); 22 Sep 2009 22:03:26 -0000 Received: (qmail 3251 invoked by uid 22791); 22 Sep 2009 22:03:25 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 22 Sep 2009 22:03:20 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id C3C782BAC05 for ; Tue, 22 Sep 2009 18:03:18 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 1xrTjOlSyblv for ; Tue, 22 Sep 2009 18:03:18 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 86BCF2BAC00 for ; Tue, 22 Sep 2009 18:03:18 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id 78BA6F593C; Tue, 22 Sep 2009 15:03:02 -0700 (PDT) Date: Tue, 22 Sep 2009 22:03:00 -0000 From: Joel Brobecker To: gdb-patches@sourceware.org Subject: Re: [RFC] Fix source path lookup immediately after substitute-path Message-ID: <20090922220302.GF8910@adacore.com> References: <20090922190632.GA31949@caradoc.them.org> <20090922212042.GE8910@adacore.com> <20090922214540.GA14014@caradoc.them.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090922214540.GA14014@caradoc.them.org> User-Agent: Mutt/1.5.18 (2008-05-17) Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2009-09/txt/msg00715.txt.bz2 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