mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-27 14:39:09 +08:00
Remove ALL_OBJFILE_FILETABS
This removes ALL_OBJFILE_FILETABS, replacing its uses with ranged for loops. gdb/ChangeLog 2019-01-09 Tom Tromey <tom@tromey.com> * symmisc.c (print_objfile_statistics, dump_objfile) (maintenance_print_symbols): Use compunit_filetabs. * source.c (forget_cached_source_info_for_objfile): Use compunit_filetabs. * objfiles.h (ALL_OBJFILE_FILETABS): Remove. (ALL_FILETABS): Use compunit_filetabs. * objfiles.c (objfile_relocate1): Use compunit_filetabs. * coffread.c (coff_symtab_read): Use compunit_filetabs.
This commit is contained in:
@ -1,3 +1,14 @@
|
||||
2019-01-09 Tom Tromey <tom@tromey.com>
|
||||
|
||||
* symmisc.c (print_objfile_statistics, dump_objfile)
|
||||
(maintenance_print_symbols): Use compunit_filetabs.
|
||||
* source.c (forget_cached_source_info_for_objfile): Use
|
||||
compunit_filetabs.
|
||||
* objfiles.h (ALL_OBJFILE_FILETABS): Remove.
|
||||
(ALL_FILETABS): Use compunit_filetabs.
|
||||
* objfiles.c (objfile_relocate1): Use compunit_filetabs.
|
||||
* coffread.c (coff_symtab_read): Use compunit_filetabs.
|
||||
|
||||
2019-01-09 Tom Tromey <tom@tromey.com>
|
||||
|
||||
* symtab.h (ALL_COMPUNIT_FILETABS): Remove.
|
||||
|
@ -1203,9 +1203,12 @@ coff_symtab_read (minimal_symbol_reader &reader,
|
||||
/* Patch up any opaque types (references to types that are not defined
|
||||
in the file where they are referenced, e.g. "struct foo *bar"). */
|
||||
{
|
||||
ALL_OBJFILE_FILETABS (objfile, cu, s)
|
||||
for (compunit_symtab *cu : objfile_compunits (objfile))
|
||||
{
|
||||
for (symtab *s : compunit_filetabs (cu))
|
||||
patch_opaque_types (s);
|
||||
}
|
||||
}
|
||||
|
||||
coffread_objfile = NULL;
|
||||
}
|
||||
|
@ -788,7 +788,9 @@ objfile_relocate1 (struct objfile *objfile,
|
||||
|
||||
/* OK, get all the symtabs. */
|
||||
{
|
||||
ALL_OBJFILE_FILETABS (objfile, cust, s)
|
||||
for (compunit_symtab *cust : objfile_compunits (objfile))
|
||||
{
|
||||
for (symtab *s : compunit_filetabs (cust))
|
||||
{
|
||||
struct linetable *l;
|
||||
|
||||
@ -802,6 +804,7 @@ objfile_relocate1 (struct objfile *objfile,
|
||||
(cust));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (compunit_symtab *cust : objfile_compunits (objfile))
|
||||
{
|
||||
|
@ -612,12 +612,6 @@ public:
|
||||
(obj) != NULL; \
|
||||
(obj) = (obj)->next)
|
||||
|
||||
/* Traverse all symtabs in one objfile. */
|
||||
|
||||
#define ALL_OBJFILE_FILETABS(objfile, cu, s) \
|
||||
for (compunit_symtab *cu : objfile_compunits (objfile)) \
|
||||
for (symtab *s : compunit_filetabs (cu))
|
||||
|
||||
/* A range adapter that makes it possible to iterate over all
|
||||
compunits in one objfile. */
|
||||
|
||||
@ -716,7 +710,8 @@ private:
|
||||
|
||||
#define ALL_FILETABS(objfile, ps, s) \
|
||||
ALL_OBJFILES (objfile) \
|
||||
ALL_OBJFILE_FILETABS (objfile, ps, s)
|
||||
for (compunit_symtab *ps : objfile_compunits (objfile)) \
|
||||
for (symtab *s : compunit_filetabs (cu))
|
||||
|
||||
#define ALL_OBJFILE_OSECTIONS(objfile, osect) \
|
||||
for (osect = objfile->sections; osect < objfile->sections_end; osect++) \
|
||||
|
@ -349,7 +349,9 @@ show_directories_command (struct ui_file *file, int from_tty,
|
||||
void
|
||||
forget_cached_source_info_for_objfile (struct objfile *objfile)
|
||||
{
|
||||
ALL_OBJFILE_FILETABS (objfile, cu, s)
|
||||
for (compunit_symtab *cu : objfile_compunits (objfile))
|
||||
{
|
||||
for (symtab *s : compunit_filetabs (cu))
|
||||
{
|
||||
if (s->line_charpos != NULL)
|
||||
{
|
||||
@ -362,6 +364,7 @@ forget_cached_source_info_for_objfile (struct objfile *objfile)
|
||||
s->fullname = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (objfile->sf)
|
||||
objfile->sf->qf->forget_cached_source_info (objfile);
|
||||
|
@ -107,12 +107,15 @@ print_objfile_statistics (void)
|
||||
if (objfile->sf)
|
||||
objfile->sf->qf->print_stats (objfile);
|
||||
i = linetables = 0;
|
||||
ALL_OBJFILE_FILETABS (objfile, cu, s)
|
||||
for (compunit_symtab *cu : objfile_compunits (objfile))
|
||||
{
|
||||
for (symtab *s : compunit_filetabs (cu))
|
||||
{
|
||||
i++;
|
||||
if (SYMTAB_LINETABLE (s) != NULL)
|
||||
linetables++;
|
||||
}
|
||||
}
|
||||
blockvectors = std::distance (objfile_compunits (objfile).begin (),
|
||||
objfile_compunits (objfile).end ());
|
||||
printf_filtered (_(" Number of symbol tables: %d\n"), i);
|
||||
@ -157,9 +160,12 @@ 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));
|
||||
for (symtab *symtab : compunit_filetabs (cu))
|
||||
{
|
||||
printf_filtered ("%s at ",
|
||||
symtab_to_filename_for_display (symtab));
|
||||
gdb_print_host_address (symtab, gdb_stdout);
|
||||
printf_filtered (", ");
|
||||
if (SYMTAB_OBJFILE (symtab) != objfile)
|
||||
@ -168,6 +174,7 @@ dump_objfile (struct objfile *objfile)
|
||||
}
|
||||
wrap_here (" ");
|
||||
}
|
||||
}
|
||||
printf_filtered ("\n\n");
|
||||
}
|
||||
}
|
||||
@ -477,7 +484,9 @@ 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))
|
||||
{
|
||||
for (symtab *s : compunit_filetabs (cu))
|
||||
{
|
||||
int print_for_source = 0;
|
||||
|
||||
@ -494,6 +503,7 @@ maintenance_print_symbols (const char *args, int from_tty)
|
||||
dump_symtab (s, outfile);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (source_arg != NULL && !found)
|
||||
error (_("No symtab for source file: %s"), source_arg);
|
||||
|
Reference in New Issue
Block a user