From patchwork Wed Oct 23 18:55:52 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 35261 Received: (qmail 105060 invoked by alias); 23 Oct 2019 18:56:31 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 105048 invoked by uid 89); 23 Oct 2019 18:56:31 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-14.5 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy=HX-Languages-Length:1318 X-HELO: mail-oi1-f196.google.com Received: from mail-oi1-f196.google.com (HELO mail-oi1-f196.google.com) (209.85.167.196) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 23 Oct 2019 18:56:29 +0000 Received: by mail-oi1-f196.google.com with SMTP id k20so18336226oih.3 for ; Wed, 23 Oct 2019 11:56:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=nVjwZLwqjKhG9z+YvpOghwOlvQvy/DKz8a1rFIqIvsA=; b=NHd/4My02/9gI20YD+WxZMXzufu22VrRMnghHMahjHRzT9E71yzkAqOo2c5lBNC7iE So4vcITVpFfSwhCyZ30+m5i8a3w4wL4AD0sjHtH4YAAUUjTe0THrmtO7vcLfVhbDcs9t YJ07KNku4BEuihGQL1UHyaqSNP5FTLxbnGad0OmcsC9SDTqzXRlw1sX1Xtj04XzwjG2b PUjD3qQZyTzSRq/rGi3HM0yn4qQfjWxx2kGRhfeVO9pzi3Oo9wVUHdlIvC6yZfFopKtR rcFoTzc3yO9GDafIykQBLxDIzOgQXwfCJXJ8dnn7B4E7Zd1hjzYXotsfOp8tXNUxtoS3 DdrA== MIME-Version: 1.0 References: <20190726133422.5896-1-tromey@adacore.com> <20190726133422.5896-3-tromey@adacore.com> In-Reply-To: From: "H.J. Lu" Date: Wed, 23 Oct 2019 11:55:52 -0700 Message-ID: Subject: Re: [PATCH 2/4] Save plain text in the source cache To: Tom Tromey Cc: GDB X-IsSubscribed: yes On Tue, Oct 22, 2019 at 4:39 PM H.J. Lu wrote: > > On Fri, Jul 26, 2019 at 6:34 AM Tom Tromey wrote: > > > > Currently the source cache will only store highlighted text. However, > > there's no reason it could not also store plain text, when styling is > > turned off. > > > > This patch makes this change. This also simplifies the source cache > > code somewhat. > > > > gdb/ChangeLog > > 2019-07-26 Tom Tromey > > > > * source-cache.c (source_cache::get_plain_source_lines): > > Remove "first_line" and "last_line" parameters. > > (source_cache::get_source_lines): Cache plain text. > > * source-cache.h (class source_cache) > > : Update. > > This caused: > > https://sourceware.org/bugzilla/show_bug.cgi?id=25126 > > This works for my test case. diff --git a/gdb/symfile.c b/gdb/symfile.c index f74c6de596..95dba37eee 100644 --- a/gdb/symfile.c +++ b/gdb/symfile.c @@ -2518,6 +2518,9 @@ reread_symbols (void) automatically recreated by sym_read. */ free_objfile_separate_debug (objfile); + /* Clear the staled source cache. */ + forget_cached_source_info (); + /* Remove any references to this objfile in the global value lists. */ preserve_values (objfile);