+2020-04-17 Tom Tromey <tromey@adacore.com>
+
+ * auto-load.c (show_auto_load_cmd): Remove.
+ (auto_load_show_cmdlist_get): Use add_show_prefix_cmd.
+ * arc-tdep.c (_initialize_arc_tdep): Use add_show_prefix_cmd.
+ (maintenance_print_arc_command): Remove.
+ * tui/tui-win.c (tui_command): Remove.
+ (tui_get_cmd_list): Use add_basic_prefix_cmd.
+ * tui/tui-layout.c (tui_layout_command): Remove.
+ (_initialize_tui_layout): Use add_basic_prefix_cmd.
+ * python/python.c (user_set_python, user_show_python): Remove.
+ (_initialize_python): Use add_basic_prefix_cmd,
+ add_show_prefix_cmd.
+ * guile/guile.c (set_guile_command, show_guile_command): Remove.
+ (install_gdb_commands): Use add_basic_prefix_cmd,
+ add_show_prefix_cmd.
+ (info_guile_command): Remove.
+ * dwarf2/read.c (set_dwarf_cmd, show_dwarf_cmd): Remove.
+ (_initialize_dwarf2_read): Use add_basic_prefix_cmd,
+ add_show_prefix_cmd.
+ * cli/cli-style.h (class cli_style_option) <add_setshow_commands>:
+ Remove do_set and do_show parameters.
+ * cli/cli-style.c (set_style, show_style): Remove.
+ (_initialize_cli_style): Use add_basic_prefix_cmd,
+ add_show_prefix_cmd.
+ (cli_style_option::add_setshow_commands): Remove do_set and
+ do_show parameters.
+ (cli_style_option::add_setshow_commands): Use
+ add_basic_prefix_cmd, add_show_prefix_cmd.
+ (STYLE_ADD_SETSHOW_COMMANDS): Remove macro.
+ (set_style_name): Remove.
+ * cli/cli-dump.c (dump_command, append_command): Remove.
+ (srec_dump_command, ihex_dump_command, verilog_dump_command)
+ (tekhex_dump_command, binary_dump_command)
+ (binary_append_command): Remove.
+ (_initialize_cli_dump): Use add_basic_prefix_cmd.
+ * windows-tdep.c (w32_prefix_command_valid): Remove global.
+ (init_w32_command_list): Remove; move into ...
+ (_initialize_windows_tdep): ... here. Use add_basic_prefix_cmd.
+ * valprint.c (set_print, show_print, set_print_raw)
+ (show_print_raw): Remove.
+ (_initialize_valprint): Use add_basic_prefix_cmd,
+ add_show_prefix_cmd.
+ * typeprint.c (set_print_type, show_print_type): Remove.
+ (_initialize_typeprint): Use add_basic_prefix_cmd,
+ add_show_prefix_cmd.
+ * record.c (set_record_command, show_record_command): Remove.
+ (_initialize_record): Use add_basic_prefix_cmd,
+ add_show_prefix_cmd.
+ * cli/cli-cmds.c (_initialize_cli_cmds): Use add_basic_prefix_cmd,
+ add_show_prefix_cmd.
+ (info_command, show_command, set_debug, show_debug): Remove.
+ * top.h (set_history, show_history): Don't declare.
+ * top.c (set_history, show_history): Remove.
+ * target-descriptions.c (set_tdesc_cmd, show_tdesc_cmd)
+ (unset_tdesc_cmd): Remove.
+ (_initialize_target_descriptions): Use add_basic_prefix_cmd,
+ add_show_prefix_cmd.
+ * symtab.c (info_module_command): Remove.
+ (_initialize_symtab): Use add_basic_prefix_cmd.
+ * symfile.c (overlay_command): Remove.
+ (_initialize_symfile): Use add_basic_prefix_cmd.
+ * sparc64-tdep.c (info_adi_command): Remove.
+ (_initialize_sparc64_adi_tdep): Use add_basic_prefix_cmd.
+ * sh-tdep.c (show_sh_command, set_sh_command): Remove.
+ (_initialize_sh_tdep): Use add_basic_prefix_cmd,
+ add_show_prefix_cmd.
+ * serial.c (serial_set_cmd, serial_show_cmd): Remove.
+ (_initialize_serial): Use add_basic_prefix_cmd,
+ add_show_prefix_cmd.
+ * ser-tcp.c (set_tcp_cmd, show_tcp_cmd): Remove.
+ (_initialize_ser_tcp): Use add_basic_prefix_cmd,
+ add_show_prefix_cmd.
+ * rs6000-tdep.c (set_powerpc_command, show_powerpc_command)
+ (_initialize_rs6000_tdep): Use add_basic_prefix_cmd,
+ add_show_prefix_cmd.
+ * riscv-tdep.c (show_riscv_command, set_riscv_command)
+ (show_debug_riscv_command, set_debug_riscv_command): Remove.
+ (_initialize_riscv_tdep): Use add_basic_prefix_cmd,
+ add_show_prefix_cmd.
+ * remote.c (remote_command, set_remote_cmd): Remove.
+ (_initialize_remote): Use add_basic_prefix_cmd.
+ * record-full.c (set_record_full_command)
+ (show_record_full_command): Remove.
+ (_initialize_record_full): Use add_basic_prefix_cmd,
+ add_show_prefix_cmd.
+ * record-btrace.c (cmd_set_record_btrace)
+ (cmd_show_record_btrace, cmd_set_record_btrace_bts)
+ (cmd_show_record_btrace_bts, cmd_set_record_btrace_pt)
+ (cmd_show_record_btrace_pt): Remove.
+ (_initialize_record_btrace): Use add_basic_prefix_cmd,
+ add_show_prefix_cmd.
+ * ravenscar-thread.c (set_ravenscar_command)
+ (show_ravenscar_command): Remove.
+ (_initialize_ravenscar): Use add_basic_prefix_cmd,
+ add_show_prefix_cmd.
+ * mips-tdep.c (show_mips_command, set_mips_command)
+ (_initialize_mips_tdep): Use add_basic_prefix_cmd,
+ add_show_prefix_cmd.
+ * maint.c (maintenance_command, maintenance_info_command)
+ (maintenance_check_command, maintenance_print_command)
+ (maintenance_set_cmd, maintenance_show_cmd): Remove.
+ (_initialize_maint_cmds): Use add_basic_prefix_cmd,
+ add_show_prefix_cmd.
+ (show_per_command_cmd): Remove.
+ * maint-test-settings.c (maintenance_set_test_settings_cmd):
+ Remove.
+ (maintenance_show_test_settings_cmd): Remove.
+ (_initialize_maint_test_settings): Use add_basic_prefix_cmd,
+ add_show_prefix_cmd.
+ * maint-test-options.c (maintenance_test_options_command):
+ Remove.
+ (_initialize_maint_test_options): Use add_basic_prefix_cmd.
+ * macrocmd.c (macro_command): Remove
+ (_initialize_macrocmd): Use add_basic_prefix_cmd.
+ * language.c (set_check, show_check): Remove.
+ (_initialize_language): Use add_basic_prefix_cmd,
+ add_show_prefix_cmd.
+ * infcmd.c (unset_command): Remove.
+ (_initialize_infcmd): Use add_basic_prefix_cmd.
+ * i386-tdep.c (set_mpx_cmd, show_mpx_cmd): Remove.
+ (_initialize_i386_tdep): Use add_basic_prefix_cmd,
+ add_show_prefix_cmd.
+ * go32-nat.c (go32_info_dos_command): Remove.
+ (_initialize_go32_nat): Use add_basic_prefix_cmd.
+ * cli/cli-decode.c (do_prefix_cmd, add_basic_prefix_cmd)
+ (do_show_prefix_cmd, add_show_prefix_cmd): New functions.
+ * frame.c (set_backtrace_cmd, show_backtrace_cmd): Remove.
+ (_initialize_frame): Use add_basic_prefix_cmd,
+ add_show_prefix_cmd.
+ * dcache.c (set_dcache_command, show_dcache_command): Remove.
+ (_initialize_dcache): Use add_basic_prefix_cmd,
+ add_show_prefix_cmd.
+ * cp-support.c (maint_cplus_command): Remove.
+ (_initialize_cp_support): Use add_basic_prefix_cmd.
+ * btrace.c (maint_btrace_cmd, maint_btrace_set_cmd)
+ (maint_btrace_show_cmd, maint_btrace_pt_set_cmd)
+ (maint_btrace_pt_show_cmd, _initialize_btrace): Use
+ add_basic_prefix_cmd, add_show_prefix_cmd.
+ * breakpoint.c (save_command): Remove.
+ (_initialize_breakpoint): Use add_basic_prefix_cmd.
+ * arm-tdep.c (set_arm_command, show_arm_command): Remove.
+ (_initialize_arm_tdep): Use add_basic_prefix_cmd,
+ add_show_prefix_cmd.
+ * ada-lang.c (maint_set_ada_cmd, maint_show_ada_cmd)
+ (set_ada_command, show_ada_command): Remove.
+ (_initialize_ada_language): Use add_basic_prefix_cmd,
+ add_show_prefix_cmd.
+ * command.h (add_basic_prefix_cmd, add_show_prefix_cmd): Declare.
+
2020-04-16 Kamil Rytarowski <n54@gmx.com>
* nbsd-nat.c (inf_ptrace_target::auxv_parse): Remove.
static struct cmd_list_element *maint_set_ada_cmdlist;
static struct cmd_list_element *maint_show_ada_cmdlist;
-/* Implement the "maintenance set ada" (prefix) command. */
-
-static void
-maint_set_ada_cmd (const char *args, int from_tty)
-{
- help_list (maint_set_ada_cmdlist, "maintenance set ada ", all_commands,
- gdb_stdout);
-}
-
-/* Implement the "maintenance show ada" (prefix) command. */
-
-static void
-maint_show_ada_cmd (const char *args, int from_tty)
-{
- cmd_show_list (maint_show_ada_cmdlist, from_tty, "");
-}
-
/* The "maintenance ada set/show ignore-descriptive-type" value. */
static bool ada_ignore_descriptive_types_p = false;
static struct cmd_list_element *set_ada_list;
static struct cmd_list_element *show_ada_list;
-/* Implement the "set ada" prefix command. */
-
-static void
-set_ada_command (const char *arg, int from_tty)
-{
- printf_unfiltered (_(\
-"\"set ada\" must be followed by the name of a setting.\n"));
- help_list (set_ada_list, "set ada ", all_commands, gdb_stdout);
-}
-
-/* Implement the "show ada" prefix command. */
-
-static void
-show_ada_command (const char *args, int from_tty)
-{
- cmd_show_list (show_ada_list, from_tty, "");
-}
-
static void
initialize_ada_catchpoint_ops (void)
{
{
initialize_ada_catchpoint_ops ();
- add_prefix_cmd ("ada", no_class, set_ada_command,
- _("Prefix command for changing Ada-specific settings."),
- &set_ada_list, "set ada ", 0, &setlist);
+ add_basic_prefix_cmd ("ada", no_class,
+ _("Prefix command for changing Ada-specific settings."),
+ &set_ada_list, "set ada ", 0, &setlist);
- add_prefix_cmd ("ada", no_class, show_ada_command,
- _("Generic command for showing Ada-specific settings."),
- &show_ada_list, "show ada ", 0, &showlist);
+ add_show_prefix_cmd ("ada", no_class,
+ _("Generic command for showing Ada-specific settings."),
+ &show_ada_list, "show ada ", 0, &showlist);
add_setshow_boolean_cmd ("trust-PAD-over-XVS", class_obscure,
&trust_pad_over_xvs, _("\
If a regular expression is passed as an argument, only those matching\n\
the regular expression are listed."));
- add_prefix_cmd ("ada", class_maintenance, maint_set_ada_cmd,
- _("Set Ada maintenance-related variables."),
- &maint_set_ada_cmdlist, "maintenance set ada ",
- 0/*allow-unknown*/, &maintenance_set_cmdlist);
+ add_basic_prefix_cmd ("ada", class_maintenance,
+ _("Set Ada maintenance-related variables."),
+ &maint_set_ada_cmdlist, "maintenance set ada ",
+ 0/*allow-unknown*/, &maintenance_set_cmdlist);
- add_prefix_cmd ("ada", class_maintenance, maint_show_ada_cmd,
- _("Show Ada maintenance-related variables."),
- &maint_show_ada_cmdlist, "maintenance show ada ",
- 0/*allow-unknown*/, &maintenance_show_cmdlist);
+ add_show_prefix_cmd ("ada", class_maintenance,
+ _("Show Ada maintenance-related variables."),
+ &maint_show_ada_cmdlist, "maintenance show ada ",
+ 0/*allow-unknown*/, &maintenance_show_cmdlist);
add_setshow_boolean_cmd
("ignore-descriptive-types", class_maintenance,
fprintf_unfiltered (file, "arc_dump_tdep: jb_pc = %i\n", tdep->jb_pc);
}
-/* Wrapper for "maintenance print arc" list of commands. */
-
-static void
-maintenance_print_arc_command (const char *args, int from_tty)
-{
- cmd_show_list (maintenance_print_arc_list, from_tty, "");
-}
-
/* This command accepts single argument - address of instruction to
disassemble. */
/* Register ARC-specific commands with gdb. */
/* Add root prefix command for "maintenance print arc" commands. */
- add_prefix_cmd ("arc", class_maintenance, maintenance_print_arc_command,
- _("ARC-specific maintenance commands for printing GDB "
- "internal state."),
- &maintenance_print_arc_list, "maintenance print arc ", 0,
- &maintenanceprintlist);
+ add_show_prefix_cmd ("arc", class_maintenance,
+ _("ARC-specific maintenance commands for printing GDB "
+ "internal state."),
+ &maintenance_print_arc_list, "maintenance print arc ",
+ 0, &maintenanceprintlist);
add_cmd ("arc-instruction", class_maintenance,
dump_arc_instruction_command,
return 0; /* not a stub */
}
-static void
-set_arm_command (const char *args, int from_tty)
-{
- printf_unfiltered (_("\
-\"set arm\" must be followed by an apporpriate subcommand.\n"));
- help_list (setarmcmdlist, "set arm ", all_commands, gdb_stdout);
-}
-
-static void
-show_arm_command (const char *args, int from_tty)
-{
- cmd_show_list (showarmcmdlist, from_tty, "");
-}
-
static void
arm_update_current_architecture (void)
{
arm_elf_osabi_sniffer);
/* Add root prefix command for all "set arm"/"show arm" commands. */
- add_prefix_cmd ("arm", no_class, set_arm_command,
- _("Various ARM-specific commands."),
- &setarmcmdlist, "set arm ", 0, &setlist);
+ add_basic_prefix_cmd ("arm", no_class,
+ _("Various ARM-specific commands."),
+ &setarmcmdlist, "set arm ", 0, &setlist);
- add_prefix_cmd ("arm", no_class, show_arm_command,
- _("Various ARM-specific commands."),
- &showarmcmdlist, "show arm ", 0, &showlist);
+ add_show_prefix_cmd ("arm", no_class,
+ _("Various ARM-specific commands."),
+ &showarmcmdlist, "show arm ", 0, &showlist);
arm_disassembler_options = xstrdup ("reg-names-std");
return &retval;
}
-/* Command "show auto-load" displays summary of all the current
- "show auto-load " settings. */
-
-static void
-show_auto_load_cmd (const char *args, int from_tty)
-{
- cmd_show_list (*auto_load_show_cmdlist_get (), from_tty, "");
-}
-
/* Initialize "show auto-load " commands prefix and return it. */
struct cmd_list_element **
static struct cmd_list_element *retval;
if (retval == NULL)
- add_prefix_cmd ("auto-load", class_maintenance, show_auto_load_cmd, _("\
+ add_show_prefix_cmd ("auto-load", class_maintenance, _("\
Show auto-loading specific settings.\n\
Show configuration of various auto-load-specific variables such as\n\
automatic loading of Python scripts."),
- &retval, "show auto-load ",
- 0/*allow-unknown*/, &showlist);
+ &retval, "show auto-load ",
+ 0/*allow-unknown*/, &showlist);
return &retval;
}
set_cmd_completer (command, completer);
}
-static void
-save_command (const char *arg, int from_tty)
-{
- printf_unfiltered (_("\"save\" must be followed by "
- "the name of a save subcommand.\n"));
- help_list (save_cmdlist, "save ", all_commands, gdb_stdout);
-}
-
struct breakpoint *
iterate_over_breakpoints (gdb::function_view<bool (breakpoint *)> callback)
{
Usage: passcount COUNT TPNUM, where TPNUM may also be \"all\";\n\
if TPNUM is omitted, passcount refers to the last tracepoint defined."));
- add_prefix_cmd ("save", class_breakpoint, save_command,
- _("Save breakpoint definitions as a script."),
- &save_cmdlist, "save ",
- 0/*allow-unknown*/, &cmdlist);
+ add_basic_prefix_cmd ("save", class_breakpoint,
+ _("Save breakpoint definitions as a script."),
+ &save_cmdlist, "save ",
+ 0/*allow-unknown*/, &cmdlist);
c = add_cmd ("breakpoints", class_breakpoint, save_breakpoints_command, _("\
Save current breakpoint definitions as a script.\n\
btrace_clear (tp);
}
-/* The "maintenance btrace" command. */
-
-static void
-maint_btrace_cmd (const char *args, int from_tty)
-{
- help_list (maint_btrace_cmdlist, "maintenance btrace ", all_commands,
- gdb_stdout);
-}
-
-/* The "maintenance set btrace" command. */
-
-static void
-maint_btrace_set_cmd (const char *args, int from_tty)
-{
- help_list (maint_btrace_set_cmdlist, "maintenance set btrace ", all_commands,
- gdb_stdout);
-}
-
-/* The "maintenance show btrace" command. */
-
-static void
-maint_btrace_show_cmd (const char *args, int from_tty)
-{
- help_list (maint_btrace_show_cmdlist, "maintenance show btrace ",
- all_commands, gdb_stdout);
-}
-
-/* The "maintenance set btrace pt" command. */
-
-static void
-maint_btrace_pt_set_cmd (const char *args, int from_tty)
-{
- help_list (maint_btrace_pt_set_cmdlist, "maintenance set btrace pt ",
- all_commands, gdb_stdout);
-}
-
-/* The "maintenance show btrace pt" command. */
-
-static void
-maint_btrace_pt_show_cmd (const char *args, int from_tty)
-{
- help_list (maint_btrace_pt_show_cmdlist, "maintenance show btrace pt ",
- all_commands, gdb_stdout);
-}
-
/* The "maintenance info btrace" command. */
static void
add_cmd ("btrace", class_maintenance, maint_info_btrace_cmd,
_("Info about branch tracing data."), &maintenanceinfolist);
- add_prefix_cmd ("btrace", class_maintenance, maint_btrace_cmd,
- _("Branch tracing maintenance commands."),
- &maint_btrace_cmdlist, "maintenance btrace ",
- 0, &maintenancelist);
+ add_basic_prefix_cmd ("btrace", class_maintenance,
+ _("Branch tracing maintenance commands."),
+ &maint_btrace_cmdlist, "maintenance btrace ",
+ 0, &maintenancelist);
- add_prefix_cmd ("btrace", class_maintenance, maint_btrace_set_cmd, _("\
+ add_basic_prefix_cmd ("btrace", class_maintenance, _("\
Set branch tracing specific variables."),
- &maint_btrace_set_cmdlist, "maintenance set btrace ",
- 0, &maintenance_set_cmdlist);
+ &maint_btrace_set_cmdlist, "maintenance set btrace ",
+ 0, &maintenance_set_cmdlist);
- add_prefix_cmd ("pt", class_maintenance, maint_btrace_pt_set_cmd, _("\
+ add_basic_prefix_cmd ("pt", class_maintenance, _("\
Set Intel Processor Trace specific variables."),
- &maint_btrace_pt_set_cmdlist, "maintenance set btrace pt ",
- 0, &maint_btrace_set_cmdlist);
+ &maint_btrace_pt_set_cmdlist,
+ "maintenance set btrace pt ",
+ 0, &maint_btrace_set_cmdlist);
- add_prefix_cmd ("btrace", class_maintenance, maint_btrace_show_cmd, _("\
+ add_show_prefix_cmd ("btrace", class_maintenance, _("\
Show branch tracing specific variables."),
- &maint_btrace_show_cmdlist, "maintenance show btrace ",
- 0, &maintenance_show_cmdlist);
+ &maint_btrace_show_cmdlist, "maintenance show btrace ",
+ 0, &maintenance_show_cmdlist);
- add_prefix_cmd ("pt", class_maintenance, maint_btrace_pt_show_cmd, _("\
+ add_show_prefix_cmd ("pt", class_maintenance, _("\
Show Intel Processor Trace specific variables."),
- &maint_btrace_pt_show_cmdlist, "maintenance show btrace pt ",
- 0, &maint_btrace_show_cmdlist);
+ &maint_btrace_pt_show_cmdlist,
+ "maintenance show btrace pt ",
+ 0, &maint_btrace_show_cmdlist);
add_setshow_boolean_cmd ("skip-pad", class_maintenance,
&maint_btrace_pt_skip_pad, _("\
error (_("Argument required (%s)."), why);
}
-/* The "info" command is defined as a prefix, with allow_unknown = 0.
- Therefore, its own definition is called only for "info" with no
- args. */
-
-static void
-info_command (const char *arg, int from_tty)
-{
- printf_unfiltered (_("\"info\" must be followed by "
- "the name of an info command.\n"));
- help_list (infolist, "info ", all_commands, gdb_stdout);
-}
-
-/* The "show" command with no arguments shows all the settings. */
-
-static void
-show_command (const char *arg, int from_tty)
-{
- cmd_show_list (showlist, from_tty, "");
-}
-
/* See cli/cli-cmds.h. */
void
sals.erase (from, sals.end ());
}
-static void
-set_debug (const char *arg, int from_tty)
-{
- printf_unfiltered (_("\"set debug\" must be followed by "
- "the name of a debug subcommand.\n"));
- help_list (setdebuglist, "set debug ", all_commands, gdb_stdout);
-}
-
-static void
-show_debug (const char *args, int from_tty)
-{
- cmd_show_list (showdebuglist, from_tty, "");
-}
-
void
init_cmd_lists (void)
{
show_info_verbose,
&setlist, &showlist);
- add_prefix_cmd ("history", class_support, set_history,
- _("Generic command for setting command history parameters."),
- &sethistlist, "set history ", 0, &setlist);
- add_prefix_cmd ("history", class_support, show_history,
- _("Generic command for showing command history parameters."),
- &showhistlist, "show history ", 0, &showlist);
+ add_basic_prefix_cmd ("history", class_support, _("\
+Generic command for setting command history parameters."),
+ &sethistlist, "set history ", 0, &setlist);
+ add_show_prefix_cmd ("history", class_support, _("\
+Generic command for showing command history parameters."),
+ &showhistlist, "show history ", 0, &showlist);
add_setshow_boolean_cmd ("expansion", no_class, &history_expansion_p, _("\
Set history expansion on command input."), _("\
show_history_expansion_p,
&sethistlist, &showhistlist);
- add_prefix_cmd ("info", class_info, info_command, _("\
+ add_basic_prefix_cmd ("info", class_info, _("\
Generic command for showing things about the program being debugged."),
- &infolist, "info ", 0, &cmdlist);
+ &infolist, "info ", 0, &cmdlist);
add_com_alias ("i", "info", class_info, 1);
add_com_alias ("inf", "info", class_info, 1);
add_com ("complete", class_obscure, complete_command,
_("List the completions for the rest of the line as a command."));
- add_prefix_cmd ("show", class_info, show_command, _("\
+ add_show_prefix_cmd ("show", class_info, _("\
Generic command for showing things about the debugger."),
- &showlist, "show ", 0, &cmdlist);
+ &showlist, "show ", 0, &cmdlist);
/* Another way to get at the same thing. */
- add_info ("set", show_command, _("Show all GDB settings."));
+ add_show_prefix_cmd ("set", class_info, _("Show all GDB settings."),
+ &showlist, "info set ", 0, &infolist);
c = add_com ("with", class_vars, with_command, _("\
Temporarily set SETTING to VALUE, run COMMAND, and restore SETTING.\n\
show_remote_timeout,
&setlist, &showlist);
- add_prefix_cmd ("debug", no_class, set_debug,
- _("Generic command for setting gdb debugging flags."),
- &setdebuglist, "set debug ", 0, &setlist);
+ add_basic_prefix_cmd ("debug", no_class,
+ _("Generic command for setting gdb debugging flags."),
+ &setdebuglist, "set debug ", 0, &setlist);
- add_prefix_cmd ("debug", no_class, show_debug,
- _("Generic command for showing gdb debugging flags."),
- &showdebuglist, "show debug ", 0, &showlist);
+ add_show_prefix_cmd ("debug", no_class,
+ _("Generic command for showing gdb debugging flags."),
+ &showdebuglist, "show debug ", 0, &showlist);
c = add_com ("shell", class_support, shell_command, _("\
Execute the rest of the line as a shell command.\n\
return c;
}
+/* A helper function for add_basic_prefix_cmd. This is a command
+ function that just forwards to help_list. */
+
+static void
+do_prefix_cmd (const char *args, int from_tty, struct cmd_list_element *c)
+{
+ /* Look past all aliases. */
+ while (c->cmd_pointer != nullptr)
+ c = c->cmd_pointer;
+
+ help_list (*c->prefixlist, c->prefixname, all_commands, gdb_stdout);
+}
+
+/* See command.h. */
+
+struct cmd_list_element *
+add_basic_prefix_cmd (const char *name, enum command_class theclass,
+ const char *doc, struct cmd_list_element **prefixlist,
+ const char *prefixname, int allow_unknown,
+ struct cmd_list_element **list)
+{
+ struct cmd_list_element *cmd = add_prefix_cmd (name, theclass, nullptr,
+ doc, prefixlist, prefixname,
+ allow_unknown, list);
+ set_cmd_sfunc (cmd, do_prefix_cmd);
+ return cmd;
+}
+
+/* A helper function for add_show_prefix_cmd. This is a command
+ function that just forwards to cmd_show_list. */
+
+static void
+do_show_prefix_cmd (const char *args, int from_tty, struct cmd_list_element *c)
+{
+ cmd_show_list (*c->prefixlist, from_tty, "");
+}
+
+/* See command.h. */
+
+struct cmd_list_element *
+add_show_prefix_cmd (const char *name, enum command_class theclass,
+ const char *doc, struct cmd_list_element **prefixlist,
+ const char *prefixname, int allow_unknown,
+ struct cmd_list_element **list)
+{
+ struct cmd_list_element *cmd = add_prefix_cmd (name, theclass, nullptr,
+ doc, prefixlist, prefixname,
+ allow_unknown, list);
+ set_cmd_sfunc (cmd, do_show_prefix_cmd);
+ return cmd;
+}
+
/* Like ADD_PREFIX_CMD but sets the suppress_notification pointer on the
new command list element. */
static struct cmd_list_element *binary_dump_cmdlist;
static struct cmd_list_element *binary_append_cmdlist;
-static void
-dump_command (const char *cmd, int from_tty)
-{
- printf_unfiltered (_("\"dump\" must be followed by a subcommand.\n\n"));
- help_list (dump_cmdlist, "dump ", all_commands, gdb_stdout);
-}
-
-static void
-append_command (const char *cmd, int from_tty)
-{
- printf_unfiltered (_("\"append\" must be followed by a subcommand.\n\n"));
- help_list (dump_cmdlist, "append ", all_commands, gdb_stdout);
-}
-
static void
dump_binary_file (const char *filename, const char *mode,
const bfd_byte *buf, ULONGEST len)
}
}
-static void
-srec_dump_command (const char *cmd, int from_tty)
-{
- printf_unfiltered (_("\"dump srec\" must be followed by a subcommand.\n"));
- help_list (srec_cmdlist, "dump srec ", all_commands, gdb_stdout);
-}
-
-static void
-ihex_dump_command (const char *cmd, int from_tty)
-{
- printf_unfiltered (_("\"dump ihex\" must be followed by a subcommand.\n"));
- help_list (ihex_cmdlist, "dump ihex ", all_commands, gdb_stdout);
-}
-
-static void
-verilog_dump_command (const char *cmd, int from_tty)
-{
- printf_unfiltered (_("\"dump verilog\" must be followed by a subcommand.\n"));
- help_list (verilog_cmdlist, "dump verilog ", all_commands, gdb_stdout);
-}
-
-static void
-tekhex_dump_command (const char *cmd, int from_tty)
-{
- printf_unfiltered (_("\"dump tekhex\" must be followed by a subcommand.\n"));
- help_list (tekhex_cmdlist, "dump tekhex ", all_commands, gdb_stdout);
-}
-
-static void
-binary_dump_command (const char *cmd, int from_tty)
-{
- printf_unfiltered (_("\"dump binary\" must be followed by a subcommand.\n"));
- help_list (binary_dump_cmdlist, "dump binary ", all_commands, gdb_stdout);
-}
-
-static void
-binary_append_command (const char *cmd, int from_tty)
-{
- printf_unfiltered (_("\"append binary\" must be followed by a subcommand.\n"));
- help_list (binary_append_cmdlist, "append binary ", all_commands,
- gdb_stdout);
-}
-
void _initialize_cli_dump ();
void
_initialize_cli_dump ()
{
struct cmd_list_element *c;
- add_prefix_cmd ("dump", class_vars, dump_command,
- _("Dump target code/data to a local file."),
- &dump_cmdlist, "dump ",
- 0/*allow-unknown*/,
- &cmdlist);
- add_prefix_cmd ("append", class_vars, append_command,
- _("Append target code/data to a local file."),
- &append_cmdlist, "append ",
- 0/*allow-unknown*/,
- &cmdlist);
+ add_basic_prefix_cmd ("dump", class_vars,
+ _("Dump target code/data to a local file."),
+ &dump_cmdlist, "dump ",
+ 0/*allow-unknown*/,
+ &cmdlist);
+ add_basic_prefix_cmd ("append", class_vars,
+ _("Append target code/data to a local file."),
+ &append_cmdlist, "append ",
+ 0/*allow-unknown*/,
+ &cmdlist);
add_dump_command ("memory", dump_memory_command, "\
Write contents of memory to a raw binary file.\n\
Arguments are FILE EXPRESSION. Writes the value of EXPRESSION to\n\
the specified FILE in raw target ordered bytes.");
- add_prefix_cmd ("srec", all_commands, srec_dump_command,
- _("Write target code/data to an srec file."),
- &srec_cmdlist, "dump srec ",
- 0 /*allow-unknown*/,
- &dump_cmdlist);
-
- add_prefix_cmd ("ihex", all_commands, ihex_dump_command,
- _("Write target code/data to an intel hex file."),
- &ihex_cmdlist, "dump ihex ",
- 0 /*allow-unknown*/,
- &dump_cmdlist);
-
- add_prefix_cmd ("verilog", all_commands, verilog_dump_command,
- _("Write target code/data to a verilog hex file."),
- &verilog_cmdlist, "dump verilog ",
- 0 /*allow-unknown*/,
- &dump_cmdlist);
-
- add_prefix_cmd ("tekhex", all_commands, tekhex_dump_command,
- _("Write target code/data to a tekhex file."),
- &tekhex_cmdlist, "dump tekhex ",
- 0 /*allow-unknown*/,
- &dump_cmdlist);
-
- add_prefix_cmd ("binary", all_commands, binary_dump_command,
- _("Write target code/data to a raw binary file."),
- &binary_dump_cmdlist, "dump binary ",
- 0 /*allow-unknown*/,
- &dump_cmdlist);
-
- add_prefix_cmd ("binary", all_commands, binary_append_command,
- _("Append target code/data to a raw binary file."),
- &binary_append_cmdlist, "append binary ",
- 0 /*allow-unknown*/,
- &append_cmdlist);
+ add_basic_prefix_cmd ("srec", all_commands,
+ _("Write target code/data to an srec file."),
+ &srec_cmdlist, "dump srec ",
+ 0 /*allow-unknown*/,
+ &dump_cmdlist);
+
+ add_basic_prefix_cmd ("ihex", all_commands,
+ _("Write target code/data to an intel hex file."),
+ &ihex_cmdlist, "dump ihex ",
+ 0 /*allow-unknown*/,
+ &dump_cmdlist);
+
+ add_basic_prefix_cmd ("verilog", all_commands,
+ _("Write target code/data to a verilog hex file."),
+ &verilog_cmdlist, "dump verilog ",
+ 0 /*allow-unknown*/,
+ &dump_cmdlist);
+
+ add_basic_prefix_cmd ("tekhex", all_commands,
+ _("Write target code/data to a tekhex file."),
+ &tekhex_cmdlist, "dump tekhex ",
+ 0 /*allow-unknown*/,
+ &dump_cmdlist);
+
+ add_basic_prefix_cmd ("binary", all_commands,
+ _("Write target code/data to a raw binary file."),
+ &binary_dump_cmdlist, "dump binary ",
+ 0 /*allow-unknown*/,
+ &dump_cmdlist);
+
+ add_basic_prefix_cmd ("binary", all_commands,
+ _("Append target code/data to a raw binary file."),
+ &binary_append_cmdlist, "append binary ",
+ 0 /*allow-unknown*/,
+ &append_cmdlist);
add_cmd ("memory", all_commands, dump_srec_memory, _("\
Write contents of memory to an srec file.\n\
cli_style_option::add_setshow_commands (enum command_class theclass,
const char *prefix_doc,
struct cmd_list_element **set_list,
- void (*do_set) (const char *args,
- int from_tty),
struct cmd_list_element **show_list,
- void (*do_show) (const char *args,
- int from_tty),
bool skip_intensity)
{
m_set_prefix = std::string ("set style ") + m_name + " ";
m_show_prefix = std::string ("show style ") + m_name + " ";
- add_prefix_cmd (m_name, no_class, do_set, prefix_doc, &m_set_list,
- m_set_prefix.c_str (), 0, set_list);
- add_prefix_cmd (m_name, no_class, do_show, prefix_doc, &m_show_list,
- m_show_prefix.c_str (), 0, show_list);
+ add_basic_prefix_cmd (m_name, no_class, prefix_doc, &m_set_list,
+ m_set_prefix.c_str (), 0, set_list);
+ add_show_prefix_cmd (m_name, no_class, prefix_doc, &m_show_list,
+ m_show_prefix.c_str (), 0, show_list);
add_setshow_enum_cmd ("foreground", theclass, cli_colors,
&m_foreground,
static cmd_list_element *style_set_list;
static cmd_list_element *style_show_list;
-static void
-set_style (const char *arg, int from_tty)
-{
- printf_unfiltered (_("\"set style\" must be followed "
- "by an appropriate subcommand.\n"));
- help_list (style_set_list, "set style ", all_commands, gdb_stdout);
-}
-
-static void
-show_style (const char *arg, int from_tty)
-{
- cmd_show_list (style_show_list, from_tty, "");
-}
-
static void
set_style_enabled (const char *args, int from_tty, struct cmd_list_element *c)
{
fprintf_filtered (file, _("Source code styling is disabled.\n"));
}
-/* Builds the "set style NAME " prefix. */
-
-static std::string
-set_style_name (const char *name)
-{
- std::string result ("set style ");
-
- result += name;
- result += " ";
- return result;
-}
-
void _initialize_cli_style ();
void
_initialize_cli_style ()
{
- add_prefix_cmd ("style", no_class, set_style, _("\
+ add_basic_prefix_cmd ("style", no_class, _("\
Style-specific settings.\n\
Configure various style-related variables, such as colors"),
&style_set_list, "set style ", 0, &setlist);
- add_prefix_cmd ("style", no_class, show_style, _("\
+ add_show_prefix_cmd ("style", no_class, _("\
Style-specific settings.\n\
Configure various style-related variables, such as colors"),
&style_show_list, "show style ", 0, &showlist);
), set_style_enabled, show_style_sources,
&style_set_list, &style_show_list);
-#define STYLE_ADD_SETSHOW_COMMANDS(STYLE, PREFIX_DOC, SKIP) \
- STYLE.add_setshow_commands (no_class, PREFIX_DOC, \
- &style_set_list, \
- [] (const char *args, int from_tty) \
- { \
- help_list \
- (STYLE.set_list (), \
- set_style_name (STYLE.name ()).c_str (), \
- all_commands, \
- gdb_stdout); \
- }, \
- &style_show_list, \
- [] (const char *args, int from_tty) \
- { \
- cmd_show_list \
- (STYLE.show_list (), \
- from_tty, \
- ""); \
- }, SKIP)
-
- STYLE_ADD_SETSHOW_COMMANDS (file_name_style,
- _("\
+ file_name_style.add_setshow_commands (no_class, _("\
Filename display styling.\n\
-Configure filename colors and display intensity."), false);
+Configure filename colors and display intensity."),
+ &style_set_list, &style_show_list,
+ false);
- STYLE_ADD_SETSHOW_COMMANDS (function_name_style,
- _("\
+ function_name_style.add_setshow_commands (no_class, _("\
Function name display styling.\n\
-Configure function name colors and display intensity"), false);
+Configure function name colors and display intensity"),
+ &style_set_list, &style_show_list,
+ false);
- STYLE_ADD_SETSHOW_COMMANDS (variable_name_style,
- _("\
+ variable_name_style.add_setshow_commands (no_class, _("\
Variable name display styling.\n\
-Configure variable name colors and display intensity"), false);
+Configure variable name colors and display intensity"),
+ &style_set_list, &style_show_list,
+ false);
- STYLE_ADD_SETSHOW_COMMANDS (address_style,
- _("\
+ address_style.add_setshow_commands (no_class, _("\
Address display styling.\n\
-Configure address colors and display intensity"), false);
+Configure address colors and display intensity"),
+ &style_set_list, &style_show_list,
+ false);
- STYLE_ADD_SETSHOW_COMMANDS (title_style,
- _("\
+ title_style.add_setshow_commands (no_class, _("\
Title display styling.\n\
Configure title colors and display intensity\n\
Some commands (such as \"apropos -v REGEXP\") use the title style to improve\n\
-readability."), false);
+readability."),
+ &style_set_list, &style_show_list,
+ false);
- STYLE_ADD_SETSHOW_COMMANDS (highlight_style,
- _("\
+ highlight_style.add_setshow_commands (no_class, _("\
Highlight display styling.\n\
Configure highlight colors and display intensity\n\
Some commands use the highlight style to draw the attention to a part\n\
-of their output."), false);
+of their output."),
+ &style_set_list, &style_show_list,
+ false);
- STYLE_ADD_SETSHOW_COMMANDS (metadata_style,
- _("\
+ metadata_style.add_setshow_commands (no_class, _("\
Metadata display styling.\n\
Configure metadata colors and display intensity\n\
The \"metadata\" style is used when GDB displays information about\n\
-your data, for example \"<unavailable>\""), false);
+your data, for example \"<unavailable>\""),
+ &style_set_list, &style_show_list,
+ false);
- STYLE_ADD_SETSHOW_COMMANDS (tui_border_style,
- _("\
+ tui_border_style.add_setshow_commands (no_class, _("\
TUI border display styling.\n\
Configure TUI border colors\n\
The \"tui-border\" style is used when GDB displays the border of a\n\
-TUI window that does not have the focus."), true);
+TUI window that does not have the focus."),
+ &style_set_list, &style_show_list,
+ true);
- STYLE_ADD_SETSHOW_COMMANDS (tui_active_border_style,
- _("\
+ tui_active_border_style.add_setshow_commands (no_class, _("\
TUI active border display styling.\n\
Configure TUI active border colors\n\
The \"tui-active-border\" style is used when GDB displays the border of a\n\
-TUI window that does have the focus."), true);
+TUI window that does have the focus."),
+ &style_set_list,
+ &style_show_list,
+ true);
}
void add_setshow_commands (enum command_class theclass,
const char *prefix_doc,
struct cmd_list_element **set_list,
- void (*do_set) (const char *args, int from_tty),
struct cmd_list_element **show_list,
- void (*do_show) (const char *args, int from_tty),
bool skip_intensity);
/* Return the 'set style NAME' command list, that can be used
const char *, int,
struct cmd_list_element **);
+/* Like add_prefix_cmd, but sets the callback to a function that
+ simply calls help_list. */
+
+extern struct cmd_list_element *add_basic_prefix_cmd
+ (const char *, enum command_class, const char *, struct cmd_list_element **,
+ const char *, int, struct cmd_list_element **);
+
+/* Like add_prefix_cmd, but useful for "show" prefixes. This sets the
+ callback to a function that simply calls cmd_show_list. */
+
+extern struct cmd_list_element *add_show_prefix_cmd
+ (const char *, enum command_class, const char *, struct cmd_list_element **,
+ const char *, int, struct cmd_list_element **);
+
extern struct cmd_list_element *add_prefix_cmd_suppress_notification
(const char *name, enum command_class theclass,
cmd_const_cfunc_ftype *fun,
#endif /* GDB_SELF_CHECK */
-/* Don't allow just "maintenance cplus". */
-
-static void
-maint_cplus_command (const char *arg, int from_tty)
-{
- printf_unfiltered (_("\"maintenance cplus\" must be followed "
- "by the name of a command.\n"));
- help_list (maint_cplus_cmd_list,
- "maintenance cplus ",
- all_commands, gdb_stdout);
-}
-
/* This is a front end for cp_find_first_component, for unit testing.
Be careful when using it: see the NOTE above
cp_find_first_component. */
void
_initialize_cp_support ()
{
- add_prefix_cmd ("cplus", class_maintenance,
- maint_cplus_command,
- _("C++ maintenance commands."),
- &maint_cplus_cmd_list,
- "maintenance cplus ",
- 0, &maintenancelist);
+ add_basic_prefix_cmd ("cplus", class_maintenance,
+ _("C++ maintenance commands."),
+ &maint_cplus_cmd_list,
+ "maintenance cplus ",
+ 0, &maintenancelist);
add_alias_cmd ("cp", "cplus",
class_maintenance, 1,
&maintenancelist);
target_dcache_invalidate ();
}
-static void
-set_dcache_command (const char *arg, int from_tty)
-{
- printf_unfiltered (
- "\"set dcache\" must be followed by the name of a subcommand.\n");
- help_list (dcache_set_list, "set dcache ", all_commands, gdb_stdout);
-}
-
-static void
-show_dcache_command (const char *args, int from_tty)
-{
- cmd_show_list (dcache_show_list, from_tty, "");
-}
-
void _initialize_dcache ();
void
_initialize_dcache ()
summary of each line in the cache. With an argument, dump\"\n\
the contents of the given line."));
- add_prefix_cmd ("dcache", class_obscure, set_dcache_command, _("\
+ add_basic_prefix_cmd ("dcache", class_obscure, _("\
Use this command to set number of lines in dcache and line-size."),
- &dcache_set_list, "set dcache ", /*allow_unknown*/0, &setlist);
- add_prefix_cmd ("dcache", class_obscure, show_dcache_command, _("\
+ &dcache_set_list, "set dcache ", /*allow_unknown*/0,
+ &setlist);
+ add_show_prefix_cmd ("dcache", class_obscure, _("\
Show dcachesettings."),
- &dcache_show_list, "show dcache ", /*allow_unknown*/0, &showlist);
+ &dcache_show_list, "show dcache ", /*allow_unknown*/0,
+ &showlist);
add_setshow_zuinteger_cmd ("line-size", class_obscure,
&dcache_line_size, _("\
struct cmd_list_element *set_dwarf_cmdlist;
struct cmd_list_element *show_dwarf_cmdlist;
-static void
-set_dwarf_cmd (const char *args, int from_tty)
-{
- help_list (set_dwarf_cmdlist, "maintenance set dwarf ", all_commands,
- gdb_stdout);
-}
-
-static void
-show_dwarf_cmd (const char *args, int from_tty)
-{
- cmd_show_list (show_dwarf_cmdlist, from_tty, "");
-}
-
static void
show_check_physname (struct ui_file *file, int from_tty,
struct cmd_list_element *c, const char *value)
void
_initialize_dwarf2_read ()
{
- add_prefix_cmd ("dwarf", class_maintenance, set_dwarf_cmd, _("\
+ add_basic_prefix_cmd ("dwarf", class_maintenance, _("\
Set DWARF specific variables.\n\
Configure DWARF variables such as the cache size."),
- &set_dwarf_cmdlist, "maintenance set dwarf ",
- 0/*allow-unknown*/, &maintenance_set_cmdlist);
+ &set_dwarf_cmdlist, "maintenance set dwarf ",
+ 0/*allow-unknown*/, &maintenance_set_cmdlist);
- add_prefix_cmd ("dwarf", class_maintenance, show_dwarf_cmd, _("\
+ add_show_prefix_cmd ("dwarf", class_maintenance, _("\
Show DWARF specific variables.\n\
Show DWARF variables such as the cache size."),
- &show_dwarf_cmdlist, "maintenance show dwarf ",
- 0/*allow-unknown*/, &maintenance_show_cmdlist);
+ &show_dwarf_cmdlist, "maintenance show dwarf ",
+ 0/*allow-unknown*/, &maintenance_show_cmdlist);
add_setshow_zinteger_cmd ("max-cache-age", class_obscure,
&dwarf_max_cache_age, _("\
static struct cmd_list_element *set_backtrace_cmdlist;
static struct cmd_list_element *show_backtrace_cmdlist;
-static void
-set_backtrace_cmd (const char *args, int from_tty)
-{
- help_list (set_backtrace_cmdlist, "set backtrace ", all_commands,
- gdb_stdout);
-}
-
-static void
-show_backtrace_cmd (const char *args, int from_tty)
-{
- cmd_show_list (show_backtrace_cmdlist, from_tty, "");
-}
-
/* Definition of the "set backtrace" settings that are exposed as
"backtrace" command options. */
gdb::observers::target_changed.attach (frame_observer_target_changed);
- add_prefix_cmd ("backtrace", class_maintenance, set_backtrace_cmd, _("\
+ add_basic_prefix_cmd ("backtrace", class_maintenance, _("\
Set backtrace specific variables.\n\
Configure backtrace variables such as the backtrace limit"),
- &set_backtrace_cmdlist, "set backtrace ",
- 0/*allow-unknown*/, &setlist);
- add_prefix_cmd ("backtrace", class_maintenance, show_backtrace_cmd, _("\
+ &set_backtrace_cmdlist, "set backtrace ",
+ 0/*allow-unknown*/, &setlist);
+ add_show_prefix_cmd ("backtrace", class_maintenance, _("\
Show backtrace specific variables.\n\
Show backtrace variables such as the backtrace limit."),
- &show_backtrace_cmdlist, "show backtrace ",
- 0/*allow-unknown*/, &showlist);
+ &show_backtrace_cmdlist, "show backtrace ",
+ 0/*allow-unknown*/, &showlist);
add_setshow_uinteger_cmd ("limit", class_obscure,
&user_set_backtrace_options.backtrace_limit, _("\
static struct cmd_list_element *info_dos_cmdlist = NULL;
-static void
-go32_info_dos_command (const char *args, int from_tty)
-{
- help_list (info_dos_cmdlist, "info dos ", class_info, gdb_stdout);
-}
-
void _initialize_go32_nat ();
void
_initialize_go32_nat ()
/* We are always processing GCC-compiled programs. */
processing_gcc_compilation = 2;
- add_prefix_cmd ("dos", class_info, go32_info_dos_command, _("\
+ add_basic_prefix_cmd ("dos", class_info, _("\
Print information specific to DJGPP (aka MS-DOS) debugging."),
- &info_dos_cmdlist, "info dos ", 0, &infolist);
+ &info_dos_cmdlist, "info dos ", 0, &infolist);
add_cmd ("sysinfo", class_info, go32_sysinfo, _("\
Display information about the target system, including CPU, OS, DPMI, etc."),
static struct cmd_list_element *show_guile_list;
static struct cmd_list_element *info_guile_list;
-/* Function for use by 'set guile' prefix command. */
-
-static void
-set_guile_command (const char *args, int from_tty)
-{
- help_list (set_guile_list, "set guile ", all_commands, gdb_stdout);
-}
-
-/* Function for use by 'show guile' prefix command. */
-
-static void
-show_guile_command (const char *args, int from_tty)
-{
- cmd_show_list (show_guile_list, from_tty, "");
-}
-
-/* The "info scheme" command is defined as a prefix, with
- allow_unknown 0. Therefore, its own definition is called only for
- "info scheme" with no args. */
-
-static void
-info_guile_command (const char *args, int from_tty)
-{
- printf_unfiltered (_("\"info guile\" must be followed"
- " by the name of an info command.\n"));
- help_list (info_guile_list, "info guile ", all_commands, gdb_stdout);
-}
\f
/* Initialization. */
);
add_com_alias ("gu", "guile", class_obscure, 1);
- add_prefix_cmd ("guile", class_obscure, set_guile_command,
- _("Prefix command for Guile preference settings."),
- &set_guile_list, "set guile ", 0,
- &setlist);
+ add_basic_prefix_cmd ("guile", class_obscure,
+ _("Prefix command for Guile preference settings."),
+ &set_guile_list, "set guile ", 0,
+ &setlist);
add_alias_cmd ("gu", "guile", class_obscure, 1, &setlist);
- add_prefix_cmd ("guile", class_obscure, show_guile_command,
- _("Prefix command for Guile preference settings."),
- &show_guile_list, "show guile ", 0,
- &showlist);
+ add_show_prefix_cmd ("guile", class_obscure,
+ _("Prefix command for Guile preference settings."),
+ &show_guile_list, "show guile ", 0,
+ &showlist);
add_alias_cmd ("gu", "guile", class_obscure, 1, &showlist);
- add_prefix_cmd ("guile", class_obscure, info_guile_command,
- _("Prefix command for Guile info displays."),
- &info_guile_list, "info guile ", 0,
- &infolist);
+ add_basic_prefix_cmd ("guile", class_obscure,
+ _("Prefix command for Guile info displays."),
+ &info_guile_list, "info guile ", 0,
+ &infolist);
add_info_alias ("gu", "guile", 1);
/* The name "print-stack" is carried over from Python.
static struct cmd_list_element *mpx_set_cmdlist, *mpx_show_cmdlist;
-/* Helper function for the CLI commands. */
-
-static void
-set_mpx_cmd (const char *args, int from_tty)
-{
- help_list (mpx_set_cmdlist, "set mpx ", all_commands, gdb_stdout);
-}
-
-/* Helper function for the CLI commands. */
-
-static void
-show_mpx_cmd (const char *args, int from_tty)
-{
- cmd_show_list (mpx_show_cmdlist, from_tty, "");
-}
-
void _initialize_i386_tdep ();
void
_initialize_i386_tdep ()
/* Add "mpx" prefix for the set commands. */
- add_prefix_cmd ("mpx", class_support, set_mpx_cmd, _("\
+ add_basic_prefix_cmd ("mpx", class_support, _("\
Set Intel Memory Protection Extensions specific variables."),
- &mpx_set_cmdlist, "set mpx ",
- 0 /* allow-unknown */, &setlist);
+ &mpx_set_cmdlist, "set mpx ",
+ 0 /* allow-unknown */, &setlist);
/* Add "mpx" prefix for the show commands. */
- add_prefix_cmd ("mpx", class_support, show_mpx_cmd, _("\
+ add_show_prefix_cmd ("mpx", class_support, _("\
Show Intel Memory Protection Extensions specific variables."),
- &mpx_show_cmdlist, "show mpx ",
- 0 /* allow-unknown */, &showlist);
+ &mpx_show_cmdlist, "show mpx ",
+ 0 /* allow-unknown */, &showlist);
/* Add "bound" command for the show mpx commands list. */
gdbarch_print_float_info (get_frame_arch (frame), gdb_stdout, frame, args);
}
\f
-static void
-unset_command (const char *args, int from_tty)
-{
- printf_filtered (_("\"unset\" must be followed by the "
- "name of an unset subcommand.\n"));
- help_list (unsetlist, "unset ", all_commands, gdb_stdout);
-}
-
/* Implement `info proc' family of commands. */
static void
environment to be given to the program."), &showlist);
set_cmd_completer (c, noop_completer);
- add_prefix_cmd ("unset", no_class, unset_command,
- _("Complement to certain \"set\" commands."),
- &unsetlist, "unset ", 0, &cmdlist);
+ add_basic_prefix_cmd ("unset", no_class,
+ _("Complement to certain \"set\" commands."),
+ &unsetlist, "unset ", 0, &cmdlist);
c = add_cmd ("environment", class_run, unset_environment_command, _("\
Cancel environment variable VAR for the program.\n\
return languages[lang]->la_name;
}
-static void
-set_check (const char *ignore, int from_tty)
-{
- printf_unfiltered (
- "\"set check\" must be followed by the name of a check subcommand.\n");
- help_list (setchecklist, "set check ", all_commands, gdb_stdout);
-}
-
-static void
-show_check (const char *ignore, int from_tty)
-{
- cmd_show_list (showchecklist, from_tty, "");
-}
\f
/* Build and install the "set language LANG" command. */
/* GDB commands for language specific stuff. */
- add_prefix_cmd ("check", no_class, set_check,
- _("Set the status of the type/range checker."),
- &setchecklist, "set check ", 0, &setlist);
+ add_basic_prefix_cmd ("check", no_class,
+ _("Set the status of the type/range checker."),
+ &setchecklist, "set check ", 0, &setlist);
add_alias_cmd ("c", "check", no_class, 1, &setlist);
add_alias_cmd ("ch", "check", no_class, 1, &setlist);
- add_prefix_cmd ("check", no_class, show_check,
- _("Show the status of the type/range checker."),
- &showchecklist, "show check ", 0, &showlist);
+ add_show_prefix_cmd ("check", no_class,
+ _("Show the status of the type/range checker."),
+ &showchecklist, "show check ", 0, &showlist);
add_alias_cmd ("c", "check", no_class, 1, &showlist);
add_alias_cmd ("ch", "check", no_class, 1, &showlist);
static struct cmd_list_element *macrolist;
-static void
-macro_command (const char *arg, int from_tty)
-{
- printf_unfiltered
- ("\"macro\" must be followed by the name of a macro command.\n");
- help_list (macrolist, "macro ", all_commands, gdb_stdout);
-}
-
-
\f
/* Macro expansion commands. */
{
/* We introduce a new command prefix, `macro', under which we'll put
the various commands for working with preprocessor macros. */
- add_prefix_cmd ("macro", class_info, macro_command,
- _("Prefix for commands dealing with C preprocessor macros."),
- ¯olist, "macro ", 0, &cmdlist);
+ add_basic_prefix_cmd ("macro", class_info,
+ _("Prefix for commands dealing with C preprocessor macros."),
+ ¯olist, "macro ", 0, &cmdlist);
add_cmd ("expand", no_class, macro_expand_command, _("\
Fully expand any C/C++ preprocessor macro invocations in EXPRESSION.\n\
/* Command list for maint test-options. */
struct cmd_list_element *maintenance_test_options_list;
-/* The "maintenance test-options" prefix command. */
-
-static void
-maintenance_test_options_command (const char *arg, int from_tty)
-{
- printf_unfiltered
- (_("\"maintenance test-options\" must be followed "
- "by the name of a subcommand.\n"));
- help_list (maintenance_test_options_list, "maintenance test-options ",
- all_commands, gdb_stdout);
-}
-
\f
void _initialize_maint_test_options ();
void
{
cmd_list_element *cmd;
- add_prefix_cmd ("test-options", no_class, maintenance_test_options_command,
- _("\
+ add_basic_prefix_cmd ("test-options", no_class,
+ _("\
Generic command for testing the options infrastructure."),
- &maintenance_test_options_list,
- "maintenance test-options ", 0,
- &maintenancelist);
+ &maintenance_test_options_list,
+ "maintenance test-options ", 0,
+ &maintenancelist);
const auto def_group = make_test_options_options_def_group (nullptr);
/* Command list for "maint show test-settings". */
static cmd_list_element *maintenance_show_test_settings_list;
-/* The "maintenance set test-settings" prefix command. */
-
-static void
-maintenance_set_test_settings_cmd (const char *args, int from_tty)
-{
- printf_unfiltered (_("\"maintenance set test-settings\" must be followed "
- "by the name of a set command.\n"));
- help_list (maintenance_set_test_settings_list,
- "maintenance set test-settings ",
- all_commands, gdb_stdout);
-}
-
-/* The "maintenance show test-settings" prefix command. */
-
-static void
-maintenance_show_test_settings_cmd (const char *args, int from_tty)
-{
- cmd_show_list (maintenance_show_test_settings_list, from_tty, "");
-}
-
/* Control variables for all the "maintenance set/show test-settings
xxx" commands. */
{
maintenance_test_settings_filename = xstrdup ("/foo/bar");
- add_prefix_cmd ("test-settings", class_maintenance,
- maintenance_set_test_settings_cmd, _("\
+ add_basic_prefix_cmd ("test-settings", class_maintenance,
+ _("\
Set GDB internal variables used for set/show command infrastructure testing."),
- &maintenance_set_test_settings_list,
- "maintenance set test-settings ",
- 0/*allow-unknown*/,
- &maintenance_set_cmdlist);
+ &maintenance_set_test_settings_list,
+ "maintenance set test-settings ",
+ 0/*allow-unknown*/,
+ &maintenance_set_cmdlist);
- add_prefix_cmd ("test-settings", class_maintenance,
- maintenance_show_test_settings_cmd, _("\
+ add_show_prefix_cmd ("test-settings", class_maintenance,
+ _("\
Show GDB internal variables used for set/show command infrastructure testing."),
- &maintenance_show_test_settings_list,
- "maintenance show test-settings ",
- 0/*allow-unknown*/,
- &maintenance_show_cmdlist);
+ &maintenance_show_test_settings_list,
+ "maintenance show test-settings ",
+ 0/*allow-unknown*/,
+ &maintenance_show_cmdlist);
add_setshow_boolean_cmd ("boolean", class_maintenance,
&maintenance_test_settings_boolean, _("\
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)
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
}
}
-/* 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 <secname> <addr>
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
}
}
-/* 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, "");
-}
\f
/* The "maintenance selftest" command. */
{
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, _("\
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\
&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, _("\
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,
return mips32_stack_frame_destroyed_p (gdbarch, pc);
}
-/* Root of all "set mips "/"show mips " commands. This will eventually be
- used for all MIPS-specific commands. */
-
-static void
-show_mips_command (const char *args, int from_tty)
-{
- help_list (showmipscmdlist, "show mips ", all_commands, gdb_stdout);
-}
-
-static void
-set_mips_command (const char *args, int from_tty)
-{
- printf_unfiltered
- ("\"set mips\" must be followed by an appropriate subcommand.\n");
- help_list (setmipscmdlist, "set mips ", all_commands, gdb_stdout);
-}
-
/* Commands to show/set the MIPS FPU type. */
static void
set_tdesc_property (mips_tdesc_gp64, PROPERTY_GP64, "");
/* Add root prefix command for all "set mips"/"show mips" commands. */
- add_prefix_cmd ("mips", no_class, set_mips_command,
- _("Various MIPS specific commands."),
- &setmipscmdlist, "set mips ", 0, &setlist);
+ add_basic_prefix_cmd ("mips", no_class,
+ _("Various MIPS specific commands."),
+ &setmipscmdlist, "set mips ", 0, &setlist);
- add_prefix_cmd ("mips", no_class, show_mips_command,
- _("Various MIPS specific commands."),
- &showmipscmdlist, "show mips ", 0, &showlist);
+ add_show_prefix_cmd ("mips", no_class,
+ _("Various MIPS specific commands."),
+ &showmipscmdlist, "show mips ", 0, &showlist);
/* Allow the user to override the ABI. */
add_setshow_enum_cmd ("abi", class_obscure, mips_abi_strings,
static struct cmd_list_element *user_set_python_list;
static struct cmd_list_element *user_show_python_list;
-/* Function for use by 'set python' prefix command. */
-
-static void
-user_set_python (const char *args, int from_tty)
-{
- help_list (user_set_python_list, "set python ", all_commands,
- gdb_stdout);
-}
-
-/* Function for use by 'show python' prefix command. */
-
-static void
-user_show_python (const char *args, int from_tty)
-{
- cmd_show_list (user_show_python_list, from_tty, "");
-}
-
/* Initialize the Python code. */
#ifdef HAVE_PYTHON
add_com_alias ("py", "python", class_obscure, 1);
/* Add set/show python print-stack. */
- add_prefix_cmd ("python", no_class, user_show_python,
- _("Prefix command for python preference settings."),
- &user_show_python_list, "show python ", 0,
- &showlist);
-
- add_prefix_cmd ("python", no_class, user_set_python,
- _("Prefix command for python preference settings."),
- &user_set_python_list, "set python ", 0,
- &setlist);
+ add_basic_prefix_cmd ("python", no_class,
+ _("Prefix command for python preference settings."),
+ &user_show_python_list, "show python ", 0,
+ &showlist);
+
+ add_show_prefix_cmd ("python", no_class,
+ _("Prefix command for python preference settings."),
+ &user_set_python_list, "set python ", 0,
+ &setlist);
add_setshow_enum_cmd ("print-stack", no_class, python_excp_enums,
&gdbpy_should_print_stack, _("\
static struct cmd_list_element *set_ravenscar_list;
static struct cmd_list_element *show_ravenscar_list;
-/* Implement the "set ravenscar" prefix command. */
-
-static void
-set_ravenscar_command (const char *arg, int from_tty)
-{
- printf_unfiltered (_(\
-"\"set ravenscar\" must be followed by the name of a setting.\n"));
- help_list (set_ravenscar_list, "set ravenscar ", all_commands, gdb_stdout);
-}
-
-/* Implement the "show ravenscar" prefix command. */
-
-static void
-show_ravenscar_command (const char *args, int from_tty)
-{
- cmd_show_list (show_ravenscar_list, from_tty, "");
-}
-
/* Implement the "show ravenscar task-switching" command. */
static void
ravenscar ops if needed. */
gdb::observers::inferior_created.attach (ravenscar_inferior_created);
- add_prefix_cmd ("ravenscar", no_class, set_ravenscar_command,
- _("Prefix command for changing Ravenscar-specific settings."),
- &set_ravenscar_list, "set ravenscar ", 0, &setlist);
+ add_basic_prefix_cmd ("ravenscar", no_class,
+ _("Prefix command for changing Ravenscar-specific settings."),
+ &set_ravenscar_list, "set ravenscar ", 0, &setlist);
- add_prefix_cmd ("ravenscar", no_class, show_ravenscar_command,
- _("Prefix command for showing Ravenscar-specific settings."),
- &show_ravenscar_list, "show ravenscar ", 0, &showlist);
+ add_show_prefix_cmd ("ravenscar", no_class,
+ _("Prefix command for showing Ravenscar-specific settings."),
+ &show_ravenscar_list, "show ravenscar ", 0, &showlist);
add_setshow_boolean_cmd ("task-switching", class_obscure,
&ravenscar_task_support, _("\
}
}
-/* The "set record btrace" command. */
-
-static void
-cmd_set_record_btrace (const char *args, int from_tty)
-{
- printf_unfiltered (_("\"set record btrace\" must be followed "
- "by an appropriate subcommand.\n"));
- help_list (set_record_btrace_cmdlist, "set record btrace ",
- all_commands, gdb_stdout);
-}
-
-/* The "show record btrace" command. */
-
-static void
-cmd_show_record_btrace (const char *args, int from_tty)
-{
- cmd_show_list (show_record_btrace_cmdlist, from_tty, "");
-}
-
/* The "show record btrace replay-memory-access" command. */
static void
error (_("Internal error: bad cpu state."));
}
-/* The "s record btrace bts" command. */
-
-static void
-cmd_set_record_btrace_bts (const char *args, int from_tty)
-{
- printf_unfiltered (_("\"set record btrace bts\" must be followed "
- "by an appropriate subcommand.\n"));
- help_list (set_record_btrace_bts_cmdlist, "set record btrace bts ",
- all_commands, gdb_stdout);
-}
-
-/* The "show record btrace bts" command. */
-
-static void
-cmd_show_record_btrace_bts (const char *args, int from_tty)
-{
- cmd_show_list (show_record_btrace_bts_cmdlist, from_tty, "");
-}
-
-/* The "set record btrace pt" command. */
-
-static void
-cmd_set_record_btrace_pt (const char *args, int from_tty)
-{
- printf_unfiltered (_("\"set record btrace pt\" must be followed "
- "by an appropriate subcommand.\n"));
- help_list (set_record_btrace_pt_cmdlist, "set record btrace pt ",
- all_commands, gdb_stdout);
-}
-
-/* The "show record btrace pt" command. */
-
-static void
-cmd_show_record_btrace_pt (const char *args, int from_tty)
-{
- cmd_show_list (show_record_btrace_pt_cmdlist, from_tty, "");
-}
-
/* The "record bts buffer-size" show value function. */
static void
&record_btrace_cmdlist);
add_alias_cmd ("pt", "btrace pt", class_obscure, 1, &record_cmdlist);
- add_prefix_cmd ("btrace", class_support, cmd_set_record_btrace,
- _("Set record options."), &set_record_btrace_cmdlist,
- "set record btrace ", 0, &set_record_cmdlist);
+ add_basic_prefix_cmd ("btrace", class_support,
+ _("Set record options."), &set_record_btrace_cmdlist,
+ "set record btrace ", 0, &set_record_cmdlist);
- add_prefix_cmd ("btrace", class_support, cmd_show_record_btrace,
- _("Show record options."), &show_record_btrace_cmdlist,
- "show record btrace ", 0, &show_record_cmdlist);
+ add_show_prefix_cmd ("btrace", class_support,
+ _("Show record options."), &show_record_btrace_cmdlist,
+ "show record btrace ", 0, &show_record_cmdlist);
add_setshow_enum_cmd ("replay-memory-access", no_class,
replay_memory_access_types, &replay_memory_access, _("\
Show the cpu to be used for trace decode."),
&show_record_btrace_cmdlist);
- add_prefix_cmd ("bts", class_support, cmd_set_record_btrace_bts,
- _("Set record btrace bts options."),
- &set_record_btrace_bts_cmdlist,
- "set record btrace bts ", 0, &set_record_btrace_cmdlist);
+ add_basic_prefix_cmd ("bts", class_support,
+ _("Set record btrace bts options."),
+ &set_record_btrace_bts_cmdlist,
+ "set record btrace bts ", 0,
+ &set_record_btrace_cmdlist);
- add_prefix_cmd ("bts", class_support, cmd_show_record_btrace_bts,
- _("Show record btrace bts options."),
- &show_record_btrace_bts_cmdlist,
- "show record btrace bts ", 0, &show_record_btrace_cmdlist);
+ add_show_prefix_cmd ("bts", class_support,
+ _("Show record btrace bts options."),
+ &show_record_btrace_bts_cmdlist,
+ "show record btrace bts ", 0,
+ &show_record_btrace_cmdlist);
add_setshow_uinteger_cmd ("buffer-size", no_class,
&record_btrace_conf.bts.size,
&set_record_btrace_bts_cmdlist,
&show_record_btrace_bts_cmdlist);
- add_prefix_cmd ("pt", class_support, cmd_set_record_btrace_pt,
- _("Set record btrace pt options."),
- &set_record_btrace_pt_cmdlist,
- "set record btrace pt ", 0, &set_record_btrace_cmdlist);
-
- add_prefix_cmd ("pt", class_support, cmd_show_record_btrace_pt,
- _("Show record btrace pt options."),
- &show_record_btrace_pt_cmdlist,
- "show record btrace pt ", 0, &show_record_btrace_cmdlist);
+ add_basic_prefix_cmd ("pt", class_support,
+ _("Set record btrace pt options."),
+ &set_record_btrace_pt_cmdlist,
+ "set record btrace pt ", 0,
+ &set_record_btrace_cmdlist);
+
+ add_show_prefix_cmd ("pt", class_support,
+ _("Show record btrace pt options."),
+ &show_record_btrace_pt_cmdlist,
+ "show record btrace pt ", 0,
+ &show_record_btrace_cmdlist);
add_setshow_uinteger_cmd ("buffer-size", no_class,
&record_btrace_conf.pt.size,
}
}
-/* The "set record full" command. */
-
-static void
-set_record_full_command (const char *args, int from_tty)
-{
- printf_unfiltered (_("\"set record full\" must be followed "
- "by an appropriate subcommand.\n"));
- help_list (set_record_full_cmdlist, "set record full ", all_commands,
- gdb_stdout);
-}
-
-/* The "show record full" command. */
-
-static void
-show_record_full_command (const char *args, int from_tty)
-{
- cmd_show_list (show_record_full_cmdlist, from_tty, "");
-}
-
void _initialize_record_full ();
void
_initialize_record_full ()
set_cmd_completer (c, filename_completer);
deprecate_cmd (c, "record full restore");
- add_prefix_cmd ("full", class_support, set_record_full_command,
- _("Set record options."), &set_record_full_cmdlist,
- "set record full ", 0, &set_record_cmdlist);
+ add_basic_prefix_cmd ("full", class_support,
+ _("Set record options."), &set_record_full_cmdlist,
+ "set record full ", 0, &set_record_cmdlist);
- add_prefix_cmd ("full", class_support, show_record_full_command,
- _("Show record options."), &show_record_full_cmdlist,
- "show record full ", 0, &show_record_cmdlist);
+ add_show_prefix_cmd ("full", class_support,
+ _("Show record options."), &show_record_full_cmdlist,
+ "show record full ", 0, &show_record_cmdlist);
/* Record instructions number limit command. */
add_setshow_boolean_cmd ("stop-at-limit", no_class,
gdb::observers::record_changed.notify (current_inferior (), 0, NULL, NULL);
}
-/* The "set record" command. */
-
-static void
-set_record_command (const char *args, int from_tty)
-{
- printf_unfiltered (_("\"set record\" must be followed "
- "by an appropriate subcommand.\n"));
- help_list (set_record_cmdlist, "set record ", all_commands, gdb_stdout);
-}
-
-/* The "show record" command. */
-
-static void
-show_record_command (const char *args, int from_tty)
-{
- cmd_show_list (show_record_cmdlist, from_tty, "");
-}
/* The "info record" command. */
set_cmd_completer (c, filename_completer);
add_com_alias ("rec", "record", class_obscure, 1);
- add_prefix_cmd ("record", class_support, set_record_command,
- _("Set record options."), &set_record_cmdlist,
- "set record ", 0, &setlist);
+ add_basic_prefix_cmd ("record", class_support,
+ _("Set record options."), &set_record_cmdlist,
+ "set record ", 0, &setlist);
add_alias_cmd ("rec", "record", class_obscure, 1, &setlist);
- add_prefix_cmd ("record", class_support, show_record_command,
- _("Show record options."), &show_record_cmdlist,
- "show record ", 0, &showlist);
+ add_show_prefix_cmd ("record", class_support,
+ _("Show record options."), &show_record_cmdlist,
+ "show record ", 0, &showlist);
add_alias_cmd ("rec", "record", class_obscure, 1, &showlist);
add_prefix_cmd ("record", class_support, info_record_command,
_("Info record options."), &info_record_cmdlist,
remote_file_delete (argv[0], from_tty);
}
-static void
-remote_command (const char *args, int from_tty)
-{
- help_list (remote_cmdlist, "remote ", all_commands, gdb_stdout);
-}
-
bool
remote_target::can_execute_reverse ()
{
}
}
-static void
-set_remote_cmd (const char *args, int from_tty)
-{
- help_list (remote_set_cmdlist, "set remote ", all_commands, gdb_stdout);
-}
-
static void
show_remote_cmd (const char *args, int from_tty)
{
/* set/show remote ... */
- add_prefix_cmd ("remote", class_maintenance, set_remote_cmd, _("\
+ add_basic_prefix_cmd ("remote", class_maintenance, _("\
Remote protocol specific variables.\n\
Configure various remote-protocol specific variables such as\n\
the packets being used."),
- &remote_set_cmdlist, "set remote ",
- 0 /* allow-unknown */, &setlist);
+ &remote_set_cmdlist, "set remote ",
+ 0 /* allow-unknown */, &setlist);
add_prefix_cmd ("remote", class_maintenance, show_remote_cmd, _("\
Remote protocol specific variables.\n\
Configure various remote-protocol specific variables such as\n\
`Z' packets is %s. */
&remote_set_cmdlist, &remote_show_cmdlist);
- add_prefix_cmd ("remote", class_files, remote_command, _("\
+ add_basic_prefix_cmd ("remote", class_files, _("\
Manipulate files on the remote system.\n\
Transfer files to and from the remote target system."),
- &remote_cmdlist, "remote ",
- 0 /* allow-unknown */, &cmdlist);
+ &remote_cmdlist, "remote ",
+ 0 /* allow-unknown */, &cmdlist);
add_cmd ("put", class_files, remote_put_command,
_("Copy a local file to the remote system."),
static struct cmd_list_element *setriscvcmdlist = NULL;
static struct cmd_list_element *showriscvcmdlist = NULL;
-/* The show callback for the 'show riscv' prefix command. */
-
-static void
-show_riscv_command (const char *args, int from_tty)
-{
- help_list (showriscvcmdlist, "show riscv ", all_commands, gdb_stdout);
-}
-
-/* The set callback for the 'set riscv' prefix command. */
-
-static void
-set_riscv_command (const char *args, int from_tty)
-{
- printf_unfiltered
- (_("\"set riscv\" must be followed by an appropriate subcommand.\n"));
- help_list (setriscvcmdlist, "set riscv ", all_commands, gdb_stdout);
-}
-
/* The set and show lists for 'set riscv' and 'show riscv' prefixes. */
static struct cmd_list_element *setdebugriscvcmdlist = NULL;
static struct cmd_list_element *showdebugriscvcmdlist = NULL;
-/* The show callback for the 'show debug riscv' prefix command. */
-
-static void
-show_debug_riscv_command (const char *args, int from_tty)
-{
- help_list (showdebugriscvcmdlist, "show debug riscv ", all_commands, gdb_stdout);
-}
-
-/* The set callback for the 'set debug riscv' prefix command. */
-
-static void
-set_debug_riscv_command (const char *args, int from_tty)
-{
- printf_unfiltered
- (_("\"set debug riscv\" must be followed by an appropriate subcommand.\n"));
- help_list (setdebugriscvcmdlist, "set debug riscv ", all_commands, gdb_stdout);
-}
-
/* The show callback for all 'show debug riscv VARNAME' variables. */
static void
/* Add root prefix command for all "set debug riscv" and "show debug
riscv" commands. */
- add_prefix_cmd ("riscv", no_class, set_debug_riscv_command,
- _("RISC-V specific debug commands."),
- &setdebugriscvcmdlist, "set debug riscv ", 0,
- &setdebuglist);
+ add_basic_prefix_cmd ("riscv", no_class,
+ _("RISC-V specific debug commands."),
+ &setdebugriscvcmdlist, "set debug riscv ", 0,
+ &setdebuglist);
- add_prefix_cmd ("riscv", no_class, show_debug_riscv_command,
- _("RISC-V specific debug commands."),
- &showdebugriscvcmdlist, "show debug riscv ", 0,
- &showdebuglist);
+ add_show_prefix_cmd ("riscv", no_class,
+ _("RISC-V specific debug commands."),
+ &showdebugriscvcmdlist, "show debug riscv ", 0,
+ &showdebuglist);
add_setshow_zuinteger_cmd ("breakpoints", class_maintenance,
&riscv_debug_breakpoints, _("\
&setdebugriscvcmdlist, &showdebugriscvcmdlist);
/* Add root prefix command for all "set riscv" and "show riscv" commands. */
- add_prefix_cmd ("riscv", no_class, set_riscv_command,
- _("RISC-V specific commands."),
- &setriscvcmdlist, "set riscv ", 0, &setlist);
+ add_basic_prefix_cmd ("riscv", no_class,
+ _("RISC-V specific commands."),
+ &setriscvcmdlist, "set riscv ", 0, &setlist);
- add_prefix_cmd ("riscv", no_class, show_riscv_command,
- _("RISC-V specific commands."),
- &showriscvcmdlist, "show riscv ", 0, &showlist);
+ add_show_prefix_cmd ("riscv", no_class,
+ _("RISC-V specific commands."),
+ &showriscvcmdlist, "show riscv ", 0, &showlist);
use_compressed_breakpoints = AUTO_BOOLEAN_AUTO;
/* FIXME: Dump gdbarch_tdep. */
}
-/* PowerPC-specific commands. */
-
-static void
-set_powerpc_command (const char *args, int from_tty)
-{
- printf_unfiltered (_("\
-\"set powerpc\" must be followed by an appropriate subcommand.\n"));
- help_list (setpowerpccmdlist, "set powerpc ", all_commands, gdb_stdout);
-}
-
-static void
-show_powerpc_command (const char *args, int from_tty)
-{
- cmd_show_list (showpowerpccmdlist, from_tty, "");
-}
-
static void
powerpc_set_soft_float (const char *args, int from_tty,
struct cmd_list_element *c)
/* Add root prefix command for all "set powerpc"/"show powerpc"
commands. */
- add_prefix_cmd ("powerpc", no_class, set_powerpc_command,
- _("Various PowerPC-specific commands."),
- &setpowerpccmdlist, "set powerpc ", 0, &setlist);
+ add_basic_prefix_cmd ("powerpc", no_class,
+ _("Various PowerPC-specific commands."),
+ &setpowerpccmdlist, "set powerpc ", 0, &setlist);
- add_prefix_cmd ("powerpc", no_class, show_powerpc_command,
- _("Various PowerPC-specific commands."),
- &showpowerpccmdlist, "show powerpc ", 0, &showlist);
+ add_show_prefix_cmd ("powerpc", no_class,
+ _("Various PowerPC-specific commands."),
+ &showpowerpccmdlist, "show powerpc ", 0, &showlist);
/* Add a command to allow the user to force the ABI. */
add_setshow_auto_boolean_cmd ("soft-float", class_support,
return (serial_write (scb, "\377\363", 2));
}
-/* Support for "set tcp" and "show tcp" commands. */
-
-static void
-set_tcp_cmd (const char *args, int from_tty)
-{
- help_list (tcp_set_cmdlist, "set tcp ", all_commands, gdb_stdout);
-}
-
-static void
-show_tcp_cmd (const char *args, int from_tty)
-{
- help_list (tcp_show_cmdlist, "show tcp ", all_commands, gdb_stdout);
-}
-
#ifndef USE_WIN32API
/* The TCP ops. */
serial_add_interface (&tcp_ops);
#endif /* USE_WIN32API */
- add_prefix_cmd ("tcp", class_maintenance, set_tcp_cmd, _("\
+ add_basic_prefix_cmd ("tcp", class_maintenance, _("\
TCP protocol specific variables.\n\
Configure variables specific to remote TCP connections."),
- &tcp_set_cmdlist, "set tcp ",
- 0 /* allow-unknown */, &setlist);
- add_prefix_cmd ("tcp", class_maintenance, show_tcp_cmd, _("\
+ &tcp_set_cmdlist, "set tcp ",
+ 0 /* allow-unknown */, &setlist);
+ add_show_prefix_cmd ("tcp", class_maintenance, _("\
TCP protocol specific variables.\n\
Configure variables specific to remote TCP connections."),
- &tcp_show_cmdlist, "show tcp ",
- 0 /* allow-unknown */, &showlist);
+ &tcp_show_cmdlist, "show tcp ",
+ 0 /* allow-unknown */, &showlist);
add_setshow_boolean_cmd ("auto-retry", class_obscure,
&tcp_auto_retry, _("\
static struct cmd_list_element *serial_set_cmdlist;
static struct cmd_list_element *serial_show_cmdlist;
-static void
-serial_set_cmd (const char *args, int from_tty)
-{
- printf_unfiltered ("\"set serial\" must be followed "
- "by the name of a command.\n");
- help_list (serial_set_cmdlist, "set serial ", all_commands, gdb_stdout);
-}
-
-static void
-serial_show_cmd (const char *args, int from_tty)
-{
- cmd_show_list (serial_show_cmdlist, from_tty, "");
-}
-
/* Baud rate specified for talking to serial target systems. Default
is left as -1, so targets can choose their own defaults. */
/* FIXME: This means that "show serial baud" and gr_files_info can
Use <CR>~. or <CR>~^D to break out."));
#endif /* 0 */
- add_prefix_cmd ("serial", class_maintenance, serial_set_cmd, _("\
+ add_basic_prefix_cmd ("serial", class_maintenance, _("\
Set default serial/parallel port configuration."),
- &serial_set_cmdlist, "set serial ",
- 0/*allow-unknown*/,
- &setlist);
+ &serial_set_cmdlist, "set serial ",
+ 0/*allow-unknown*/,
+ &setlist);
- add_prefix_cmd ("serial", class_maintenance, serial_show_cmd, _("\
+ add_show_prefix_cmd ("serial", class_maintenance, _("\
Show default serial/parallel port configuration."),
- &serial_show_cmdlist, "show serial ",
- 0/*allow-unknown*/,
- &showlist);
+ &serial_show_cmdlist, "show serial ",
+ 0/*allow-unknown*/,
+ &showlist);
/* If target is open when baud changes, it doesn't take effect until
the next open (I think, not sure). */
return gdbarch;
}
-static void
-show_sh_command (const char *args, int from_tty)
-{
- help_list (showshcmdlist, "show sh ", all_commands, gdb_stdout);
-}
-
-static void
-set_sh_command (const char *args, int from_tty)
-{
- printf_unfiltered
- ("\"set sh\" must be followed by an appropriate subcommand.\n");
- help_list (setshcmdlist, "set sh ", all_commands, gdb_stdout);
-}
-
void _initialize_sh_tdep ();
void
_initialize_sh_tdep ()
{
gdbarch_register (bfd_arch_sh, sh_gdbarch_init, NULL);
- add_prefix_cmd ("sh", no_class, set_sh_command, "SH specific commands.",
- &setshcmdlist, "set sh ", 0, &setlist);
- add_prefix_cmd ("sh", no_class, show_sh_command, "SH specific commands.",
- &showshcmdlist, "show sh ", 0, &showlist);
+ add_basic_prefix_cmd ("sh", no_class, "SH specific commands.",
+ &setshcmdlist, "set sh ", 0, &setlist);
+ add_show_prefix_cmd ("sh", no_class, "SH specific commands.",
+ &showshcmdlist, "show sh ", 0, &showlist);
add_setshow_enum_cmd ("calling-convention", class_vars, sh_cc_enum,
&sh_active_calling_convention,
}
-static void
-info_adi_command (const char *args, int from_tty)
-{
- printf_unfiltered ("\"adi\" must be followed by \"examine\" "
- "or \"assign\".\n");
- help_list (sparc64adilist, "adi ", all_commands, gdb_stdout);
-}
-
/* Read attributes of a maps entry in /proc/[pid]/adi/maps. */
static void
void
_initialize_sparc64_adi_tdep ()
{
-
- add_prefix_cmd ("adi", class_support, info_adi_command,
- _("ADI version related commands."),
- &sparc64adilist, "adi ", 0, &cmdlist);
+ add_basic_prefix_cmd ("adi", class_support,
+ _("ADI version related commands."),
+ &sparc64adilist, "adi ", 0, &cmdlist);
add_cmd ("examine", class_support, adi_examine_command,
_("Examine ADI versions."), &sparc64adilist);
add_alias_cmd ("x", "examine", no_class, 1, &sparc64adilist);
error (_("This target does not know how to read its overlay state."));
}
-/* Function: overlay_command
- A place-holder for a mis-typed command. */
-
/* Command list chain containing all defined "overlay" subcommands. */
static struct cmd_list_element *overlaylist;
-static void
-overlay_command (const char *args, int from_tty)
-{
- printf_unfiltered
- ("\"overlay\" must be followed by the name of an overlay command.\n");
- help_list (overlaylist, "overlay ", all_commands, gdb_stdout);
-}
-
/* Target Overlays for the "Simplest" overlay manager:
This is GDB's default target overlay layer. It works with the
on its own."), &cmdlist);
set_cmd_completer (c, filename_completer);
- add_prefix_cmd ("overlay", class_support, overlay_command,
- _("Commands for debugging overlays."), &overlaylist,
- "overlay ", 0, &cmdlist);
+ add_basic_prefix_cmd ("overlay", class_support,
+ _("Commands for debugging overlays."), &overlaylist,
+ "overlay ", 0, &cmdlist);
add_com_alias ("ovly", "overlay", class_alias, 1);
add_com_alias ("ov", "overlay", class_alias, 1);
static struct cmd_list_element *info_module_cmdlist = NULL;
-/* Implement the 'info module' command, just displays some help text for
- the available sub-commands. */
-
-static void
-info_module_command (const char *args, int from_tty)
-{
- help_list (info_module_cmdlist, "info module ", class_info, gdb_stdout);
-}
-
/* See symtab.h. */
std::vector<module_symbol_search>
_("All module names, or those matching REGEXP."));
set_cmd_completer_handle_brkchars (c, info_types_command_completer);
- add_prefix_cmd ("module", class_info, info_module_command, _("\
+ add_basic_prefix_cmd ("module", class_info, _("\
Print information about modules."),
- &info_module_cmdlist, "info module ",
- 0, &infolist);
+ &info_module_cmdlist, "info module ",
+ 0, &infolist);
c = add_cmd ("functions", class_info, info_module_functions_command, _("\
Display functions arranged by modules.\n\
/* Helper functions for the CLI commands. */
-static void
-set_tdesc_cmd (const char *args, int from_tty)
-{
- help_list (tdesc_set_cmdlist, "set tdesc ", all_commands, gdb_stdout);
-}
-
-static void
-show_tdesc_cmd (const char *args, int from_tty)
-{
- cmd_show_list (tdesc_show_cmdlist, from_tty, "");
-}
-
-static void
-unset_tdesc_cmd (const char *args, int from_tty)
-{
- help_list (tdesc_unset_cmdlist, "unset tdesc ", all_commands, gdb_stdout);
-}
-
static void
set_tdesc_filename_cmd (const char *args, int from_tty,
struct cmd_list_element *c)
{
tdesc_data = gdbarch_data_register_pre_init (tdesc_data_init);
- add_prefix_cmd ("tdesc", class_maintenance, set_tdesc_cmd, _("\
+ add_basic_prefix_cmd ("tdesc", class_maintenance, _("\
Set target description specific variables."),
- &tdesc_set_cmdlist, "set tdesc ",
- 0 /* allow-unknown */, &setlist);
- add_prefix_cmd ("tdesc", class_maintenance, show_tdesc_cmd, _("\
+ &tdesc_set_cmdlist, "set tdesc ",
+ 0 /* allow-unknown */, &setlist);
+ add_show_prefix_cmd ("tdesc", class_maintenance, _("\
Show target description specific variables."),
- &tdesc_show_cmdlist, "show tdesc ",
- 0 /* allow-unknown */, &showlist);
- add_prefix_cmd ("tdesc", class_maintenance, unset_tdesc_cmd, _("\
+ &tdesc_show_cmdlist, "show tdesc ",
+ 0 /* allow-unknown */, &showlist);
+ add_basic_prefix_cmd ("tdesc", class_maintenance, _("\
Unset target description specific variables."),
- &tdesc_unset_cmdlist, "unset tdesc ",
- 0 /* allow-unknown */, &unsetlist);
+ &tdesc_unset_cmdlist, "unset tdesc ",
+ 0 /* allow-unknown */, &unsetlist);
add_setshow_filename_cmd ("filename", class_obscure,
&tdesc_filename_cmd_string,
+2020-04-17 Tom Tromey <tromey@adacore.com>
+
+ * gdb.cp/maint.exp (test_help): Simplify multiple_help_body.
+ Update tests.
+ * gdb.btrace/cpu.exp: Update tests.
+ * gdb.base/maint.exp: Update tests.
+ * gdb.base/default.exp: Update tests.
+ * gdb.base/completion.exp: Update tests.
+
2020-04-16 Tom de Vries <tdevries@suse.de>
PR symtab/25791
-re "^info $" {
send_gdb "\n"
gdb_test_multiple "" "$test" {
- -re "\"info\" must be followed by the name of an info command\\.\r\nList of info subcommands.*$gdb_prompt $" {
+ -re "List of info subcommands.*$gdb_prompt $" {
pass "$test"
}
}
-re "^info \\\x07$" {
send_gdb "\n"
gdb_test_multiple "" "$test" {
- -re "\"info\" must be followed by the name of an info command\\.\r\nList of info subcommands:\r\n\r\n.*$gdb_prompt $" {
+ -re "List of info subcommands:\r\n\r\n.*$gdb_prompt $" {
pass "$test"
}
}
-re "address.*types.*$gdb_prompt " {
send_gdb "\n"
gdb_test_multiple "" "$test" {
- -re "\"info\".*unambiguous\\..*$gdb_prompt $" {
+ -re "allowed if unambiguous\\..*$gdb_prompt $" {
pass "$test"
}
}
gdb_test "add-symbol-file" "add-symbol-file takes a file name and an address"
# test append
-gdb_test "append" "\"append\" must be followed by a subcommand\.\[\r\n\]+List of append subcommands:.*"
-gdb_test "append binary" "\"append binary\" must be followed by a subcommand\.\[\r\n\]+List of append binary subcommands:.*"
+gdb_test "append" "List of append subcommands:.*"
+gdb_test "append binary" "List of append binary subcommands:.*"
gdb_test "append memory" "Missing filename\."
gdb_test "append value" "Missing filename\."
gdb_test "append binary memory" "Missing filename\."
#test down-silently
gdb_test "down-silently" "No stack."
# test dump
-gdb_test "dump" "\"dump\" must be followed by a subcommand\.\[\r\n\]+List of dump subcommands:.*"
-gdb_test "dump binary" "\"dump binary\" must be followed by a subcommand\.\[\r\n\]+List of dump binary subcommands:.*"
-gdb_test "dump ihex" "\"dump ihex\" must be followed by a subcommand\.\[\r\n\]+List of dump ihex subcommands:.*"
+gdb_test "dump" "List of dump subcommands:.*"
+gdb_test "dump binary" "List of dump binary subcommands:.*"
+gdb_test "dump ihex" "List of dump ihex subcommands:.*"
gdb_test "dump memory" "Missing filename\."
-gdb_test "dump srec" "\"dump srec\" must be followed by a subcommand\.\[\r\n\]+List of dump srec subcommands:.*"
-gdb_test "dump tekhex" "\"dump tekhex\" must be followed by a subcommand\.\[\r\n\]+List of dump tekhex subcommands:.*"
+gdb_test "dump srec" "List of dump srec subcommands:.*"
+gdb_test "dump tekhex" "List of dump tekhex subcommands:.*"
gdb_test "dump value" "Missing filename\."
gdb_test "dump binary memory" "Missing filename\."
gdb_test "dump binary value" "Missing filename\."
#test handle
gdb_test "handle" "Argument required .signal to handle.*"
#test info "i" abbreviation
-gdb_test "i" "\"info\" must be followed by the name of an info command.(\[^\r\n\]*\[\r\n\])+List of info subcommands:(\[^\r\n\]*\[\r\n\])+Type \"help info\" followed by info subcommand name for full documentation.(\[^\r\n\]*\[\r\n\])+Command name abbreviations are allowed if unambiguous." "info \"i\" abbreviation"
+gdb_test "i" "List of info subcommands:(\[^\r\n\]*\[\r\n\])+Type \"help info\" followed by info subcommand name for full documentation.(\[^\r\n\]*\[\r\n\])+Command name abbreviations are allowed if unambiguous." "info \"i\" abbreviation"
#test info
-gdb_test "info" "\"info\" must be followed by the name of an info command.(\[^\r\n\]*\[\r\n\])+List of info subcommands:(\[^\r\n\]*\[\r\n\])+Type \"help info\" followed by info subcommand name for full documentation.(\[^\r\n\]*\[\r\n\])+Command name abbreviations are allowed if unambiguous."
+gdb_test "info" "List of info subcommands:(\[^\r\n\]*\[\r\n\])+Type \"help info\" followed by info subcommand name for full documentation.(\[^\r\n\]*\[\r\n\])+Command name abbreviations are allowed if unambiguous."
#test ignore
gdb_test "ignore" "Argument required .a breakpoint number.*"
#test info address
gdb_test "output" "Argument required .expression to compute.*"
#test overlay
-gdb_test "overlay" "\"overlay\" must be followed by the name of .*"
+gdb_test "overlay" "List of overlay subcommands:.*"
#test a non-existant overlay subcommand
gdb_test "overlay on" "Undefined overlay command.* Try \"help overlay\"."
gdb_test_no_output "overlay manual" "overlay manual #1"
# Test set check abbreviations
foreach x {"c" "ch" "check"} {
- gdb_test "set $x" "\"set check\" must be followed by the name of a check subcommand.(\[^\r\n\]*\[\r\n\])+List of set check subcommands:(\[^\r\n\]*\[\r\n\])+set check range -- Set range checking(\[^\r\n\]*\[\r\n\])+set check type -- Set strict type checking(\[^\r\n\]*\[\r\n\])+Type \"help set check\" followed by set check subcommand name for full documentation.(\[^\r\n\]*\[\r\n\])+Command name abbreviations are allowed if unambiguous." \
+ gdb_test "set $x" "List of set check subcommands:(\[^\r\n\]*\[\r\n\])+set check range -- Set range checking(\[^\r\n\]*\[\r\n\])+set check type -- Set strict type checking(\[^\r\n\]*\[\r\n\])+Type \"help set check\" followed by set check subcommand name for full documentation.(\[^\r\n\]*\[\r\n\])+Command name abbreviations are allowed if unambiguous." \
"set check \"$x\" abbreviation"
}
#test set history size
gdb_test "set history size" "Argument required .integer to set it to.*"
#test set history
-gdb_test "set history" "\"set history\" must be followed by the name of a history subcommand.(\[^\r\n\]*\[\r\n\])+List of set history subcommands:(\[^\r\n\]*\[\r\n\])+set history expansion -- Set history expansion on command input(\[^\r\n\]*\[\r\n\])+set history filename -- Set the filename in which to record the command history(\[^\r\n\]*\[\r\n\])+set history save -- Set saving of the history record on exit(\[^\r\n\]*\[\r\n\])+set history size -- Set the size of the command history(\[^\r\n\]*\[\r\n\])+Type \"help set history\" followed by set history subcommand name for full documentation.(\[^\r\n\]*\[\r\n\])+Command name abbreviations are allowed if unambiguous."
+gdb_test "set history" "List of set history subcommands:(\[^\r\n\]*\[\r\n\])+set history expansion -- Set history expansion on command input(\[^\r\n\]*\[\r\n\])+set history filename -- Set the filename in which to record the command history(\[^\r\n\]*\[\r\n\])+set history save -- Set saving of the history record on exit(\[^\r\n\]*\[\r\n\])+set history size -- Set the size of the command history(\[^\r\n\]*\[\r\n\])+Type \"help set history\" followed by set history subcommand name for full documentation.(\[^\r\n\]*\[\r\n\])+Command name abbreviations are allowed if unambiguous."
#test set language
gdb_test "set language" "Requires an argument. Valid arguments are auto, local, unknown, ada, asm, c, c.., d, fortran, go, minimal, modula-2, objective-c, opencl, pascal, rust."
#test set listsize
gdb_test "set listsize" "Argument required .integer to set it to.*"
#test set print "p" abbreviation
-gdb_test "set p" "\"set print\" must be followed by the name of a print subcommand.(\[^\r\n\]*\[\r\n\])+List of set print subcommands:(\[^\r\n\]*\[\r\n\])+Type \"help set print\" followed by set print subcommand name for full documentation.(\[^\r\n\]*\[\r\n\])+Command name abbreviations are allowed if unambiguous." "set print \"p\" abbreviation"
+gdb_test "set p" "List of set print subcommands:(\[^\r\n\]*\[\r\n\])+Type \"help set print\" followed by set print subcommand name for full documentation.(\[^\r\n\]*\[\r\n\])+Command name abbreviations are allowed if unambiguous." "set print \"p\" abbreviation"
#test set print "pr" abbreviation
-gdb_test "set pr" "\"set print\" must be followed by the name of a print subcommand.(\[^\r\n\]*\[\r\n\])+List of set print subcommands:(\[^\r\n\]*\[\r\n\])+Type \"help set print\" followed by set print subcommand name for full documentation.(\[^\r\n\]*\[\r\n\])+Command name abbreviations are allowed if unambiguous." "set print \"pr\" abbreviation"
+gdb_test "set pr" "List of set print subcommands:(\[^\r\n\]*\[\r\n\])+Type \"help set print\" followed by set print subcommand name for full documentation.(\[^\r\n\]*\[\r\n\])+Command name abbreviations are allowed if unambiguous." "set print \"pr\" abbreviation"
#test set print
-gdb_test "set print" "\"set print\" must be followed by the name of a print subcommand.(\[^\r\n\]*\[\r\n\])+List of set print subcommands:(\[^\r\n\]*\[\r\n\])+Type \"help set print\" followed by set print subcommand name for full documentation.(\[^\r\n\]*\[\r\n\])+Command name abbreviations are allowed if unambiguous."
+gdb_test "set print" "List of set print subcommands:(\[^\r\n\]*\[\r\n\])+Type \"help set print\" followed by set print subcommand name for full documentation.(\[^\r\n\]*\[\r\n\])+Command name abbreviations are allowed if unambiguous."
#test set print address
gdb_test_no_output "set print address" "set print address"
#test set print array
"y"
#test unset
-gdb_test "unset" "\"unset\" must be followed by the name of an unset subcommand.(\[^\r\n\]*\[\r\n\])+List of unset subcommands:(\[^\r\n\]*\[\r\n\])+unset environment -- Cancel environment variable VAR for the program(\[^\r\n\]*\[\r\n\])+Type \"help unset\" followed by unset subcommand name for full documentation.(\[^\r\n\]*\[\r\n\])+Command name abbreviations are allowed if unambiguous."
+gdb_test "unset" "List of unset subcommands:(\[^\r\n\]*\[\r\n\])+unset environment -- Cancel environment variable VAR for the program(\[^\r\n\]*\[\r\n\])+Type \"help unset\" followed by unset subcommand name for full documentation.(\[^\r\n\]*\[\r\n\])+Command name abbreviations are allowed if unambiguous."
#test up
#test up-silently
gdb_test "up-silently" "No stack."
}
gdb_test "maint print" \
- "\"maintenance print\" must be followed by the name of a print command\\.\r\nList.*unambiguous\\..*" \
+ "List.*unambiguous\\..*" \
"maint print w/o args"
gdb_test "maint info" \
- "\"maintenance info\" must be followed by the name of an info command\\.\r\nList.*unambiguous\\..*" \
+ "List.*unambiguous\\..*" \
"maint info w/o args"
gdb_test "maint" \
- "\"maintenance\" must be followed by the name of a maintenance command\\.\r\nList.*unambiguous\\..*" \
+ "List.*unambiguous\\..*" \
"maint w/o args"
# Test that "main info line-table" w/o a file name shows the symtab for
gdb_test "show record btrace cpu" "btrace cpu is 'auto'\." "default cpu"
gdb_test "set record" \
- "\"set record\" must be followed by an appropriate subcommand.*"
+ "List of set record subcommands.*"
gdb_test "set record btrace" \
- "\"set record btrace\" must be followed by an appropriate subcommand.*"
+ "List of set record btrace subcommands.*"
test_bad "" "auto"
test_good "intel: 0/0"
"C\\+\\+ maintenance commands.\r\n\r\n"
}
- set multiple_help_body "List of maintenance cplus subcommands:\r\n\r\nmaintenance cplus first_component -- ${first_component_help}\r\nmaintenance cplus namespace -- ${namespace_help}\r\n\r\nType \"help maintenance cplus\" followed by maintenance cplus subcommand name for full documentation.\r\nCommand name abbreviations are allowed if unambiguous."
+ set multiple_help_body "List of maintenance cplus subcommands:.*Command name abbreviations are allowed if unambiguous."
- gdb_test "maint cp" "\"maintenance cplus\" must be followed by the name of a command.\r\n.*"
+ gdb_test "maint cp" $multiple_help_body
gdb_test "help maint cp first_component" "${first_component_help}."
gdb_test "help maint cp namespace" "${namespace_help}."
set_readline_history_size (history_size_setshow_var);
}
-void
-set_history (const char *args, int from_tty)
-{
- printf_unfiltered (_("\"set history\" must be followed "
- "by the name of a history subcommand.\n"));
- help_list (sethistlist, "set history ", all_commands, gdb_stdout);
-}
-
-void
-show_history (const char *args, int from_tty)
-{
- cmd_show_list (showhistlist, from_tty, "");
-}
-
bool info_verbose = false; /* Default verbose msgs off. */
/* Called by do_set_command. An elaborate joke. */
extern void show_commands (const char *args, int from_tty);
-extern void set_history (const char *, int);
-
-extern void show_history (const char *, int);
-
extern void set_verbose (const char *, int, struct cmd_list_element *);
extern char *handle_line_of_input (struct buffer *cmd_line_buffer,
#include "tui/tui-source.h"
#include "gdb_curses.h"
-static void tui_layout_command (const char *, int);
static void extract_display_start_addr (struct gdbarch **, CORE_ADDR *);
/* The layouts. */
new_layout.release ();
}
-/* Base command for "layout". */
-
-static void
-tui_layout_command (const char *layout_name, int from_tty)
-{
- help_list (layout_list, "layout ", all_commands, gdb_stdout);
-}
-
/* Function to initialize gdb commands, for tui window layout
manipulation. */
void
_initialize_tui_layout ()
{
- add_prefix_cmd ("layout", class_tui, tui_layout_command, _("\
+ add_basic_prefix_cmd ("layout", class_tui, _("\
Change the layout of windows.\n\
Usage: layout prev | next | LAYOUT-NAME"),
- &layout_list, "layout ", 0, &cmdlist);
+ &layout_list, "layout ", 0, &cmdlist);
add_cmd ("next", class_tui, tui_next_layout_command,
_("Apply the next TUI layout."),
static struct cmd_list_element *tuilist;
-static void
-tui_command (const char *args, int from_tty)
-{
- printf_unfiltered (_("\"tui\" must be followed by the name of a "
- "tui command.\n"));
- help_list (tuilist, "tui ", all_commands, gdb_stdout);
-}
-
struct cmd_list_element **
tui_get_cmd_list (void)
{
if (tuilist == 0)
- add_prefix_cmd ("tui", class_tui, tui_command,
- _("Text User Interface commands."),
- &tuilist, "tui ", 0, &cmdlist);
+ add_basic_prefix_cmd ("tui", class_tui,
+ _("Text User Interface commands."),
+ &tuilist, "tui ", 0, &cmdlist);
return &tuilist;
}
struct cmd_list_element *showprinttypelist;
-static void
-set_print_type (const char *arg, int from_tty)
-{
- printf_unfiltered (
- "\"set print type\" must be followed by the name of a subcommand.\n");
- help_list (setprintlist, "set print type ", all_commands, gdb_stdout);
-}
-
-static void
-show_print_type (const char *args, int from_tty)
-{
- cmd_show_list (showprinttypelist, from_tty, "");
-}
-
static bool print_methods = true;
static void
Only one level of typedefs is unrolled. See also \"ptype\"."));
set_cmd_completer (c, expression_completer);
- add_prefix_cmd ("type", no_class, show_print_type,
- _("Generic command for showing type-printing settings."),
- &showprinttypelist, "show print type ", 0, &showprintlist);
- add_prefix_cmd ("type", no_class, set_print_type,
- _("Generic command for setting how types print."),
- &setprinttypelist, "set print type ", 0, &setprintlist);
+ add_show_prefix_cmd ("type", no_class,
+ _("Generic command for showing type-printing settings."),
+ &showprinttypelist, "show print type ", 0,
+ &showprintlist);
+ add_basic_prefix_cmd ("type", no_class,
+ _("Generic command for setting how types print."),
+ &setprinttypelist, "set print type ", 0,
+ &setprintlist);
add_setshow_boolean_cmd ("methods", no_class, &print_methods,
_("\
}
\f
-static void
-set_print (const char *arg, int from_tty)
-{
- printf_unfiltered (
- "\"set print\" must be followed by the name of a print subcommand.\n");
- help_list (setprintlist, "set print ", all_commands, gdb_stdout);
-}
-
-static void
-show_print (const char *args, int from_tty)
-{
- cmd_show_list (showprintlist, from_tty, "");
-}
-
-static void
-set_print_raw (const char *arg, int from_tty)
-{
- printf_unfiltered (
- "\"set print raw\" must be followed by the name of a \"print raw\" subcommand.\n");
- help_list (setprintrawlist, "set print raw ", all_commands, gdb_stdout);
-}
-
-static void
-show_print_raw (const char *args, int from_tty)
-{
- cmd_show_list (showprintrawlist, from_tty, "");
-}
-
/* Controls printing of vtbl's. */
static void
show_vtblprint (struct ui_file *file, int from_tty,
{
cmd_list_element *cmd;
- add_prefix_cmd ("print", no_class, set_print,
- _("Generic command for setting how things print."),
- &setprintlist, "set print ", 0, &setlist);
+ add_basic_prefix_cmd ("print", no_class,
+ _("Generic command for setting how things print."),
+ &setprintlist, "set print ", 0, &setlist);
add_alias_cmd ("p", "print", no_class, 1, &setlist);
/* Prefer set print to set prompt. */
add_alias_cmd ("pr", "print", no_class, 1, &setlist);
- add_prefix_cmd ("print", no_class, show_print,
- _("Generic command for showing print settings."),
- &showprintlist, "show print ", 0, &showlist);
+ add_show_prefix_cmd ("print", no_class,
+ _("Generic command for showing print settings."),
+ &showprintlist, "show print ", 0, &showlist);
add_alias_cmd ("p", "print", no_class, 1, &showlist);
add_alias_cmd ("pr", "print", no_class, 1, &showlist);
- cmd = add_prefix_cmd ("raw", no_class, set_print_raw,
- _("\
+ cmd = add_basic_prefix_cmd ("raw", no_class,
+ _("\
Generic command for setting what things to print in \"raw\" mode."),
- &setprintrawlist, "set print raw ", 0,
- &setprintlist);
+ &setprintrawlist, "set print raw ", 0,
+ &setprintlist);
deprecate_cmd (cmd, nullptr);
- cmd = add_prefix_cmd ("raw", no_class, show_print_raw,
- _("Generic command for showing \"print raw\" settings."),
- &showprintrawlist, "show print raw ", 0,
- &showprintlist);
+ cmd = add_show_prefix_cmd ("raw", no_class,
+ _("Generic command for showing \"print raw\" settings."),
+ &showprintrawlist, "show print raw ", 0,
+ &showprintlist);
deprecate_cmd (cmd, nullptr);
gdb::option::add_setshow_cmds_for_options
"Thread Information Block is %s.\n"), value);
}
-static void
-info_w32_command (const char *args, int from_tty)
-{
- help_list (info_w32_cmdlist, "info w32 ", class_info, gdb_stdout);
-}
-
-static int w32_prefix_command_valid = 0;
-void
-init_w32_command_list (void)
-{
- if (!w32_prefix_command_valid)
- {
- add_prefix_cmd ("w32", class_info, info_w32_command,
- _("Print information specific to Win32 debugging."),
- &info_w32_cmdlist, "info w32 ", 0, &infolist);
- w32_prefix_command_valid = 1;
- }
-}
-
/* Implementation of `gdbarch_gdb_signal_to_target' for Windows. */
static int
windows_gdbarch_data_handle
= gdbarch_data_register_post_init (init_windows_gdbarch_data);
- init_w32_command_list ();
+ add_basic_prefix_cmd ("w32", class_info,
+ _("Print information specific to Win32 debugging."),
+ &info_w32_cmdlist, "info w32 ", 0, &infolist);
+
add_cmd ("thread-information-block", class_info, display_tib,
_("Display thread information block."),
&info_w32_cmdlist);