From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22368 invoked by alias); 22 Sep 2009 22:12:40 -0000 Received: (qmail 22360 invoked by uid 22791); 22 Sep 2009 22:12:39 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from NaN.false.org (HELO nan.false.org) (208.75.86.248) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 22 Sep 2009 22:12:36 +0000 Received: from nan.false.org (localhost [127.0.0.1]) by nan.false.org (Postfix) with ESMTP id BDD2F10DC7; Tue, 22 Sep 2009 22:12:34 +0000 (GMT) Received: from caradoc.them.org (209.195.188.212.nauticom.net [209.195.188.212]) by nan.false.org (Postfix) with ESMTP id 94AFB10DB3; Tue, 22 Sep 2009 22:12:34 +0000 (GMT) Received: from drow by caradoc.them.org with local (Exim 4.69) (envelope-from ) id 1MqDb7-0004In-P4; Tue, 22 Sep 2009 18:12:33 -0400 Date: Tue, 22 Sep 2009 22:12:00 -0000 From: Daniel Jacobowitz To: Joel Brobecker Cc: gdb-patches@sourceware.org Subject: Re: [RFC] Fix source path lookup immediately after substitute-path Message-ID: <20090922221233.GA16036@caradoc.them.org> Mail-Followup-To: Joel Brobecker , gdb-patches@sourceware.org References: <20090922190632.GA31949@caradoc.them.org> <20090922212042.GE8910@adacore.com> <20090922214540.GA14014@caradoc.them.org> <20090922220302.GF8910@adacore.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090922220302.GF8910@adacore.com> User-Agent: Mutt/1.5.20 (2009-06-14) X-IsSubscribed: yes 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/msg00716.txt.bz2 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