diff options
author | Tom Tromey <tom@tromey.com> | 2018-11-24 09:51:44 -0700 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2019-01-09 18:28:15 -0700 |
commit | d5da8b3c0d99e71c27832a4e9b60c61eebf9767c (patch) | |
tree | c4e9e194e65019df77c754dfea3399c34de7080c /gdb/symmisc.c | |
parent | 5accd1a07e080c386918da413e0f9e90c4cab58a (diff) | |
download | gdb-d5da8b3c0d99e71c27832a4e9b60c61eebf9767c.zip gdb-d5da8b3c0d99e71c27832a4e9b60c61eebf9767c.tar.gz gdb-d5da8b3c0d99e71c27832a4e9b60c61eebf9767c.tar.bz2 |
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.
Diffstat (limited to 'gdb/symmisc.c')
-rw-r--r-- | gdb/symmisc.c | 56 |
1 files changed, 33 insertions, 23 deletions
diff --git a/gdb/symmisc.c b/gdb/symmisc.c index f067292..23d232c 100644 --- a/gdb/symmisc.c +++ b/gdb/symmisc.c @@ -107,11 +107,14 @@ 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)) { - i++; - if (SYMTAB_LINETABLE (s) != NULL) - linetables++; + for (symtab *s : compunit_filetabs (cu)) + { + i++; + if (SYMTAB_LINETABLE (s) != NULL) + linetables++; + } } blockvectors = std::distance (objfile_compunits (objfile).begin (), objfile_compunits (objfile).end ()); @@ -157,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"); } @@ -477,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); } } |