Use gdb::byte_vector in pascal_object_print_value
[deliverable/binutils-gdb.git] / gdb / maint.c
index 77b56affb6cf8edc9df2ff2cbf94ad5894e9b6f6..6dd6e8b6954ba772c1bd357157811f495a5197ff 100644 (file)
@@ -44,8 +44,6 @@
 #include "cli/cli-utils.h"
 #include "cli/cli-setshow.h"
 
-extern void _initialize_maint_cmds (void);
-
 static void maintenance_command (char *, int);
 
 static void maintenance_internal_error (char *args, int from_tty);
@@ -178,6 +176,19 @@ maintenance_info_command (char *arg, int from_tty)
             gdb_stdout);
 }
 
+/* The "maintenance check" command is defined as a prefix, with
+   allow_unknown 0.  Therefore, its own definition is called only for
+   "maintenance check" with no args.  */
+
+static void
+maintenance_check_command (char *arg, int from_tty)
+{
+  printf_unfiltered (_("\"maintenance check\" must be followed "
+                      "by the name of a check command.\n"));
+  help_list (maintenancechecklist, "maintenance check ", all_commands,
+            gdb_stdout);
+}
+
 /* Mini tokenizing lexer for 'maint info sections' command.  */
 
 static int
@@ -403,14 +414,11 @@ maintenance_print_architecture (char *args, int from_tty)
     gdbarch_dump (gdbarch, gdb_stdout);
   else
     {
-      struct cleanup *cleanups;
-      struct ui_file *file = gdb_fopen (args, "w");
+      stdio_file file;
 
-      if (file == NULL)
+      if (!file.open (args, "w"))
        perror_with_name (_("maintenance print architecture"));
-      cleanups = make_cleanup_ui_file_delete (file);
-      gdbarch_dump (gdbarch, file);
-      do_cleanups (cleanups);
+      gdbarch_dump (gdbarch, &file);
     }
 }
 
@@ -949,7 +957,7 @@ show_per_command_cmd (char *args, int from_tty)
 static void
 maintenance_selftest (char *args, int from_tty)
 {
-  run_self_tests ();
+  selftests::run_tests ();
 }
 
 \f
@@ -1107,6 +1115,11 @@ Print the internal architecture configuration.\n\
 Takes an optional file parameter."),
           &maintenanceprintlist);
 
+  add_prefix_cmd ("check", class_maintenance, maintenance_check_command, _("\
+Commands for checking internal gdb state."),
+                 &maintenancechecklist, "maintenance check ", 0,
+                 &maintenancelist);
+
   add_cmd ("translate-address", class_maintenance,
           maintenance_translate_address,
           _("Translate a section name and address to a symbol."),
This page took 0.025154 seconds and 4 git commands to generate.