Change all_objfiles adapter to be a method on program_space
[deliverable/binutils-gdb.git] / gdb / symtab.c
index b6751bec6baa6aec2a21bb6e1c6e843682bdc397..370c8b45b3268bc1945ddc09dffa2ca77a6fbdda 100644 (file)
@@ -473,7 +473,7 @@ iterate_over_symtabs (const char *name,
       gdb_assert (IS_ABSOLUTE_PATH (real_path.get ()));
     }
 
-  for (objfile *objfile : all_objfiles (current_program_space))
+  for (objfile *objfile : current_program_space->objfiles ())
     {
       if (iterate_over_some_symtabs (name, real_path.get (),
                                     objfile->compunit_symtabs, NULL,
@@ -484,7 +484,7 @@ iterate_over_symtabs (const char *name,
   /* Same search rules as above apply here, but now we look thru the
      psymtabs.  */
 
-  for (objfile *objfile : all_objfiles (current_program_space))
+  for (objfile *objfile : current_program_space->objfiles ())
     {
       if (objfile->sf
          && objfile->sf->qf->map_symtabs_matching_filename (objfile,
@@ -1010,7 +1010,7 @@ matching_obj_sections (struct obj_section *obj_first,
   /* Otherwise check that they are in corresponding objfiles.  */
 
   struct objfile *obj = NULL;
-  for (objfile *objfile : all_objfiles (current_program_space))
+  for (objfile *objfile : current_program_space->objfiles ())
     if (objfile->obfd == first->owner)
       {
        obj = objfile;
@@ -1047,7 +1047,7 @@ expand_symtab_containing_pc (CORE_ADDR pc, struct obj_section *section)
          || MSYMBOL_TYPE (msymbol.minsym) == mst_file_bss))
     return;
 
-  for (objfile *objfile : all_objfiles (current_program_space))
+  for (objfile *objfile : current_program_space->objfiles ())
     {
       struct compunit_symtab *cust = NULL;
 
@@ -2169,7 +2169,7 @@ lookup_objfile_from_block (const struct block *block)
 
   block = block_global_block (block);
   /* Look through all blockvectors.  */
-  for (objfile *obj : all_objfiles (current_program_space))
+  for (objfile *obj : current_program_space->objfiles ())
     {
       for (compunit_symtab *cust : objfile_compunits (obj))
        if (block == BLOCKVECTOR_BLOCK (COMPUNIT_BLOCKVECTOR (cust),
@@ -2588,7 +2588,7 @@ lookup_static_symbol (const char *name, const domain_enum domain)
       return result;
     }
 
-  for (objfile *objfile : all_objfiles (current_program_space))
+  for (objfile *objfile : current_program_space->objfiles ())
     {
       result = lookup_symbol_in_objfile (objfile, STATIC_BLOCK, name, domain);
       if (result.symbol != NULL)
@@ -2795,14 +2795,14 @@ basic_lookup_transparent_type (const char *name)
      of the desired name as a global, then do psymtab-to-symtab
      conversion on the fly and return the found symbol.  */
 
-  for (objfile *objfile : all_objfiles (current_program_space))
+  for (objfile *objfile : current_program_space->objfiles ())
     {
       t = basic_lookup_transparent_type_1 (objfile, GLOBAL_BLOCK, name);
       if (t)
        return t;
     }
 
-  for (objfile *objfile : all_objfiles (current_program_space))
+  for (objfile *objfile : current_program_space->objfiles ())
     {
       t = basic_lookup_transparent_type_quick (objfile, GLOBAL_BLOCK, name);
       if (t)
@@ -2816,14 +2816,14 @@ basic_lookup_transparent_type (const char *name)
      of the desired name as a file-level static, then do psymtab-to-symtab
      conversion on the fly and return the found symbol.  */
 
-  for (objfile *objfile : all_objfiles (current_program_space))
+  for (objfile *objfile : current_program_space->objfiles ())
     {
       t = basic_lookup_transparent_type_1 (objfile, STATIC_BLOCK, name);
       if (t)
        return t;
     }
 
-  for (objfile *objfile : all_objfiles (current_program_space))
+  for (objfile *objfile : current_program_space->objfiles ())
     {
       t = basic_lookup_transparent_type_quick (objfile, STATIC_BLOCK, name);
       if (t)
@@ -2902,7 +2902,7 @@ find_pc_sect_compunit_symtab (CORE_ADDR pc, struct obj_section *section)
      It also happens for objfiles that have their functions reordered.
      For these, the symtab we are looking for is not necessarily read in.  */
 
-  for (objfile *obj_file : all_objfiles (current_program_space))
+  for (objfile *obj_file : current_program_space->objfiles ())
     {
       for (compunit_symtab *cust : objfile_compunits (obj_file))
        {
@@ -2964,7 +2964,7 @@ find_pc_sect_compunit_symtab (CORE_ADDR pc, struct obj_section *section)
 
   /* Not found in symtabs, search the "quick" symtabs (e.g. psymtabs).  */
 
-  for (objfile *objf : all_objfiles (current_program_space))
+  for (objfile *objf : current_program_space->objfiles ())
     {
       struct compunit_symtab *result;
 
@@ -2996,7 +2996,7 @@ find_pc_compunit_symtab (CORE_ADDR pc)
 struct symbol *
 find_symbol_at_address (CORE_ADDR address)
 {
-  for (objfile *objfile : all_objfiles (current_program_space))
+  for (objfile *objfile : current_program_space->objfiles ())
     {
       if (objfile->sf == NULL
          || objfile->sf->qf->find_compunit_symtab_by_address == NULL)
@@ -3351,14 +3351,14 @@ find_line_symtab (struct symtab *sym_tab, int line,
       else
        best = 0;
 
-      for (objfile *objfile : all_objfiles (current_program_space))
+      for (objfile *objfile : current_program_space->objfiles ())
        {
          if (objfile->sf)
            objfile->sf->qf->expand_symtabs_with_fullname
              (objfile, symtab_to_fullname (sym_tab));
        }
 
-      for (objfile *objfile : all_objfiles (current_program_space))
+      for (objfile *objfile : current_program_space->objfiles ())
        {
          for (compunit_symtab *cu : objfile_compunits (objfile))
            {
@@ -4198,7 +4198,7 @@ info_sources_command (const char *ignore, int from_tty)
   printf_filtered ("Source files for which symbols have been read in:\n\n");
 
   data.first = 1;
-  for (objfile *objfile : all_objfiles (current_program_space))
+  for (objfile *objfile : current_program_space->objfiles ())
     {
       for (compunit_symtab *cu : objfile_compunits (objfile))
        {
@@ -4453,7 +4453,7 @@ search_symbols (const char *regexp, enum search_domain kind,
 
   if (nfiles == 0 && (kind == VARIABLES_DOMAIN || kind == FUNCTIONS_DOMAIN))
     {
-      for (objfile *objfile : all_objfiles (current_program_space))
+      for (objfile *objfile : current_program_space->objfiles ())
        {
          for (minimal_symbol *msymbol : objfile_msymbols (objfile))
            {
@@ -4490,7 +4490,7 @@ search_symbols (const char *regexp, enum search_domain kind,
        }
     }
 
-  for (objfile *objfile : all_objfiles (current_program_space))
+  for (objfile *objfile : current_program_space->objfiles ())
     {
       for (compunit_symtab *cust : objfile_compunits (objfile))
        {
@@ -4556,7 +4556,7 @@ search_symbols (const char *regexp, enum search_domain kind,
   if ((found_misc || (nfiles == 0 && kind != FUNCTIONS_DOMAIN))
       && !treg.has_value ())
     {
-      for (objfile *objfile : all_objfiles (current_program_space))
+      for (objfile *objfile : current_program_space->objfiles ())
        {
          for (minimal_symbol *msymbol : objfile_msymbols (objfile))
            {
@@ -5272,7 +5272,7 @@ default_collect_symbol_completion_matches_break_on
 
   if (code == TYPE_CODE_UNDEF)
     {
-      for (objfile *objfile : all_objfiles (current_program_space))
+      for (objfile *objfile : current_program_space->objfiles ())
        {
          for (minimal_symbol *msymbol : objfile_msymbols (objfile))
            {
@@ -5291,7 +5291,7 @@ default_collect_symbol_completion_matches_break_on
     }
 
   /* Add completions for all currently loaded symbol tables.  */
-  for (objfile *objfile : all_objfiles (current_program_space))
+  for (objfile *objfile : current_program_space->objfiles ())
     {
       for (compunit_symtab *cust : objfile_compunits (objfile))
        add_symtab_completions (cust, tracker, mode, lookup_name,
@@ -5600,7 +5600,7 @@ make_source_files_completion_list (const char *text, const char *word)
 
   filename_seen_cache filenames_seen;
 
-  for (objfile *objfile : all_objfiles (current_program_space))
+  for (objfile *objfile : current_program_space->objfiles ())
     {
       for (compunit_symtab *cu : objfile_compunits (objfile))
        {
@@ -5717,7 +5717,7 @@ find_main_name (void)
      relies on the order of objfile creation -- which still isn't
      guaranteed to get the correct answer, but is just probably more
      accurate.  */
-  for (objfile *objfile : all_objfiles (current_program_space))
+  for (objfile *objfile : current_program_space->objfiles ())
     {
       if (objfile->per_bfd->name_of_main != NULL)
        {
This page took 0.028043 seconds and 4 git commands to generate.