Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tromey@adacore.com>
To: gdb-patches@sourceware.org
Cc: Tom Tromey <tromey@adacore.com>
Subject: [PATCH 4/4] Use add_partial_symbol in load_partial_dies
Date: Wed, 20 May 2020 11:40:32 -0600	[thread overview]
Message-ID: <20200520174032.9525-5-tromey@adacore.com> (raw)
In-Reply-To: <20200520174032.9525-1-tromey@adacore.com>

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  <tromey@adacore.com>

	* 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



  parent reply	other threads:[~2020-05-20 17:40 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-20 17:40 [PATCH 0/4] Micro-optimize DWARF partial symbol reading Tom Tromey
2020-05-20 17:40 ` [PATCH 1/4] Attribute method inlining Tom Tromey
2020-05-20 19:40   ` Tom Tromey
2020-05-21  1:08   ` Hannes Domani
2020-05-21 14:26     ` Pedro Alves
2020-05-21 15:03       ` Hannes Domani
2020-05-21 16:42         ` Pedro Alves
2020-05-21 17:18           ` Hannes Domani
2020-05-22 15:47             ` Pedro Alves
2020-05-22 20:28               ` Pedro Alves
2020-05-20 17:40 ` [PATCH 2/4] Lazily compute partial DIE name Tom Tromey
2020-05-20 17:40 ` [PATCH 3/4] Inline abbrev lookup Tom Tromey
2020-05-20 17:40 ` Tom Tromey [this message]
2020-05-20 19:30 ` [PATCH 0/4] Micro-optimize DWARF partial symbol reading Christian Biesinger
2020-05-20 21:08 ` Simon Marchi
2020-05-27 17:48 ` Tom Tromey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200520174032.9525-5-tromey@adacore.com \
    --to=tromey@adacore.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox