From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16678 invoked by alias); 22 Sep 2009 21:45:57 -0000 Received: (qmail 16666 invoked by uid 22791); 22 Sep 2009 21:45:55 -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 21:45:44 +0000 Received: from nan.false.org (localhost [127.0.0.1]) by nan.false.org (Postfix) with ESMTP id 36F9410DC7; Tue, 22 Sep 2009 21:45:41 +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 2088D10DB3; Tue, 22 Sep 2009 21:45:41 +0000 (GMT) Received: from drow by caradoc.them.org with local (Exim 4.69) (envelope-from ) id 1MqDB6-0003g9-EB; Tue, 22 Sep 2009 17:45:40 -0400 Date: Tue, 22 Sep 2009 21:45: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: <20090922214540.GA14014@caradoc.them.org> Mail-Followup-To: Joel Brobecker , gdb-patches@sourceware.org References: <20090922190632.GA31949@caradoc.them.org> <20090922212042.GE8910@adacore.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090922212042.GE8910@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/msg00713.txt.bz2 On Tue, Sep 22, 2009 at 02:20:42PM -0700, Joel Brobecker wrote: > Hi Daniel, > > > Any thoughts on this patch? May I include it in 7.0? > > My only thought was that last_source_visited is really only useful > to print_source_lines_base, and it's used as a mechanism to prevent > a warning from being printed every time we try to print source lines > for the same file. So I thought it might be cleaner if that global > was made static to print_source_lines_base. However, this wouldn't > work as is, as it turns out this is also used as a cache for source > file lookup! I'm guessing this is only a side-effect of the original > intent. > > I believe it would be cleaner to adjust the use of that variable > so as to make it static to print_source_lines_base, but this can > be addressed independently of your patch is someone is interested. > In the meantime, I think your patch is progress, and it seems fine > to put it in 7.0 as well. 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? -- Daniel Jacobowitz CodeSourcery