From patchwork Sat Feb 15 16:54:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 38097 Received: (qmail 85216 invoked by alias); 15 Feb 2020 16:54:51 -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 85180 invoked by uid 89); 15 Feb 2020 16:54:50 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-20.5 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS autolearn=ham version=3.3.1 spammy= X-HELO: gateway33.websitewelcome.com Received: from gateway33.websitewelcome.com (HELO gateway33.websitewelcome.com) (192.185.146.21) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 15 Feb 2020 16:54:48 +0000 Received: from cm14.websitewelcome.com (cm14.websitewelcome.com [100.42.49.7]) by gateway33.websitewelcome.com (Postfix) with ESMTP id 4CE8610B4384 for ; Sat, 15 Feb 2020 10:54:47 -0600 (CST) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id 30iNjoLhuXVkQ30iNjBtSl; Sat, 15 Feb 2020 10:54:47 -0600 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Sender:Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=M7gTEi3KBTAcQYQpexISnLI12uPKjk2cRBJhWyVyPt4=; b=YBT28qy6XDwkf/sSU/XrG+ErYx ghxJhNlvmTOGQX5bZBrdEd9w4HdXIsQnDJsQIgoDyJHWZZiT3O6/0WxXkQgKUZOI3ljLLfs/hWZo2 k1Msh7rD4xVLDsamTQvJ57/5R; Received: from 75-166-123-50.hlrn.qwest.net ([75.166.123.50]:45240 helo=bapiya.Home) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92) (envelope-from ) id 1j30iN-000xcC-1H; Sat, 15 Feb 2020 09:54:47 -0700 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH 02/14] Simplify setting of reading_partial_symbols Date: Sat, 15 Feb 2020 09:54:32 -0700 Message-Id: <20200215165444.32653-3-tom@tromey.com> In-Reply-To: <20200215165444.32653-1-tom@tromey.com> References: <20200215165444.32653-1-tom@tromey.com> This simplifies the setting and clearing of reading_partial_symbols, by using scoped_restore in the function that reads partial symbols. gdb/ChangeLog 2020-02-15 Tom Tromey * dwarf2read.c (dwarf2_build_psymtabs_hard): Use make_scoped_restore. (dwarf2_psymtab::read_symtab): Don't clear reading_partial_symbols. --- gdb/ChangeLog | 7 +++++++ gdb/dwarf2/read.c | 6 +++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c index e373cc0af2c..81d8cbf0b13 100644 --- a/gdb/dwarf2/read.c +++ b/gdb/dwarf2/read.c @@ -7731,7 +7731,9 @@ dwarf2_build_psymtabs_hard (struct dwarf2_per_objfile *dwarf2_per_objfile) objfile_name (objfile)); } - dwarf2_per_objfile->reading_partial_symbols = 1; + scoped_restore restore_reading_psyms + = make_scoped_restore (&dwarf2_per_objfile->reading_partial_symbols, + true); dwarf2_per_objfile->info.read (objfile); @@ -8705,8 +8707,6 @@ dwarf2_psymtab::read_symtab (struct objfile *objfile) = dpo_backlink->has_section_at_zero; } - dwarf2_per_objfile->reading_partial_symbols = 0; - expand_psymtab (objfile); process_cu_includes (dwarf2_per_objfile);