From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31401 invoked by alias); 22 Sep 2009 21:21:07 -0000 Received: (qmail 31392 invoked by uid 22791); 22 Sep 2009 21:21:07 -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 21:21:01 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 78E4D2BABAE for ; Tue, 22 Sep 2009 17:20:59 -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 ce+pqEJPyKWR for ; Tue, 22 Sep 2009 17:20:59 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 3BB302BABA2 for ; Tue, 22 Sep 2009 17:20:59 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id D3254F593C; Tue, 22 Sep 2009 14:20:42 -0700 (PDT) Date: Tue, 22 Sep 2009 21:21:00 -0000 From: Joel Brobecker To: gdb-patches@sourceware.org Subject: Re: [RFC] Fix source path lookup immediately after substitute-path Message-ID: <20090922212042.GE8910@adacore.com> References: <20090922190632.GA31949@caradoc.them.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090922190632.GA31949@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/msg00712.txt.bz2 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. > 2009-09-22 Daniel Jacobowitz > > gdb/ > * source.c (forget_cached_source_info): Clear last_source_visited. > (init_last_source_visited): Delete. > (directory_command): Do not clear last_source_visited. Call > forget_cached_source_info only if required. > (unset_substitute_path_command, set_substitute_path_command): Call > forget_cached_source_info. > * mi/mi-cmd-env.c (mi_cmd_env_dir): Do not call > init_last_source_visited. > * defs.h (init_last_source_visited): Delete declaration. -- Joel