PARAMS elimination.
[deliverable/binutils-gdb.git] / gdb / maint.c
index dd974b7d0d5d672fff7ca852538ccd43f5067b59..44dcba8e18eea68ad325edc63d6763857ab6b8c8 100644 (file)
 #include "objfiles.h"
 #include "value.h"
 
-extern void _initialize_maint_cmds PARAMS ((void));
+extern void _initialize_maint_cmds (void);
 
-static void maintenance_command PARAMS ((char *, int));
+static void maintenance_command (char *, int);
 
-static void maintenance_dump_me PARAMS ((char *, int));
+static void maintenance_dump_me (char *, int);
 
-static void maintenance_internal_error PARAMS ((char *args, int from_tty));
+static void maintenance_internal_error (char *args, int from_tty);
 
-static void maintenance_demangle PARAMS ((char *, int));
+static void maintenance_demangle (char *, int);
 
-static void maintenance_time_display PARAMS ((char *, int));
+static void maintenance_time_display (char *, int);
 
-static void maintenance_space_display PARAMS ((char *, int));
+static void maintenance_space_display (char *, int);
 
-static void maintenance_info_command PARAMS ((char *, int));
+static void maintenance_info_command (char *, int);
 
-static void print_section_table PARAMS ((bfd *, asection *, PTR));
+static void print_section_table (bfd *, asection *, PTR);
 
-static void maintenance_info_sections PARAMS ((char *, int));
+static void maintenance_info_sections (char *, int);
 
-static void maintenance_print_command PARAMS ((char *, int));
+static void maintenance_print_command (char *, int);
 
 static void maintenance_do_deprecate (char *, int);
 
@@ -283,6 +283,21 @@ maintenance_print_statistics (args, from_tty)
   print_symbol_bcache_statistics ();
 }
 
+void
+maintenance_print_architecture (char *args, int from_tty)
+{
+  if (args == NULL)
+    gdbarch_dump (current_gdbarch, gdb_stdout);
+  else
+    {
+      struct ui_file *file = gdb_fopen (args, "w");
+      if (file == NULL)
+       perror_with_name ("maintenance print architecture");
+      gdbarch_dump (current_gdbarch, file);    
+      ui_file_delete (file);
+    }
+}
+
 /* The "maintenance print" command is defined as a prefix, with
    allow_unknown 0.  Therefore, its own definition is called only for
    "maintenance print" with no args.  */
@@ -425,10 +440,12 @@ maintenance_do_deprecate (char *text, int deprecate)
   if (deprecate)
     {
       /* look for a replacement command */
-      if (start_ptr = strchr (text, '\"'))
+      start_ptr = strchr (text, '\"');
+      if (start_ptr != NULL)
        {
          start_ptr++;
-         if (end_ptr = strrchr (start_ptr, '\"'))
+         end_ptr = strrchr (start_ptr, '\"');
+         if (end_ptr != NULL)
            {
              len = end_ptr - start_ptr;
              start_ptr[len] = '\0';
@@ -493,6 +510,7 @@ to test internal functions such as the C++ demangler, etc.",
      "Commands for showing internal info about the program being debugged.",
                  &maintenanceinfolist, "maintenance info ", 0,
                  &maintenancelist);
+  add_alias_cmd ("i", "info", class_maintenance, 1, &maintenancelist);
 
   add_cmd ("sections", class_maintenance, maintenance_info_sections,
           "List the BFD sections of the exec and core files.",
@@ -566,6 +584,11 @@ If a SOURCE file is specified, dump only that file's partial symbols.",
           "Print statistics about internal gdb state.",
           &maintenanceprintlist);
 
+  add_cmd ("architecture", class_maintenance, maintenance_print_architecture,
+          "Print the internal architecture configuration.\
+Takes an optional file parameter.",
+          &maintenanceprintlist);
+
   add_cmd ("check-symtabs", class_maintenance, maintenance_check_symtabs,
           "Check consistency of psymtabs and symtabs.",
           &maintenancelist);
This page took 0.024651 seconds and 4 git commands to generate.