From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from rock.gnat.com (rock.gnat.com [IPv6:2620:20:4000:0:a9e:1ff:fe9b:1d1]) by sourceware.org (Postfix) with ESMTP id A8B59395C047 for ; Wed, 20 May 2020 17:40:35 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org A8B59395C047 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tromey@adacore.com Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 82DF256195; Wed, 20 May 2020 13:40:35 -0400 (EDT) X-Virus-Scanned: Debian amavisd-new at gnat.com 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 eTxSOndercQL; Wed, 20 May 2020 13:40:35 -0400 (EDT) Received: from murgatroyd.Home (174-16-104-48.hlrn.qwest.net [174.16.104.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by rock.gnat.com (Postfix) with ESMTPSA id 494E1117429; Wed, 20 May 2020 13:40:35 -0400 (EDT) From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH 4/4] Use add_partial_symbol in load_partial_dies Date: Wed, 20 May 2020 11:40:32 -0600 Message-Id: <20200520174032.9525-5-tromey@adacore.com> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20200520174032.9525-1-tromey@adacore.com> References: <20200520174032.9525-1-tromey@adacore.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-15.5 required=5.0 tests=BAYES_00, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, RCVD_IN_BARRACUDACENTRAL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 May 2020 17:40:36 -0000 An earlier patch added the add_partial_symbol helper function to dwarf2/read.c. However, a couple of calls to add_psymbol_to_list were left in place. It turns out that these calls slow down partial symbol reading, because they still go via the path that tries to needlessly demangle already-demangled names. This patch improves the performance of partial symbol reading by changing this code to use add_partial_symbol instead. The run previous to this had times of (see the first patch in the series for an explanation): gdb 1.64 libxul 1.99 Ada 2.47 This patch improves the times to: gdb 1.47 libxul 1.89 Ada 2.39 gdb/ChangeLog 2020-05-20 Tom Tromey * dwarf2/read.c (load_partial_dies): Use add_partial_symbol. --- gdb/ChangeLog | 4 ++++ gdb/dwarf2/read.c | 13 +++---------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c index b40857be5e4..363468f3683 100644 --- a/gdb/dwarf2/read.c +++ b/gdb/dwarf2/read.c @@ -18190,10 +18190,8 @@ load_partial_dies (const struct die_reader_specs *reader, || pdi.tag == DW_TAG_subrange_type)) { if (building_psymtab && pdi.raw_name != NULL) - add_psymbol_to_list (pdi.name (cu), false, - VAR_DOMAIN, LOC_TYPEDEF, -1, - psymbol_placement::STATIC, - 0, cu->language, objfile); + add_partial_symbol (&pdi, cu); + info_ptr = locate_pdi_sibling (reader, &pdi, info_ptr); continue; } @@ -18224,12 +18222,7 @@ load_partial_dies (const struct die_reader_specs *reader, if (pdi.raw_name == NULL) complaint (_("malformed enumerator DIE ignored")); else if (building_psymtab) - add_psymbol_to_list (pdi.name (cu), false, - VAR_DOMAIN, LOC_CONST, -1, - cu->language == language_cplus - ? psymbol_placement::GLOBAL - : psymbol_placement::STATIC, - 0, cu->language, objfile); + add_partial_symbol (&pdi, cu); info_ptr = locate_pdi_sibling (reader, &pdi, info_ptr); continue; -- 2.21.3