#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);
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. */
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';
"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.",
"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);