{
initialize_ada_catchpoint_ops ();
- add_basic_prefix_cmd ("ada", no_class,
- _("Prefix command for changing Ada-specific settings."),
- &set_ada_list, 0, &setlist);
-
- add_show_prefix_cmd ("ada", no_class,
- _("Generic command for showing Ada-specific settings."),
- &show_ada_list, 0, &showlist);
+ add_setshow_prefix_cmd
+ ("ada", no_class,
+ _("Prefix command for changing Ada-specific settings."),
+ _("Generic command for showing Ada-specific settings."),
+ &set_ada_list, &show_ada_list,
+ &setlist, &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_basic_prefix_cmd ("ada", class_maintenance,
- _("Set Ada maintenance-related variables."),
- &maint_set_ada_cmdlist,
- 0/*allow-unknown*/, &maintenance_set_cmdlist);
-
- add_show_prefix_cmd ("ada", class_maintenance,
- _("Show Ada maintenance-related variables."),
- &maint_show_ada_cmdlist,
- 0/*allow-unknown*/, &maintenance_show_cmdlist);
+ add_setshow_prefix_cmd ("ada", class_maintenance,
+ _("Set Ada maintenance-related variables."),
+ _("Show Ada maintenance-related variables."),
+ &maint_set_ada_cmdlist, &maint_show_ada_cmdlist,
+ &maintenance_set_cmdlist, &maintenance_show_cmdlist);
add_setshow_boolean_cmd
("ignore-descriptive-types", class_maintenance,
arm_elf_osabi_sniffer);
/* Add root prefix command for all "set arm"/"show arm" commands. */
- add_basic_prefix_cmd ("arm", no_class,
- _("Various ARM-specific commands."),
- &setarmcmdlist, 0, &setlist);
-
- add_show_prefix_cmd ("arm", no_class,
- _("Various ARM-specific commands."),
- &showarmcmdlist, 0, &showlist);
-
+ add_setshow_prefix_cmd ("arm", no_class,
+ _("Various ARM-specific commands."),
+ _("Various ARM-specific commands."),
+ &setarmcmdlist, &showarmcmdlist,
+ &setlist, &showlist);
arm_disassembler_options = xstrdup ("reg-names-std");
const disasm_options_t *disasm_options
c = add_com_alias ("save-tracepoints", save_tracepoints_cmd, class_trace, 0);
deprecate_cmd (c, "save tracepoints");
- add_basic_prefix_cmd ("breakpoint", class_maintenance, _("\
+ add_setshow_prefix_cmd ("breakpoint", class_maintenance,
+ _("\
Breakpoint specific settings.\n\
Configure various breakpoint-specific variables such as\n\
pending breakpoint behavior."),
- &breakpoint_set_cmdlist,
- 0/*allow-unknown*/, &setlist);
- add_show_prefix_cmd ("breakpoint", class_maintenance, _("\
+ _("\
Breakpoint specific settings.\n\
Configure various breakpoint-specific variables such as\n\
pending breakpoint behavior."),
- &breakpoint_show_cmdlist,
- 0/*allow-unknown*/, &showlist);
+ &breakpoint_set_cmdlist, &breakpoint_show_cmdlist,
+ &setlist, &showlist);
add_setshow_auto_boolean_cmd ("pending", no_class,
&pending_break_support, _("\
_("Branch tracing maintenance commands."),
&maint_btrace_cmdlist, 0, &maintenancelist);
- add_basic_prefix_cmd ("btrace", class_maintenance, _("\
-Set branch tracing specific variables."),
- &maint_btrace_set_cmdlist,
- 0, &maintenance_set_cmdlist);
-
- add_basic_prefix_cmd ("pt", class_maintenance, _("\
-Set Intel Processor Trace specific variables."),
- &maint_btrace_pt_set_cmdlist,
- 0, &maint_btrace_set_cmdlist);
-
- add_show_prefix_cmd ("btrace", class_maintenance, _("\
-Show branch tracing specific variables."),
- &maint_btrace_show_cmdlist,
- 0, &maintenance_show_cmdlist);
-
- add_show_prefix_cmd ("pt", class_maintenance, _("\
-Show Intel Processor Trace specific variables."),
- &maint_btrace_pt_show_cmdlist,
- 0, &maint_btrace_show_cmdlist);
+ add_setshow_prefix_cmd ("btrace", class_maintenance,
+ _("Set branch tracing specific variables."),
+ _("Show branch tracing specific variables."),
+ &maint_btrace_set_cmdlist,
+ &maint_btrace_show_cmdlist,
+ &maintenance_set_cmdlist,
+ &maintenance_show_cmdlist);
+
+ add_setshow_prefix_cmd ("pt", class_maintenance,
+ _("Set Intel Processor Trace specific variables."),
+ _("Show Intel Processor Trace specific variables."),
+ &maint_btrace_pt_set_cmdlist,
+ &maint_btrace_pt_show_cmdlist,
+ &maint_btrace_set_cmdlist,
+ &maint_btrace_show_cmdlist);
add_setshow_boolean_cmd ("skip-pad", class_maintenance,
&maint_btrace_pt_skip_pad, _("\
show_info_verbose,
&setlist, &showlist);
- add_basic_prefix_cmd ("history", class_support, _("\
-Generic command for setting command history parameters."),
- &sethistlist, 0, &setlist);
- add_show_prefix_cmd ("history", class_support, _("\
-Generic command for showing command history parameters."),
- &showhistlist, 0, &showlist);
+ add_setshow_prefix_cmd
+ ("history", class_support,
+ _("Generic command for setting command history parameters."),
+ _("Generic command for showing command history parameters."),
+ &sethistlist, &showhistlist, &setlist, &showlist);
add_setshow_boolean_cmd ("expansion", no_class, &history_expansion_p, _("\
Set history expansion on command input."), _("\
add_cmd ("configuration", no_set_class, show_configuration,
_("Show how GDB was configured at build time."), &showlist);
- add_basic_prefix_cmd ("debug", no_class,
- _("Generic command for setting gdb debugging flags."),
- &setdebuglist, 0, &setlist);
-
- add_show_prefix_cmd ("debug", no_class,
- _("Generic command for showing gdb debugging flags."),
- &showdebuglist, 0, &showlist);
+ add_setshow_prefix_cmd ("debug", no_class,
+ _("Generic command for setting gdb debugging flags."),
+ _("Generic command for showing gdb debugging flags."),
+ &setdebuglist, &showdebuglist,
+ &setlist, &showlist);
cmd_list_element *shell_cmd
= add_com ("shell", class_support, shell_command, _("\
return cmd;
}
+/* See command.h. */
+
+set_show_commands
+add_setshow_prefix_cmd (const char *name, command_class theclass,
+ const char *set_doc, const char *show_doc,
+ cmd_list_element **set_subcommands_list,
+ cmd_list_element **show_subcommands_list,
+ cmd_list_element **set_list,
+ cmd_list_element **show_list)
+{
+ set_show_commands cmds;
+
+ cmds.set = add_basic_prefix_cmd (name, theclass, set_doc,
+ set_subcommands_list, 0,
+ set_list);
+ cmds.show = add_show_prefix_cmd (name, theclass, show_doc,
+ show_subcommands_list, 0,
+ show_list);
+
+ return cmds;
+}
+
/* Like ADD_PREFIX_CMD but sets the suppress_notification pointer on the
new command list element. */
{
static struct cmd_list_element *set_logging_cmdlist, *show_logging_cmdlist;
- add_basic_prefix_cmd ("logging", class_support,
- _("Set logging options."), &set_logging_cmdlist,
- 0, &setlist);
- add_show_prefix_cmd ("logging", class_support,
- _("Show logging options."), &show_logging_cmdlist,
- 0, &showlist);
+ add_setshow_prefix_cmd ("logging", class_support,
+ _("Set logging options."),
+ _("Show logging options."),
+ &set_logging_cmdlist, &show_logging_cmdlist,
+ &setlist, &showlist);
+
add_setshow_boolean_cmd ("overwrite", class_support, &logging_overwrite, _("\
Set whether logging overwrites or appends to the log file."), _("\
Show whether logging overwrites or appends to the log file."), _("\
struct cmd_list_element **show_list,
bool skip_intensity)
{
- add_basic_prefix_cmd (m_name, no_class, prefix_doc, &m_set_list,
- 0, set_list);
- add_show_prefix_cmd (m_name, no_class, prefix_doc, &m_show_list,
- 0, show_list);
+ add_setshow_prefix_cmd (m_name, theclass, prefix_doc, prefix_doc,
+ &m_set_list, &m_show_list, set_list, show_list);
+
set_show_commands commands;
commands = add_setshow_enum_cmd
void
_initialize_cli_style ()
{
- add_basic_prefix_cmd ("style", no_class, _("\
+ add_setshow_prefix_cmd ("style", no_class,
+ _("\
Style-specific settings.\n\
Configure various style-related variables, such as colors"),
- &style_set_list, 0, &setlist);
- add_show_prefix_cmd ("style", no_class, _("\
+ _("\
Style-specific settings.\n\
Configure various style-related variables, such as colors"),
- &style_show_list, 0, &showlist);
+ &style_set_list, &style_show_list,
+ &setlist, &showlist);
add_setshow_boolean_cmd ("enabled", no_class, &cli_styling, _("\
Set whether CLI styling is enabled."), _("\
extern bool valid_cmd_char_p (int c);
+/* Return value type for the add_setshow_* functions. */
+
+struct set_show_commands
+{
+ cmd_list_element *set, *show;
+};
+
/* Const-correct variant of the above. */
extern struct cmd_list_element *add_cmd (const char *, enum command_class,
(const char *, enum command_class, const char *, struct cmd_list_element **,
int, struct cmd_list_element **);
+/* Add matching set and show commands using add_basic_prefix_cmd and
+ add_show_prefix_cmd. */
+
+extern set_show_commands add_setshow_prefix_cmd
+ (const char *name, command_class theclass, const char *set_doc,
+ const char *show_doc,
+ cmd_list_element **set_subcommands_list,
+ cmd_list_element **show_subcommands_list,
+ cmd_list_element **set_list,
+ cmd_list_element **show_list);
+
extern struct cmd_list_element *add_prefix_cmd_suppress_notification
(const char *name, enum command_class theclass,
cmd_simple_func_ftype *fun,
instead print the value out directly. */
extern show_value_ftype deprecated_show_value_hack;
-/* Return value type for the add_setshow_* functions. */
-
-struct set_show_commands
-{
- cmd_list_element *set, *show;
-};
-
extern set_show_commands add_setshow_enum_cmd
(const char *name, command_class theclass, const char *const *enumlist,
const char **var, const char *set_doc, const char *show_doc,
summary of each line in the cache. With an argument, dump\"\n\
the contents of the given line."));
- add_basic_prefix_cmd ("dcache", class_obscure, _("\
+ add_setshow_prefix_cmd ("dcache", class_obscure,
+ _("\
Use this command to set number of lines in dcache and line-size."),
- &dcache_set_list, /*allow_unknown*/0, &setlist);
- add_show_prefix_cmd ("dcache", class_obscure, _("\
-Show dcachesettings."),
- &dcache_show_list, /*allow_unknown*/0,
- &showlist);
+ ("Show dcache settings."),
+ &dcache_set_list, &dcache_show_list,
+ &setlist, &showlist);
add_setshow_zuinteger_cmd ("line-size", class_obscure,
&dcache_line_size, _("\
void
_initialize_dwarf2_read ()
{
- add_basic_prefix_cmd ("dwarf", class_maintenance, _("\
+ add_setshow_prefix_cmd ("dwarf", class_maintenance,
+ _("\
Set DWARF specific variables.\n\
Configure DWARF variables such as the cache size."),
- &set_dwarf_cmdlist,
- 0/*allow-unknown*/, &maintenance_set_cmdlist);
-
- add_show_prefix_cmd ("dwarf", class_maintenance, _("\
+ _("\
Show DWARF specific variables.\n\
Show DWARF variables such as the cache size."),
- &show_dwarf_cmdlist,
- 0/*allow-unknown*/, &maintenance_show_cmdlist);
+ &set_dwarf_cmdlist, &show_dwarf_cmdlist,
+ &maintenance_set_cmdlist, &maintenance_show_cmdlist);
add_setshow_zinteger_cmd ("max-cache-age", class_obscure,
&dwarf_max_cache_age, _("\
{
f_type_data = gdbarch_data_register_post_init (build_fortran_types);
- add_basic_prefix_cmd ("fortran", no_class,
- _("Prefix command for changing Fortran-specific settings."),
- &set_fortran_list, 0, &setlist);
-
- add_show_prefix_cmd ("fortran", no_class,
- _("Generic command for showing Fortran-specific settings."),
- &show_fortran_list, 0, &showlist);
+ add_setshow_prefix_cmd
+ ("fortran", no_class,
+ _("Prefix command for changing Fortran-specific settings."),
+ _("Generic command for showing Fortran-specific settings."),
+ &set_fortran_list, &show_fortran_list,
+ &setlist, &showlist);
add_setshow_boolean_cmd ("repack-array-slices", class_vars,
&repack_array_slices, _("\
gdb::observers::target_changed.attach (frame_observer_target_changed,
"frame");
- add_basic_prefix_cmd ("backtrace", class_maintenance, _("\
+ add_setshow_prefix_cmd ("backtrace", class_maintenance,
+ _("\
Set backtrace specific variables.\n\
Configure backtrace variables such as the backtrace limit"),
- &set_backtrace_cmdlist,
- 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,
- 0/*allow-unknown*/, &showlist);
+ &set_backtrace_cmdlist, &show_backtrace_cmdlist,
+ &setlist, &showlist);
add_setshow_uinteger_cmd ("limit", class_obscure,
&user_set_backtrace_options.backtrace_limit, _("\
);
add_com_alias ("gu", guile_cmd_element, class_obscure, 1);
- cmd_list_element *set_guile_cmd
- = add_basic_prefix_cmd ("guile", class_obscure,
- _("Prefix command for Guile preference settings."),
- &set_guile_list, 0, &setlist);
- add_alias_cmd ("gu", set_guile_cmd, class_obscure, 1, &setlist);
-
- cmd_list_element *show_guile_cmd
- = add_show_prefix_cmd ("guile", class_obscure,
- _("Prefix command for Guile preference settings."),
- &show_guile_list, 0, &showlist);
- add_alias_cmd ("gu", show_guile_cmd, class_obscure, 1, &showlist);
+ set_show_commands setshow_guile_cmds
+ = add_setshow_prefix_cmd ("guile", class_obscure,
+ _("\
+Prefix command for Guile preference settings."),
+ _("\
+Prefix command for Guile preference settings."),
+ &set_guile_list, &show_guile_list,
+ &setlist, &showlist);
+
+ add_alias_cmd ("gu", setshow_guile_cmds.set, class_obscure, 1, &setlist);
+ add_alias_cmd ("gu", setshow_guile_cmds.show, class_obscure, 1, &showlist);
cmd_list_element *info_guile_cmd
= add_basic_prefix_cmd ("guile", class_obscure,
NULL, /* FIXME: i18n: */
&setlist, &showlist);
- /* Add "mpx" prefix for the set commands. */
+ /* Add "mpx" prefix for the set and show commands. */
- add_basic_prefix_cmd ("mpx", class_support, _("\
-Set Intel Memory Protection Extensions specific variables."),
- &mpx_set_cmdlist,
- 0 /* allow-unknown */, &setlist);
-
- /* Add "mpx" prefix for the show commands. */
-
- add_show_prefix_cmd ("mpx", class_support, _("\
-Show Intel Memory Protection Extensions specific variables."),
- &mpx_show_cmdlist,
- 0 /* allow-unknown */, &showlist);
+ add_setshow_prefix_cmd
+ ("mpx", class_support,
+ _("Set Intel Memory Protection Extensions specific variables."),
+ _("Show Intel Memory Protection Extensions specific variables."),
+ &mpx_set_cmdlist, &mpx_show_cmdlist, &setlist, &showlist);
/* Add "bound" command for the show mpx commands list. */
/* GDB commands for language specific stuff. */
- cmd_list_element *set_check_cmd
- = add_basic_prefix_cmd ("check", no_class,
- _("Set the status of the type/range checker."),
- &setchecklist, 0, &setlist);
- add_alias_cmd ("c", set_check_cmd, no_class, 1, &setlist);
- add_alias_cmd ("ch", set_check_cmd, no_class, 1, &setlist);
-
- cmd_list_element *show_check_cmd
- = add_show_prefix_cmd ("check", no_class,
- _("Show the status of the type/range checker."),
- &showchecklist, 0, &showlist);
- add_alias_cmd ("c", show_check_cmd, no_class, 1, &showlist);
- add_alias_cmd ("ch", show_check_cmd, no_class, 1, &showlist);
+ set_show_commands setshow_check_cmds
+ = add_setshow_prefix_cmd ("check", no_class,
+ _("Set the status of the type/range checker."),
+ _("Show the status of the type/range checker."),
+ &setchecklist, &showchecklist,
+ &setlist, &showlist);
+ add_alias_cmd ("c", setshow_check_cmds.set, no_class, 1, &setlist);
+ add_alias_cmd ("ch", setshow_check_cmds.set, no_class, 1, &setlist);
+ add_alias_cmd ("c", setshow_check_cmds.show, no_class, 1, &showlist);
+ add_alias_cmd ("ch", setshow_check_cmds.show, no_class, 1, &showlist);
add_setshow_enum_cmd ("range", class_support, type_or_range_names,
&range,
{
maintenance_test_settings_filename = xstrdup ("/foo/bar");
- add_basic_prefix_cmd ("test-settings", class_maintenance,
- _("\
+ add_setshow_prefix_cmd ("test-settings", class_maintenance,
+ _("\
Set GDB internal variables used for set/show command infrastructure testing."),
- &maintenance_set_test_settings_list,
- 0/*allow-unknown*/,
- &maintenance_set_cmdlist);
-
- add_show_prefix_cmd ("test-settings", class_maintenance,
- _("\
+ _("\
Show GDB internal variables used for set/show command infrastructure testing."),
- &maintenance_show_test_settings_list,
- 0/*allow-unknown*/,
- &maintenance_show_cmdlist);
+ &maintenance_set_test_settings_list,
+ &maintenance_show_test_settings_list,
+ &maintenance_set_cmdlist, &maintenance_show_cmdlist);
add_setshow_boolean_cmd ("boolean", class_maintenance,
&maintenance_test_settings_boolean, _("\
add_info ("mem", info_mem_command,
_("Memory region attributes."));
- add_basic_prefix_cmd ("mem", class_vars, _("\
-Memory regions settings."),
- &mem_set_cmdlist,
- 0/* allow-unknown */, &setlist);
- add_show_prefix_cmd ("mem", class_vars, _("\
-Memory regions settings."),
- &mem_show_cmdlist,
- 0/* allow-unknown */, &showlist);
+ add_setshow_prefix_cmd ("mem", class_vars,
+ _("Memory regions settings."),
+ _("Memory regions settings."),
+ &mem_set_cmdlist, &mem_show_cmdlist,
+ &setlist, &showlist);
add_setshow_boolean_cmd ("inaccessible-by-default", no_class,
&inaccessible_by_default, _("\
set_tdesc_property (mips_tdesc_gp64, PROPERTY_GP64, "");
/* Add root prefix command for all "set mips"/"show mips" commands. */
- add_basic_prefix_cmd ("mips", no_class,
- _("Various MIPS specific commands."),
- &setmipscmdlist, 0, &setlist);
-
- add_show_prefix_cmd ("mips", no_class,
- _("Various MIPS specific commands."),
- &showmipscmdlist, 0, &showlist);
+ add_setshow_prefix_cmd ("mips", no_class,
+ _("Various MIPS specific commands."),
+ _("Various MIPS specific commands."),
+ &setmipscmdlist, &showmipscmdlist,
+ &setlist, &showlist);
/* Allow the user to override the ABI. */
add_setshow_enum_cmd ("abi", class_obscure, mips_abi_strings,
add_com_alias ("py", python_cmd_element, class_obscure, 1);
/* Add set/show python print-stack. */
- add_basic_prefix_cmd ("python", no_class,
- _("Prefix command for python preference settings."),
- &user_show_python_list, 0, &showlist);
-
- add_show_prefix_cmd ("python", no_class,
- _("Prefix command for python preference settings."),
- &user_set_python_list, 0, &setlist);
+ add_setshow_prefix_cmd ("python", no_class,
+ _("Prefix command for python preference settings."),
+ _("Prefix command for python preference settings."),
+ &user_set_python_list, &user_show_python_list,
+ &setlist, &showlist);
add_setshow_enum_cmd ("print-stack", no_class, python_excp_enums,
&gdbpy_should_print_stack, _("\
gdb::observers::inferior_created.attach (ravenscar_inferior_created,
"ravenscar-thread");
- add_basic_prefix_cmd ("ravenscar", no_class,
- _("Prefix command for changing Ravenscar-specific settings."),
- &set_ravenscar_list, 0, &setlist);
-
- add_show_prefix_cmd ("ravenscar", no_class,
- _("Prefix command for showing Ravenscar-specific settings."),
- &show_ravenscar_list, 0, &showlist);
+ add_setshow_prefix_cmd
+ ("ravenscar", no_class,
+ _("Prefix command for changing Ravenscar-specific settings."),
+ _("Prefix command for showing Ravenscar-specific settings."),
+ &set_ravenscar_list, &show_ravenscar_list,
+ &setlist, &showlist);
add_setshow_boolean_cmd ("task-switching", class_obscure,
&ravenscar_task_support, _("\
&record_btrace_cmdlist);
add_alias_cmd ("pt", record_btrace_pt_cmd, class_obscure, 1, &record_cmdlist);
- add_basic_prefix_cmd ("btrace", class_support,
- _("Set record options."), &set_record_btrace_cmdlist,
- 0, &set_record_cmdlist);
-
- add_show_prefix_cmd ("btrace", class_support,
- _("Show record options."), &show_record_btrace_cmdlist,
- 0, &show_record_cmdlist);
+ add_setshow_prefix_cmd ("btrace", class_support,
+ _("Set record options."),
+ _("Show record options."),
+ &set_record_btrace_cmdlist,
+ &show_record_btrace_cmdlist,
+ &set_record_cmdlist, &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_basic_prefix_cmd ("bts", class_support,
- _("Set record btrace bts options."),
- &set_record_btrace_bts_cmdlist,
- 0,
- &set_record_btrace_cmdlist);
-
- add_show_prefix_cmd ("bts", class_support,
- _("Show record btrace bts options."),
- &show_record_btrace_bts_cmdlist,
- 0,
- &show_record_btrace_cmdlist);
+ add_setshow_prefix_cmd ("bts", class_support,
+ _("Set record btrace bts options."),
+ _("Show record btrace bts options."),
+ &set_record_btrace_bts_cmdlist,
+ &show_record_btrace_bts_cmdlist,
+ &set_record_btrace_cmdlist,
+ &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_basic_prefix_cmd ("pt", class_support,
- _("Set record btrace pt options."),
- &set_record_btrace_pt_cmdlist,
- 0,
- &set_record_btrace_cmdlist);
-
- add_show_prefix_cmd ("pt", class_support,
- _("Show record btrace pt options."),
- &show_record_btrace_pt_cmdlist,
- 0,
- &show_record_btrace_cmdlist);
+ add_setshow_prefix_cmd ("pt", class_support,
+ _("Set record btrace pt options."),
+ _("Show record btrace pt options."),
+ &set_record_btrace_pt_cmdlist,
+ &show_record_btrace_pt_cmdlist,
+ &set_record_btrace_cmdlist,
+ &show_record_btrace_cmdlist);
add_setshow_uinteger_cmd ("buffer-size", no_class,
&record_btrace_conf.pt.size,
set_cmd_completer (c, filename_completer);
deprecate_cmd (c, "record full restore");
- add_basic_prefix_cmd ("full", class_support,
- _("Set record options."), &set_record_full_cmdlist,
- 0, &set_record_cmdlist);
-
- add_show_prefix_cmd ("full", class_support,
- _("Show record options."), &show_record_full_cmdlist,
- 0, &show_record_cmdlist);
+ add_setshow_prefix_cmd ("full", class_support,
+ _("Set record options."),
+ _("Show record options."),
+ &set_record_full_cmdlist,
+ &show_record_full_cmdlist,
+ &set_record_cmdlist,
+ &show_record_cmdlist);
/* Record instructions number limit command. */
set_show_commands set_record_full_stop_at_limit_cmds
add_com_alias ("rec", record_cmd, class_obscure, 1);
- cmd_list_element *set_record_cmd
- = add_basic_prefix_cmd ("record", class_support,
- _("Set record options."), &set_record_cmdlist,
- 0, &setlist);
- add_alias_cmd ("rec", set_record_cmd, class_obscure, 1, &setlist);
-
- cmd_list_element *show_record_cmd
- = add_show_prefix_cmd ("record", class_support,
- _("Show record options."), &show_record_cmdlist,
- 0, &showlist);
- add_alias_cmd ("rec", show_record_cmd, class_obscure, 1, &showlist);
+ set_show_commands setshow_record_cmds
+ = add_setshow_prefix_cmd ("record", class_support,
+ _("Set record options."),
+ _("Show record options."),
+ &set_record_cmdlist, &show_record_cmdlist,
+ &setlist, &showlist);
+
+
+ add_alias_cmd ("rec", setshow_record_cmds.set, class_obscure, 1, &setlist);
+ add_alias_cmd ("rec", setshow_record_cmds.show, class_obscure, 1, &showlist);
cmd_list_element *info_record_cmd
= add_prefix_cmd ("record", class_support, info_record_command,
/* Add root prefix command for all "set debug riscv" and "show debug
riscv" commands. */
- add_basic_prefix_cmd ("riscv", no_class,
- _("RISC-V specific debug commands."),
- &setdebugriscvcmdlist, 0,
- &setdebuglist);
-
- add_show_prefix_cmd ("riscv", no_class,
- _("RISC-V specific debug commands."),
- &showdebugriscvcmdlist, 0,
- &showdebuglist);
+ add_setshow_prefix_cmd ("riscv", no_class,
+ _("RISC-V specific debug commands."),
+ _("RISC-V specific debug commands."),
+ &setdebugriscvcmdlist, &showdebugriscvcmdlist,
+ &setdebuglist, &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_basic_prefix_cmd ("riscv", no_class,
- _("RISC-V specific commands."),
- &setriscvcmdlist, 0, &setlist);
-
- add_show_prefix_cmd ("riscv", no_class,
- _("RISC-V specific commands."),
- &showriscvcmdlist, 0, &showlist);
+ add_setshow_prefix_cmd ("riscv", no_class,
+ _("RISC-V specific commands."),
+ _("RISC-V specific commands."),
+ &setriscvcmdlist, &showriscvcmdlist,
+ &setlist, &showlist);
use_compressed_breakpoints = AUTO_BOOLEAN_AUTO;
/* Add root prefix command for all "set powerpc"/"show powerpc"
commands. */
- add_basic_prefix_cmd ("powerpc", no_class,
- _("Various PowerPC-specific commands."),
- &setpowerpccmdlist, 0, &setlist);
-
- add_show_prefix_cmd ("powerpc", no_class,
- _("Various PowerPC-specific commands."),
- &showpowerpccmdlist, 0, &showlist);
+ add_setshow_prefix_cmd ("powerpc", no_class,
+ _("Various PowerPC-specific commands."),
+ _("Various PowerPC-specific commands."),
+ &setpowerpccmdlist, &showpowerpccmdlist,
+ &setlist, &showlist);
/* Add a command to allow the user to force the ABI. */
add_setshow_auto_boolean_cmd ("soft-float", class_support,
serial_add_interface (&tcp_ops);
#endif /* USE_WIN32API */
- add_basic_prefix_cmd ("tcp", class_maintenance, _("\
+ add_setshow_prefix_cmd ("tcp", class_maintenance,
+ _("\
TCP protocol specific variables.\n\
Configure variables specific to remote TCP connections."),
- &tcp_set_cmdlist,
- 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,
- 0 /* allow-unknown */, &showlist);
+ &tcp_set_cmdlist, &tcp_show_cmdlist,
+ &setlist, &showlist);
add_setshow_boolean_cmd ("auto-retry", class_obscure,
&tcp_auto_retry, _("\
Use <CR>~. or <CR>~^D to break out."));
#endif /* 0 */
- add_basic_prefix_cmd ("serial", class_maintenance, _("\
-Set default serial/parallel port configuration."),
- &serial_set_cmdlist,
- 0/*allow-unknown*/,
- &setlist);
-
- add_show_prefix_cmd ("serial", class_maintenance, _("\
-Show default serial/parallel port configuration."),
- &serial_show_cmdlist,
- 0/*allow-unknown*/,
- &showlist);
+ add_setshow_prefix_cmd ("serial", class_maintenance,
+ _("Set default serial/parallel port configuration."),
+ _("Show default serial/parallel port configuration."),
+ &serial_set_cmdlist, &serial_show_cmdlist,
+ &setlist, &showlist);
/* If target is open when baud changes, it doesn't take effect until
the next open (I think, not sure). */
{
gdbarch_register (bfd_arch_sh, sh_gdbarch_init, NULL);
- add_basic_prefix_cmd ("sh", no_class, "SH specific commands.",
- &setshcmdlist, 0, &setlist);
- add_show_prefix_cmd ("sh", no_class, "SH specific commands.",
- &showshcmdlist, 0, &showlist);
+ add_setshow_prefix_cmd ("sh", no_class,
+ _("SH specific commands."),
+ _("SH specific commands."),
+ &setshcmdlist, &showshcmdlist,
+ &setlist, &showlist);
add_setshow_enum_cmd ("calling-convention", class_vars, sh_cc_enum,
&sh_active_calling_convention,
tdesc_data = gdbarch_data_register_pre_init (tdesc_data_init);
- add_basic_prefix_cmd ("tdesc", class_maintenance, _("\
-Set target description specific variables."),
- &tdesc_set_cmdlist,
- 0 /* allow-unknown */, &setlist);
- add_show_prefix_cmd ("tdesc", class_maintenance, _("\
-Show target description specific variables."),
- &tdesc_show_cmdlist,
- 0 /* allow-unknown */, &showlist);
+ add_setshow_prefix_cmd ("tdesc", class_maintenance,
+ _("Set target description specific variables."),
+ _("Show target description specific variables."),
+ &tdesc_set_cmdlist, &tdesc_show_cmdlist,
+ &setlist, &showlist);
+
add_basic_prefix_cmd ("tdesc", class_maintenance, _("\
Unset target description specific variables."),
&tdesc_unset_cmdlist,
/* Define the classes of commands.
They will appear in the help list in the reverse of this order. */
- add_basic_prefix_cmd ("tui", class_tui,
- _("TUI configuration variables."),
- &tui_setlist, 0 /* allow-unknown */, &setlist);
- add_show_prefix_cmd ("tui", class_tui,
- _("TUI configuration variables."),
- &tui_showlist, 0 /* allow-unknown */, &showlist);
+ add_setshow_prefix_cmd ("tui", class_tui,
+ _("TUI configuration variables."),
+ _("TUI configuration variables."),
+ &tui_setlist, &tui_showlist,
+ &setlist, &showlist);
add_com ("refresh", class_tui, tui_refresh_all_command,
_("Refresh the terminal display."));
Only one level of typedefs is unrolled. See also \"ptype\"."));
set_cmd_completer (c, expression_completer);
- add_show_prefix_cmd ("type", no_class,
- _("Generic command for showing type-printing settings."),
- &showprinttypelist, 0, &showprintlist);
- add_basic_prefix_cmd ("type", no_class,
- _("Generic command for setting how types print."),
- &setprinttypelist, 0, &setprintlist);
+ add_setshow_prefix_cmd ("type", no_class,
+ _("Generic command for showing type-printing settings."),
+ _("Generic command for setting how types print."),
+ &setprinttypelist, &showprinttypelist,
+ &setprintlist, &showprintlist);
add_setshow_boolean_cmd ("methods", no_class, &print_methods,
_("\
= xstrprintf (_("Show what GDB does when %s is detected."),
problem->name);
- add_basic_prefix_cmd (problem->name, class_maintenance, set_doc,
- set_cmd_list,
- 0/*allow-unknown*/, &maintenance_set_cmdlist);
-
- add_show_prefix_cmd (problem->name, class_maintenance, show_doc,
- show_cmd_list,
- 0/*allow-unknown*/, &maintenance_show_cmdlist);
+ add_setshow_prefix_cmd (problem->name, class_maintenance,
+ set_doc, show_doc, set_cmd_list, show_cmd_list,
+ &maintenance_set_cmdlist, &maintenance_show_cmdlist);
if (problem->user_settable_should_quit)
{
selftests::register_test_foreach_arch ("print-flags", test_print_flags);
#endif
- cmd_list_element *cmd;
-
- cmd_list_element *set_print_cmd
- = add_basic_prefix_cmd ("print", no_class,
- _("Generic command for setting how things print."),
- &setprintlist, 0, &setlist);
- add_alias_cmd ("p", set_print_cmd, no_class, 1, &setlist);
+ set_show_commands setshow_print_cmds
+ = add_setshow_prefix_cmd ("print", no_class,
+ _("Generic command for setting how things print."),
+ _("Generic command for showing print settings."),
+ &setprintlist, &showprintlist,
+ &setlist, &showlist);
+ add_alias_cmd ("p", setshow_print_cmds.set, no_class, 1, &setlist);
/* Prefer set print to set prompt. */
- add_alias_cmd ("pr", set_print_cmd, no_class, 1, &setlist);
-
- cmd_list_element *show_print_cmd
- = add_show_prefix_cmd ("print", no_class,
- _("Generic command for showing print settings."),
- &showprintlist, 0, &showlist);
- add_alias_cmd ("p", show_print_cmd, no_class, 1, &showlist);
- add_alias_cmd ("pr", show_print_cmd, no_class, 1, &showlist);
-
- cmd = add_basic_prefix_cmd ("raw", no_class,
- _("\
-Generic command for setting what things to print in \"raw\" mode."),
- &setprintrawlist, 0, &setprintlist);
- deprecate_cmd (cmd, nullptr);
-
- cmd = add_show_prefix_cmd ("raw", no_class,
- _("Generic command for showing \"print raw\" settings."),
- &showprintrawlist, 0, &showprintlist);
- deprecate_cmd (cmd, nullptr);
+ add_alias_cmd ("pr", setshow_print_cmds.set, no_class, 1, &setlist);
+ add_alias_cmd ("p", setshow_print_cmds.show, no_class, 1, &showlist);
+ add_alias_cmd ("pr", setshow_print_cmds.show, no_class, 1, &showlist);
+
+ set_show_commands setshow_print_raw_cmds
+ = add_setshow_prefix_cmd
+ ("raw", no_class,
+ _("Generic command for setting what things to print in \"raw\" mode."),
+ _("Generic command for showing \"print raw\" settings."),
+ &setprintrawlist, &showprintrawlist, &setprintlist, &showprintlist);
+ deprecate_cmd (setshow_print_raw_cmds.set, nullptr);
+ deprecate_cmd (setshow_print_raw_cmds.show, nullptr);
gdb::option::add_setshow_cmds_for_options
(class_support, &user_print_options, value_print_option_defs,