aboutsummaryrefslogtreecommitdiff
path: root/gdb/mi
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2018-11-24 09:58:20 -0700
committerTom Tromey <tom@tromey.com>2019-01-09 18:28:15 -0700
commit8b31193aa9752ba60d63cedaba943370d76ce543 (patch)
tree3e6787e80428ab357880409a63be7a620b769ffd /gdb/mi
parentd5da8b3c0d99e71c27832a4e9b60c61eebf9767c (diff)
downloadgdb-8b31193aa9752ba60d63cedaba943370d76ce543.zip
gdb-8b31193aa9752ba60d63cedaba943370d76ce543.tar.gz
gdb-8b31193aa9752ba60d63cedaba943370d76ce543.tar.bz2
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 <tom@tromey.com> * 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.
Diffstat (limited to 'gdb/mi')
-rw-r--r--gdb/mi/mi-cmd-file.c25
1 files changed, 15 insertions, 10 deletions
diff --git a/gdb/mi/mi-cmd-file.c b/gdb/mi/mi-cmd-file.c
index d645e5a..2071b9f 100644
--- a/gdb/mi/mi-cmd-file.c
+++ b/gdb/mi/mi-cmd-file.c
@@ -84,7 +84,6 @@ void
mi_cmd_file_list_exec_source_files (const char *command, char **argv, int argc)
{
struct ui_out *uiout = current_uiout;
- struct objfile *objfile;
if (!mi_valid_noargs ("-file-list-exec-source-files", argc, argv))
error (_("-file-list-exec-source-files: Usage: No args"));
@@ -93,15 +92,21 @@ mi_cmd_file_list_exec_source_files (const char *command, char **argv, int argc)
uiout->begin (ui_out_type_list, "files");
/* Look at all of the file symtabs. */
- ALL_FILETABS (objfile, cu, s)
- {
- uiout->begin (ui_out_type_tuple, NULL);
-
- uiout->field_string ("file", symtab_to_filename_for_display (s));
- uiout->field_string ("fullname", symtab_to_fullname (s));
-
- uiout->end (ui_out_type_tuple);
- }
+ for (objfile *objfile : all_objfiles (current_program_space))
+ {
+ for (compunit_symtab *cu : objfile_compunits (objfile))
+ {
+ for (symtab *s : compunit_filetabs (cu))
+ {
+ uiout->begin (ui_out_type_tuple, NULL);
+
+ uiout->field_string ("file", symtab_to_filename_for_display (s));
+ uiout->field_string ("fullname", symtab_to_fullname (s));
+
+ uiout->end (ui_out_type_tuple);
+ }
+ }
+ }
map_symbol_filenames (print_partial_file_name, NULL,
1 /*need_fullname*/);