print_objfile_statistics (void)
{
struct program_space *pspace;
- struct compunit_symtab *cu;
- struct symtab *s;
int i, linetables, blockvectors;
ALL_PSPACES (pspace)
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);
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);
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");
}
}
else
{
- struct compunit_symtab *cu;
- struct symtab *s;
int found = 0;
for (objfile *objfile : all_objfiles (current_program_space))
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);
}
}
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;
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);
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;