Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Dmitry Neverov <dmitry.neverov@jetbrains.com>
To: gdb-patches@sourceware.org
Cc: dmitry.neverov@jetbrains.com
Subject: [RFC v2][PR symtab/30520 2/4] gdb/symtab: reuse last segment lookup name info
Date: Tue, 23 Jan 2024 18:03:23 +0100	[thread overview]
Message-ID: <20240123170325.752251-2-dmitry.neverov@jetbrains.com> (raw)
In-Reply-To: <20240123170325.752251-1-dmitry.neverov@jetbrains.com>

Create lookup_name_info for the last segment in a qualified name
outside the loop. The symbol_name_match_type::SEARCH_NAME is used to
avoid redundant demangling: it was already performed in
lookup_name_without_params.split_name().
---
 gdb/dwarf2/read.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c
index b125b2e69f0..f539eb878a3 100644
--- a/gdb/dwarf2/read.c
+++ b/gdb/dwarf2/read.c
@@ -16638,6 +16638,9 @@ cooked_index_functions::expand_symtabs_matching
 	= lookup_name_without_params.split_name (lang);
       std::string last_name (name_vec.back ());
 
+      lookup_name_info last_segment_lookup_name (
+	last_name, symbol_name_match_type::SEARCH_NAME, completing, true);
+
       for (const cooked_index_entry *entry : table->find (last_name,
 							  completing))
 	{
@@ -16698,9 +16701,6 @@ cooked_index_functions::expand_symtabs_matching
 		  if (entry->lang != language_unknown)
 		    {
 		      const language_defn *lang_def = language_def (entry->lang);
-		      lookup_name_info last_segment_lookup_name (
-			last_name.data (), symbol_name_match_type::FULL,
-			false, true);
 		      symbol_name_matcher_ftype *name_matcher
 			= lang_def->get_symbol_name_matcher
 			  (last_segment_lookup_name);
-- 
2.39.2


  reply	other threads:[~2024-01-23 17:04 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-23 17:03 [RFC v2][PR symtab/30520 1/4] gdb/symtab: check name matches before expanding a CU Dmitry Neverov
2024-01-23 17:03 ` Dmitry Neverov [this message]
2024-01-23 17:03 ` [RFC v2][PR symtab/30520 3/4] gdb/symtab: compute match_type outside the loop Dmitry Neverov
2024-01-23 17:03 ` [RFC v2][PR symtab/30520 4/4] gdb/symtab: use symbol name matcher for all segments in a qualified name Dmitry Neverov
2024-01-25  8:44 ` [RFC v2][PR symtab/30520] gdb/symtab: fix the gdb.cp/anon-struct test Dmitry Neverov
2024-02-07 20:25   ` Tom Tromey
2024-02-09 16:32     ` Dmitry Neverov
2024-02-09 19:38       ` Tom Tromey
2024-03-18 16:35         ` Dmitry Neverov
2024-03-18 17:58           ` Tom Tromey
2024-03-19 12:16             ` Dmitry Neverov
2024-03-22 17:29               ` Tom Tromey
2024-05-04  1:20                 ` Joel Brobecker
2024-05-06 14:32                   ` Dmitry Neverov

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=20240123170325.752251-2-dmitry.neverov@jetbrains.com \
    --to=dmitry.neverov@jetbrains.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