Remove most uses of ALL_OBJFILES
[deliverable/binutils-gdb.git] / gdb / maint.c
index 70e00110e52bbbddccd0a632e1d6d0737e804e3a..01d04df75bfd22562ad8a45c433083d3e7336aa2 100644 (file)
@@ -1,6 +1,6 @@
 /* Support for GDB maintenance commands.
 
-   Copyright (C) 1992-2018 Free Software Foundation, Inc.
+   Copyright (C) 1992-2019 Free Software Foundation, Inc.
 
    Written by Fred Fish at Cygnus Support.
 
@@ -348,7 +348,6 @@ maintenance_info_sections (const char *arg, int from_tty)
       printf_filtered (_("file type %s.\n"), bfd_get_target (exec_bfd));
       if (arg && *arg && match_substring (arg, "ALLOBJ"))
        {
-         struct objfile *ofile;
          struct obj_section *osect;
 
          /* Only this function cares about the 'ALLOBJ' argument; 
@@ -358,7 +357,7 @@ maintenance_info_sections (const char *arg, int from_tty)
          if (strcmp (arg, "ALLOBJ") == 0)
            arg = NULL;
 
-         ALL_OBJFILES (ofile)
+         for (objfile *ofile : all_objfiles (current_program_space))
            {
              printf_filtered (_("  Object file: %s\n"), 
                               bfd_get_filename (ofile->obfd));
@@ -444,7 +443,7 @@ maintenance_translate_address (const char *arg, int from_tty)
       while (*p && !isspace (*p))      /* Find end of section name.  */
        p++;
       if (*p == '\000')                /* End of command?  */
-       error (_("Need to specify <section-name> and <address>"));
+       error (_("Need to specify section name and address"));
 
       int arg_len = p - arg;
       p = skip_spaces (p + 1);
@@ -828,7 +827,7 @@ scoped_command_stats::~scoped_command_stats ()
 
   if (m_space_enabled && per_command_space)
     {
-#ifdef HAVE_SBRK
+#ifdef HAVE_USEFUL_SBRK
       char *lim = (char *) sbrk (0);
 
       long space_now = lim - lim_at_start;
@@ -866,7 +865,7 @@ scoped_command_stats::scoped_command_stats (bool msg_type)
 {
   if (!m_msg_type || per_command_space)
     {
-#ifdef HAVE_SBRK
+#ifdef HAVE_USEFUL_SBRK
       char *lim = (char *) sbrk (0);
       m_start_space = lim - lim_at_start;
       m_space_enabled = 1;
@@ -943,7 +942,7 @@ maintenance_selftest (const char *args, int from_tty)
   selftests::run_tests (args);
 #else
   printf_filtered (_("\
-Selftests are not available in a non-development build.\n"));
+Selftests have been disabled for this build.\n"));
 #endif
 }
 
@@ -957,7 +956,7 @@ maintenance_info_selftests (const char *arg, int from_tty)
   });
 #else
   printf_filtered (_("\
-Selftests are not available in a non-development build.\n"));
+Selftests have been disabled for this build.\n"));
 #endif
 }
 
@@ -1046,12 +1045,12 @@ This command has been moved to \"demangle\"."),
 
   add_prefix_cmd ("per-command", class_maintenance, set_per_command_cmd, _("\
 Per-command statistics settings."),
-                   &per_command_setlist, "set per-command ",
+                   &per_command_setlist, "maintenance set per-command ",
                    1/*allow-unknown*/, &maintenance_set_cmdlist);
 
   add_prefix_cmd ("per-command", class_maintenance, show_per_command_cmd, _("\
 Show per-command statistics settings."),
-                   &per_command_showlist, "show per-command ",
+                   &per_command_showlist, "maintenance show per-command ",
                    0/*allow-unknown*/, &maintenance_show_cmdlist);
 
   add_setshow_boolean_cmd ("time", class_maintenance,
This page took 0.0307 seconds and 4 git commands to generate.