Remove ALL_OBJFILE_FILETABS
[deliverable/binutils-gdb.git] / gdb / source.c
index 85e15c3934b38820f0dfa36dea3f3aa5419173cf..14dda01cb0164cf1644c5fd57c38decd381e6c82 100644 (file)
@@ -239,7 +239,6 @@ void
 select_source_symtab (struct symtab *s)
 {
   struct objfile *ofp;
-  struct compunit_symtab *cu;
 
   if (s)
     {
@@ -272,29 +271,29 @@ select_source_symtab (struct symtab *s)
 
   current_source_line = 1;
 
-  ALL_FILETABS (ofp, cu, s)
+  ALL_FILETABS (ofp, cu, symtab)
     {
-      const char *name = s->filename;
+      const char *name = symtab->filename;
       int len = strlen (name);
 
       if (!(len > 2 && (strcmp (&name[len - 2], ".h") == 0
                        || strcmp (name, "<<C++-namespaces>>") == 0)))
        {
          current_source_pspace = current_program_space;
-         current_source_symtab = s;
+         current_source_symtab = symtab;
        }
     }
 
   if (current_source_symtab)
     return;
 
-  ALL_OBJFILES (ofp)
-  {
-    if (ofp->sf)
-      s = ofp->sf->qf->find_last_source_symtab (ofp);
-    if (s)
-      current_source_symtab = s;
-  }
+  for (objfile *objfile : all_objfiles (current_program_space))
+    {
+      if (objfile->sf)
+       s = objfile->sf->qf->find_last_source_symtab (objfile);
+      if (s)
+       current_source_symtab = s;
+    }
   if (current_source_symtab)
     return;
 
@@ -350,20 +349,20 @@ show_directories_command (struct ui_file *file, int from_tty,
 void
 forget_cached_source_info_for_objfile (struct objfile *objfile)
 {
-  struct compunit_symtab *cu;
-  struct symtab *s;
-
-  ALL_OBJFILE_FILETABS (objfile, cu, s)
+  for (compunit_symtab *cu : objfile_compunits (objfile))
     {
-      if (s->line_charpos != NULL)
+      for (symtab *s : compunit_filetabs (cu))
        {
-         xfree (s->line_charpos);
-         s->line_charpos = NULL;
-       }
-      if (s->fullname != NULL)
-       {
-         xfree (s->fullname);
-         s->fullname = NULL;
+         if (s->line_charpos != NULL)
+           {
+             xfree (s->line_charpos);
+             s->line_charpos = NULL;
+           }
+         if (s->fullname != NULL)
+           {
+             xfree (s->fullname);
+             s->fullname = NULL;
+           }
        }
     }
 
This page took 0.032748 seconds and 4 git commands to generate.