Remove ALL_OBJFILE_FILETABS
[deliverable/binutils-gdb.git] / gdb / symmisc.c
index 24f9176a8a12c8f7353bf6d399457605eb7f285a..23d232ca97dba91a0732d3ec11881b34e0c618d3 100644 (file)
@@ -82,8 +82,6 @@ void
 print_objfile_statistics (void)
 {
   struct program_space *pspace;
-  struct compunit_symtab *cu;
-  struct symtab *s;
   int i, linetables, blockvectors;
 
   ALL_PSPACES (pspace)
@@ -108,15 +106,18 @@ print_objfile_statistics (void)
                         OBJSTAT (objfile, n_types));
       if (objfile->sf)
        objfile->sf->qf->print_stats (objfile);
-      i = linetables = blockvectors = 0;
-      ALL_OBJFILE_FILETABS (objfile, cu, s)
+      i = linetables = 0;
+      for (compunit_symtab *cu : objfile_compunits (objfile))
        {
-         i++;
-         if (SYMTAB_LINETABLE (s) != NULL)
-           linetables++;
+         for (symtab *s : compunit_filetabs (cu))
+           {
+             i++;
+             if (SYMTAB_LINETABLE (s) != NULL)
+               linetables++;
+           }
        }
-      ALL_OBJFILE_COMPUNITS (objfile, cu)
-       blockvectors++;
+      blockvectors = std::distance (objfile_compunits (objfile).begin (),
+                                   objfile_compunits (objfile).end ());
       printf_filtered (_("  Number of symbol tables: %d\n"), i);
       printf_filtered (_("  Number of symbol tables with line tables: %d\n"),
                       linetables);
@@ -145,9 +146,6 @@ print_objfile_statistics (void)
 static void
 dump_objfile (struct objfile *objfile)
 {
-  struct compunit_symtab *cust;
-  struct symtab *symtab;
-
   printf_filtered ("\nObject file %s:  ", objfile_name (objfile));
   printf_filtered ("Objfile at ");
   gdb_print_host_address (objfile, gdb_stdout);
@@ -162,16 +160,20 @@ dump_objfile (struct objfile *objfile)
   if (objfile->compunit_symtabs != NULL)
     {
       printf_filtered ("Symtabs:\n");
-      ALL_OBJFILE_FILETABS (objfile, cust, symtab)
+      for (compunit_symtab *cu : objfile_compunits (objfile))
        {
-         printf_filtered ("%s at ", symtab_to_filename_for_display (symtab));
-         gdb_print_host_address (symtab, gdb_stdout);
-         printf_filtered (", ");
-         if (SYMTAB_OBJFILE (symtab) != objfile)
+         for (symtab *symtab : compunit_filetabs (cu))
            {
-             printf_filtered ("NOT ON CHAIN!  ");
+             printf_filtered ("%s at ",
+                              symtab_to_filename_for_display (symtab));
+             gdb_print_host_address (symtab, gdb_stdout);
+             printf_filtered (", ");
+             if (SYMTAB_OBJFILE (symtab) != objfile)
+               {
+                 printf_filtered ("NOT ON CHAIN!  ");
+               }
+             wrap_here ("  ");
            }
-         wrap_here ("  ");
        }
       printf_filtered ("\n\n");
     }
@@ -469,8 +471,6 @@ maintenance_print_symbols (const char *args, int from_tty)
     }
   else
     {
-      struct compunit_symtab *cu;
-      struct symtab *s;
       int found = 0;
 
       for (objfile *objfile : all_objfiles (current_program_space))
@@ -484,21 +484,24 @@ maintenance_print_symbols (const char *args, int from_tty)
          if (!print_for_objfile)
            continue;
 
-         ALL_OBJFILE_FILETABS (objfile, cu, s)
+         for (compunit_symtab *cu : objfile_compunits (objfile))
            {
-             int print_for_source = 0;
-
-             QUIT;
-             if (source_arg != NULL)
+             for (symtab *s : compunit_filetabs (cu))
                {
-                 print_for_source
-                   = compare_filenames_for_search
-                       (symtab_to_filename_for_display (s), source_arg);
-                 found = 1;
+                 int print_for_source = 0;
+
+                 QUIT;
+                 if (source_arg != NULL)
+                   {
+                     print_for_source
+                       = compare_filenames_for_search
+                       (symtab_to_filename_for_display (s), source_arg);
+                     found = 1;
+                   }
+                 if (source_arg == NULL
+                     || print_for_source)
+                   dump_symtab (s, outfile);
                }
-             if (source_arg == NULL
-                 || print_for_source)
-               dump_symtab (s, outfile);
            }
        }
 
@@ -775,18 +778,15 @@ maintenance_info_symtabs (const char *regexp, int from_tty)
   ALL_PSPACES (pspace)
     for (objfile *objfile : all_objfiles (pspace))
       {
-       struct compunit_symtab *cust;
-       struct symtab *symtab;
-
        /* We don't want to print anything for this objfile until we
           actually find a symtab whose name matches.  */
        int printed_objfile_start = 0;
 
-       ALL_OBJFILE_COMPUNITS (objfile, cust)
+       for (compunit_symtab *cust : objfile_compunits (objfile))
          {
            int printed_compunit_symtab_start = 0;
 
-           ALL_COMPUNIT_FILETABS (cust, symtab)
+           for (symtab *symtab : compunit_filetabs (cust))
              {
                QUIT;
 
@@ -863,13 +863,11 @@ maintenance_check_symtabs (const char *ignore, int from_tty)
   ALL_PSPACES (pspace)
     for (objfile *objfile : all_objfiles (pspace))
       {
-       struct compunit_symtab *cust;
-
        /* We don't want to print anything for this objfile until we
           actually find something worth printing.  */
        int printed_objfile_start = 0;
 
-       ALL_OBJFILE_COMPUNITS (objfile, cust)
+       for (compunit_symtab *cust : objfile_compunits (objfile))
          {
            int found_something = 0;
            struct symtab *symtab = compunit_primary_filetab (cust);
@@ -1032,12 +1030,9 @@ maintenance_info_line_tables (const char *regexp, int from_tty)
   ALL_PSPACES (pspace)
     for (objfile *objfile : all_objfiles (pspace))
       {
-       struct compunit_symtab *cust;
-       struct symtab *symtab;
-
-       ALL_OBJFILE_COMPUNITS (objfile, cust)
+       for (compunit_symtab *cust : objfile_compunits (objfile))
          {
-           ALL_COMPUNIT_FILETABS (cust, symtab)
+           for (symtab *symtab : compunit_filetabs (cust))
              {
                QUIT;
 
This page took 0.025106 seconds and 4 git commands to generate.