From 5accd1a07e080c386918da413e0f9e90c4cab58a Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Sat, 24 Nov 2018 09:49:24 -0700 Subject: Remove ALL_COMPUNIT_FILETABS This removes ALL_COMPUNIT_FILETABS, replacing its uses with ranged for loops. Because this is still used in the ALL_OBJFILE_FILETABS macro, in some places a declaration had to be removed or renamed to avoid shadowing. gdb/ChangeLog 2019-01-09 Tom Tromey * symtab.h (ALL_COMPUNIT_FILETABS): Remove. (compunit_filetabs): New. * symtab.c (iterate_over_some_symtabs, find_pc_sect_line): Use compunit_filetabs. (info_sources_command, make_source_files_completion_list): Remove declaration. * symmisc.c (print_objfile_statistics, dump_objfile) (maintenance_print_symbols): Remove declaration. (maintenance_info_symtabs): Use compunit_filetabs. (maintenance_info_line_tables): Likewise. * source.c (select_source_symtab): Change local variable name. (forget_cached_source_info_for_objfile): Remove declaration. * objfiles.h (ALL_OBJFILE_FILETABS): Use compunit_filetabs. * objfiles.c (objfile_relocate1): Remove declaration. * mi/mi-cmd-file.c (mi_cmd_file_list_exec_source_files): Remove declaration. * maint.c (count_symtabs_and_blocks): Use compunit_filetabs. * coffread.c (coff_symtab_read): Remove declaration. * buildsym.c (buildsym_compunit::end_symtab_with_blockvector): Use compunit_filetabs. --- gdb/source.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'gdb/source.c') diff --git a/gdb/source.c b/gdb/source.c index 3fc4ad5..ed0ff4c 100644 --- a/gdb/source.c +++ b/gdb/source.c @@ -271,16 +271,16 @@ 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, "<>") == 0))) { current_source_pspace = current_program_space; - current_source_symtab = s; + current_source_symtab = symtab; } } @@ -349,8 +349,6 @@ show_directories_command (struct ui_file *file, int from_tty, void forget_cached_source_info_for_objfile (struct objfile *objfile) { - struct symtab *s; - ALL_OBJFILE_FILETABS (objfile, cu, s) { if (s->line_charpos != NULL) -- cgit v1.1