public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] Simplify some symbol searches in linespec.c
@ 2024-01-28 23:44 Tom Tromey
  0 siblings, 0 replies; only message in thread
From: Tom Tromey @ 2024-01-28 23:44 UTC (permalink / raw)
  To: gdb-cvs

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=b5c7440b44fe5e6c53603506b8465c1d35758678

commit b5c7440b44fe5e6c53603506b8465c1d35758678
Author: Tom Tromey <tom@tromey.com>
Date:   Fri Sep 1 14:05:04 2023 -0600

    Simplify some symbol searches in linespec.c
    
    This simplifies some symbol searches in linespec.c.  In particular,
    two separate searches here can now be combined into one, due to the
    new use of flags.
    
    Arguably the STRUCT_DOMAIN searches should perhaps not even be done.
    Only C really has these, and C doesn't have member functions.
    However, it seems relatively harmless -- and clearly compatible -- to
    leave this in.

Diff:
---
 gdb/linespec.c | 16 ++++------------
 1 file changed, 4 insertions(+), 12 deletions(-)

diff --git a/gdb/linespec.c b/gdb/linespec.c
index 4e43bf28a67..b5bbd8c433c 100644
--- a/gdb/linespec.c
+++ b/gdb/linespec.c
@@ -3446,14 +3446,9 @@ lookup_prefix_sym (struct linespec_state *state,
   for (const auto &elt : file_symtabs)
     {
       if (elt == nullptr)
-	{
-	  iterate_over_all_matching_symtabs (state, lookup_name,
-					     SEARCH_STRUCT_DOMAIN,
-					     NULL, false, collector);
-	  iterate_over_all_matching_symtabs (state, lookup_name,
-					     SEARCH_VFT,
-					     NULL, false, collector);
-	}
+	iterate_over_all_matching_symtabs (state, lookup_name,
+					   SEARCH_STRUCT_DOMAIN | SEARCH_VFT,
+					   NULL, false, collector);
       else
 	{
 	  /* Program spaces that are executing startup should have
@@ -3463,10 +3458,7 @@ lookup_prefix_sym (struct linespec_state *state,
 	  gdb_assert (!pspace->executing_startup);
 	  set_current_program_space (pspace);
 	  iterate_over_file_blocks (elt, lookup_name,
-				    SEARCH_STRUCT_DOMAIN,
-				    collector);
-	  iterate_over_file_blocks (elt, lookup_name,
-				    SEARCH_VFT,
+				    SEARCH_STRUCT_DOMAIN | SEARCH_VFT,
 				    collector);
 	}
     }

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-01-28 23:44 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-28 23:44 [binutils-gdb] Simplify some symbol searches in linespec.c Tom Tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).