Allow passing a block to lookup_global_symbol_from_objfile
[deliverable/binutils-gdb.git] / gdb / symtab.c
index 5b8bfc1df7e44bcc8d04900748dec6466beabce1..87a0c8e4da6eb420098f5433444e5ee8a3e1f8f2 100644 (file)
@@ -2224,15 +2224,18 @@ lookup_symbol_in_block (const char *name, symbol_name_match_type match_type,
 
 struct block_symbol
 lookup_global_symbol_from_objfile (struct objfile *main_objfile,
+                                  enum block_enum block_index,
                                   const char *name,
                                   const domain_enum domain)
 {
+  gdb_assert (block_index == GLOBAL_BLOCK || block_index == STATIC_BLOCK);
+
   for (objfile *objfile : main_objfile->separate_debug_objfiles ())
     {
       struct block_symbol result
-        = lookup_symbol_in_objfile (objfile, GLOBAL_BLOCK, name, domain);
+        = lookup_symbol_in_objfile (objfile, block_index, name, domain);
 
-      if (result.symbol != NULL)
+      if (result.symbol != nullptr)
        return result;
     }
 
This page took 0.029011 seconds and 4 git commands to generate.