[26/28] Convert lookup_symbol_in_objfile

Message ID 20250311-search-in-psyms-v1-26-d73d9be20983@tromey.com
State New
Headers
Series Search symbols via quick API |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_gdb_build--master-arm success Build passed
linaro-tcwg-bot/tcwg_gdb_build--master-aarch64 success Build passed
linaro-tcwg-bot/tcwg_gdb_check--master-arm fail Test failed
linaro-tcwg-bot/tcwg_gdb_check--master-aarch64 fail Test failed

Commit Message

Tom Tromey March 11, 2025, 2:13 p.m. UTC
  This converts lookup_symbol_in_objfile to the callback approach by
removing the call to lookup_symbol_in_objfile_symtabs.  (The latter is
not removed as there are still other callers.)

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=16994
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=16998
---
 gdb/symtab.c | 16 ++--------------
 1 file changed, 2 insertions(+), 14 deletions(-)
  

Patch

diff --git a/gdb/symtab.c b/gdb/symtab.c
index dee25051c85db6444687ead8524281bb482c03eb..c325432f7af0f1f6811916406e7c8b902c5852ee 100644
--- a/gdb/symtab.c
+++ b/gdb/symtab.c
@@ -2595,24 +2595,12 @@  lookup_symbol_in_objfile (struct objfile *objfile, enum block_enum block_index,
 			      ? "GLOBAL_BLOCK" : "STATIC_BLOCK",
 			      name, domain_name (domain).c_str ());
 
-  result = lookup_symbol_in_objfile_symtabs (objfile, block_index,
-					     name, domain);
-  if (result.symbol != NULL)
-    {
-      symbol_lookup_debug_printf
-	("lookup_symbol_in_objfile (...) = %s (in symtabs)",
-	 host_address_to_string (result.symbol));
-      return result;
-    }
-
   result = lookup_symbol_via_quick_fns (objfile, block_index,
 					name, domain);
-  symbol_lookup_debug_printf ("lookup_symbol_in_objfile (...) = %s%s",
+  symbol_lookup_debug_printf ("lookup_symbol_in_objfile (...) = %s",
 			      result.symbol != NULL
 			      ? host_address_to_string (result.symbol)
-			      : "NULL",
-			      result.symbol != NULL ? " (via quick fns)"
-			      : "");
+			      : "NULL");
   return result;
 }