X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=gdb%2Fmaint.c;h=b4890c34cab9bc1694bf7a14e0d27547026116d8;hb=bd920864f3dc2cad376989a642ab774aef6b2fce;hp=7ab3fdb64c167faf28e92339159daa57806594da;hpb=22138db609721897c213e5a08ccaca206c0fb1f6;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/maint.c b/gdb/maint.c index 7ab3fdb64c..b4890c34ca 100644 --- a/gdb/maint.c +++ b/gdb/maint.c @@ -1,6 +1,6 @@ /* Support for GDB maintenance commands. - Copyright (C) 1992-2019 Free Software Foundation, Inc. + Copyright (C) 1992-2020 Free Software Foundation, Inc. Written by Fred Fish at Cygnus Support. @@ -52,16 +52,6 @@ static void maintenance_do_deprecate (const char *, int); -/* Access the maintenance subcommands. */ - -static void -maintenance_command (const char *args, int from_tty) -{ - printf_unfiltered (_("\"maintenance\" must be followed by " - "the name of a maintenance command.\n")); - help_list (maintenancelist, "maintenance ", all_commands, gdb_stdout); -} - #ifndef _WIN32 static void maintenance_dump_me (const char *args, int from_tty) @@ -139,32 +129,6 @@ maintenance_space_display (const char *args, int from_tty) set_per_command_space (strtol (args, NULL, 10)); } -/* The "maintenance info" command is defined as a prefix, with - allow_unknown 0. Therefore, its own definition is called only for - "maintenance info" with no args. */ - -static void -maintenance_info_command (const char *arg, int from_tty) -{ - printf_unfiltered (_("\"maintenance info\" must be followed " - "by the name of an info command.\n")); - help_list (maintenanceinfolist, "maintenance info ", all_commands, - 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 (const 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 @@ -511,19 +475,6 @@ maintenance_print_architecture (const char *args, int from_tty) } } -/* 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. */ - -static void -maintenance_print_command (const char *arg, int from_tty) -{ - printf_unfiltered (_("\"maintenance print\" must be followed " - "by the name of a print command.\n")); - help_list (maintenanceprintlist, "maintenance print ", all_commands, - gdb_stdout); -} - /* The "maintenance translate-address" command converts a section and address to a symbol. This can be called in two ways: maintenance translate-address @@ -589,7 +540,7 @@ maintenance_translate_address (const char *arg, int from_tty) gdb_assert (sect->objfile && objfile_name (sect->objfile)); obj_name = objfile_name (sect->objfile); - if (MULTI_OBJFILE_P ()) + if (current_program_space->multi_objfile_p ()) printf_filtered (_("%s + %s in section %s of %s\n"), symbol_name, symbol_offset, section_name, obj_name); @@ -739,21 +690,6 @@ maintenance_do_deprecate (const char *text, int deprecate) struct cmd_list_element *maintenance_set_cmdlist; struct cmd_list_element *maintenance_show_cmdlist; -static void -maintenance_set_cmd (const char *args, int from_tty) -{ - printf_unfiltered (_("\"maintenance set\" must be followed " - "by the name of a set command.\n")); - help_list (maintenance_set_cmdlist, "maintenance set ", all_commands, - gdb_stdout); -} - -static void -maintenance_show_cmd (const char *args, int from_tty) -{ - cmd_show_list (maintenance_show_cmdlist, from_tty, ""); -} - /* "maintenance with" command. */ static void @@ -1097,14 +1033,6 @@ set_per_command_cmd (const char *args, int from_tty) } } -/* Command "show per-command" displays summary of all the current - "show per-command " settings. */ - -static void -show_per_command_cmd (const char *args, int from_tty) -{ - cmd_show_list (per_command_showlist, from_tty, ""); -} /* The "maintenance selftest" command. */ @@ -1135,24 +1063,25 @@ Selftests have been disabled for this build.\n")); } +void _initialize_maint_cmds (); void -_initialize_maint_cmds (void) +_initialize_maint_cmds () { struct cmd_list_element *cmd; - add_prefix_cmd ("maintenance", class_maintenance, maintenance_command, _("\ + add_basic_prefix_cmd ("maintenance", class_maintenance, _("\ Commands for use by GDB maintainers.\n\ Includes commands to dump specific internal GDB structures in\n\ a human readable form, to cause GDB to deliberately dump core, etc."), - &maintenancelist, "maintenance ", 0, - &cmdlist); + &maintenancelist, "maintenance ", 0, + &cmdlist); add_com_alias ("mt", "maintenance", class_maintenance, 1); - add_prefix_cmd ("info", class_maintenance, maintenance_info_command, _("\ + add_basic_prefix_cmd ("info", class_maintenance, _("\ Commands for showing internal info about the program being debugged."), - &maintenanceinfolist, "maintenance info ", 0, - &maintenancelist); + &maintenanceinfolist, "maintenance info ", 0, + &maintenancelist); add_alias_cmd ("i", "info", class_maintenance, 1, &maintenancelist); add_cmd ("sections", class_maintenance, maintenance_info_sections, _("\ @@ -1167,24 +1096,24 @@ implies all sections). In addition, the special argument\n\ lists all sections from all object files, including shared libraries."), &maintenanceinfolist); - add_prefix_cmd ("print", class_maintenance, maintenance_print_command, - _("Maintenance command for printing GDB internal state."), - &maintenanceprintlist, "maintenance print ", 0, - &maintenancelist); + add_basic_prefix_cmd ("print", class_maintenance, + _("Maintenance command for printing GDB internal state."), + &maintenanceprintlist, "maintenance print ", 0, + &maintenancelist); - add_prefix_cmd ("set", class_maintenance, maintenance_set_cmd, _("\ + add_basic_prefix_cmd ("set", class_maintenance, _("\ Set GDB internal variables used by the GDB maintainer.\n\ Configure variables internal to GDB that aid in GDB's maintenance"), - &maintenance_set_cmdlist, "maintenance set ", - 0/*allow-unknown*/, - &maintenancelist); + &maintenance_set_cmdlist, "maintenance set ", + 0/*allow-unknown*/, + &maintenancelist); - add_prefix_cmd ("show", class_maintenance, maintenance_show_cmd, _("\ + add_show_prefix_cmd ("show", class_maintenance, _("\ Show GDB internal variables used by the GDB maintainer.\n\ Configure variables internal to GDB that aid in GDB's maintenance"), - &maintenance_show_cmdlist, "maintenance show ", - 0/*allow-unknown*/, - &maintenancelist); + &maintenance_show_cmdlist, "maintenance show ", + 0/*allow-unknown*/, + &maintenancelist); cmd = add_cmd ("with", class_maintenance, maintenance_with_cmd, _("\ Like \"with\", but works with \"maintenance set\" variables.\n\ @@ -1231,10 +1160,10 @@ Per-command statistics settings."), &per_command_setlist, "maintenance set per-command ", 1/*allow-unknown*/, &maintenance_set_cmdlist); - add_prefix_cmd ("per-command", class_maintenance, show_per_command_cmd, _("\ + add_show_prefix_cmd ("per-command", class_maintenance, _("\ Show per-command statistics settings."), - &per_command_showlist, "maintenance show per-command ", - 0/*allow-unknown*/, &maintenance_show_cmdlist); + &per_command_showlist, "maintenance show per-command ", + 0/*allow-unknown*/, &maintenance_show_cmdlist); add_setshow_boolean_cmd ("time", class_maintenance, &per_command_time, _("\ @@ -1298,10 +1227,10 @@ Print the internal architecture configuration.\n\ Takes an optional file parameter."), &maintenanceprintlist); - add_prefix_cmd ("check", class_maintenance, maintenance_check_command, _("\ + add_basic_prefix_cmd ("check", class_maintenance, _("\ Commands for checking internal gdb state."), - &maintenancechecklist, "maintenance check ", 0, - &maintenancelist); + &maintenancechecklist, "maintenance check ", 0, + &maintenancelist); add_cmd ("translate-address", class_maintenance, maintenance_translate_address,