From 8b31193aa9752ba60d63cedaba943370d76ce543 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Sat, 24 Nov 2018 09:58:20 -0700 Subject: Remove ALL_OBJFILES and ALL_FILETABS This removes the ALL_OBJFILES and ALL_FILETABS macros, replacing them with ranged for loops. gdb/ChangeLog 2019-01-09 Tom Tromey * symtab.c (find_line_symtab, info_sources_command) (make_source_files_completion_list): Use objfile_compunits. * source.c (select_source_symtab): Use objfile_compunits. * objfiles.h (struct objfile): Update comment. (ALL_OBJFILES): Remove. (ALL_FILETABS): Remove. * mi/mi-cmd-file.c (mi_cmd_file_list_exec_source_files): Use objfile_compunits. --- gdb/objfiles.h | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) (limited to 'gdb/objfiles.h') diff --git a/gdb/objfiles.h b/gdb/objfiles.h index 33acb20..b8d5b65 100644 --- a/gdb/objfiles.h +++ b/gdb/objfiles.h @@ -430,7 +430,7 @@ struct objfile Although this is a tree structure, GDB only support one level (ie a separate debug for a separate debug is not supported). Note that separate debug object are in the main chain and therefore will be - visited by ALL_OBJFILES & co iterators. Separate debug objfile always + visited by all_objfiles & co iterators. Separate debug objfile always has a non-nul separate_debug_objfile_backlink. */ /* Link to the first separate debug object, if any. */ @@ -604,14 +604,6 @@ public: } }; - -/* Traverse all object files in the current program space. */ - -#define ALL_OBJFILES(obj) \ - for ((obj) = current_program_space->objfiles; \ - (obj) != NULL; \ - (obj) = (obj)->next) - /* A range adapter that makes it possible to iterate over all compunits in one objfile. */ @@ -705,14 +697,6 @@ private: struct objfile *m_objfile; }; -/* Traverse all symtabs in all objfiles in the current symbol - space. */ - -#define ALL_FILETABS(objfile, ps, s) \ - ALL_OBJFILES (objfile) \ - 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++) \ if (osect->the_bfd_section == NULL) \ -- cgit v1.1