Merge remote-tracking branch 'origin/master' into amd-common
[deliverable/binutils-gdb.git] / gdb / mi / mi-cmd-file.c
index d645e5a0c33da56bd2a2c5c59e720944699d7cca..b5835a52bf88a1f05df6d64e482e94f53fd6812f 100644 (file)
@@ -1,5 +1,5 @@
 /* MI Command Set - file commands.
-   Copyright (C) 2000-2019 Free Software Foundation, Inc.
+   Copyright (C) 2000-2020 Free Software Foundation, Inc.
    Contributed by Cygnus Solutions (a Red Hat company).
 
    This file is part of GDB.
@@ -53,13 +53,13 @@ mi_cmd_file_list_exec_source_file (const char *command, char **argv, int argc)
     error (_("-file-list-exec-source-file: No symtab"));
 
   /* Print to the user the line, filename and fullname.  */
-  uiout->field_int ("line", st.line);
+  uiout->field_signed ("line", st.line);
   uiout->field_string ("file", symtab_to_filename_for_display (st.symtab));
 
   uiout->field_string ("fullname", symtab_to_fullname (st.symtab));
 
-  uiout->field_int ("macro-info",
-                   COMPUNIT_MACRO_TABLE (SYMTAB_COMPUNIT (st.symtab)) != NULL);
+  uiout->field_signed ("macro-info",
+                      COMPUNIT_MACRO_TABLE (SYMTAB_COMPUNIT (st.symtab)) != NULL);
 }
 
 /* A callback for map_partial_symbol_filenames.  */
@@ -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 : current_program_space->objfiles ())
+    {
+      for (compunit_symtab *cu : objfile->compunits ())
+       {
+         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*/);
This page took 0.024431 seconds and 4 git commands to generate.