add_basic_prefix_cmd ("ada", no_class,
_("Prefix command for changing Ada-specific settings."),
- &set_ada_list, "set ada ", 0, &setlist);
+ &set_ada_list, 0, &setlist);
add_show_prefix_cmd ("ada", no_class,
_("Generic command for showing Ada-specific settings."),
- &show_ada_list, "show ada ", 0, &showlist);
+ &show_ada_list, 0, &showlist);
add_setshow_boolean_cmd ("trust-PAD-over-XVS", class_obscure,
&trust_pad_over_xvs, _("\
add_basic_prefix_cmd ("ada", class_maintenance,
_("Set Ada maintenance-related variables."),
- &maint_set_ada_cmdlist, "maintenance set ada ",
+ &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, "maintenance show ada ",
+ &maint_show_ada_cmdlist,
0/*allow-unknown*/, &maintenance_show_cmdlist);
add_setshow_boolean_cmd
add_show_prefix_cmd ("arc", class_maintenance,
_("ARC-specific maintenance commands for printing GDB "
"internal state."),
- &maintenance_print_arc_list, "maintenance print arc ",
+ &maintenance_print_arc_list,
0, &maintenanceprintlist);
add_cmd ("arc-instruction", class_maintenance,
/* Add root prefix command for all "set arm"/"show arm" commands. */
add_basic_prefix_cmd ("arm", no_class,
_("Various ARM-specific commands."),
- &setarmcmdlist, "set arm ", 0, &setlist);
+ &setarmcmdlist, 0, &setlist);
add_show_prefix_cmd ("arm", no_class,
_("Various ARM-specific commands."),
- &showarmcmdlist, "show arm ", 0, &showlist);
+ &showarmcmdlist, 0, &showlist);
arm_disassembler_options = xstrdup ("reg-names-std");
Auto-loading specific settings.\n\
Configure various auto-load-specific variables such as\n\
automatic loading of Python scripts."),
- &retval, "set auto-load ",
- 1/*allow-unknown*/, &setlist);
+ &retval, 1/*allow-unknown*/, &setlist);
return &retval;
}
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, 0/*allow-unknown*/, &showlist);
return &retval;
}
Print current status of auto-loaded files.\n\
Print whether various files like Python scripts or .gdbinit files have been\n\
found and/or loaded."),
- &retval, "info auto-load ",
- 0/*allow-unknown*/, &infolist);
+ &retval, 0/*allow-unknown*/, &infolist);
return &retval;
}
With no subcommand, breakpoints are enabled until you command otherwise.\n\
This is used to cancel the effect of the \"disable\" command.\n\
With a subcommand you can enable temporarily."),
- &enablelist, "enable ", 1, &cmdlist);
+ &enablelist, 1, &cmdlist);
add_com_alias ("en", "enable", class_breakpoint, 1);
Give breakpoint numbers (separated by spaces) as arguments.\n\
This is used to cancel the effect of the \"disable\" command.\n\
May be abbreviated to simply \"enable\"."),
- &enablebreaklist, "enable breakpoints ", 1, &enablelist);
+ &enablebreaklist, 1, &enablelist);
add_cmd ("once", no_class, enable_once_command, _("\
Enable some breakpoints for one hit.\n\
Arguments are breakpoint numbers with spaces in between.\n\
To disable all breakpoints, give no argument.\n\
A disabled breakpoint is not forgotten, but has no effect until re-enabled."),
- &disablelist, "disable ", 1, &cmdlist);
+ &disablelist, 1, &cmdlist);
add_com_alias ("dis", "disable", class_breakpoint, 1);
add_com_alias ("disa", "disable", class_breakpoint, 1);
To delete all breakpoints, give no argument.\n\
\n\
Also a prefix command for deletion of other GDB objects."),
- &deletelist, "delete ", 1, &cmdlist);
+ &deletelist, 1, &cmdlist);
add_com_alias ("d", "delete", class_breakpoint, 1);
add_com_alias ("del", "delete", class_breakpoint, 1);
{
add_abbrev_prefix_cmd ("stop", class_breakpoint, stop_command, _("\
Break in function/address or break at a line in the current file."),
- &stoplist, "stop ", 1, &cmdlist);
+ &stoplist, 1, &cmdlist);
add_cmd ("in", class_breakpoint, stopin_command,
_("Break in function or address."), &stoplist);
add_cmd ("at", class_breakpoint, stopat_command,
add_basic_prefix_cmd ("catch", class_breakpoint, _("\
Set catchpoints to catch events."),
- &catch_cmdlist, "catch ",
+ &catch_cmdlist,
0/*allow-unknown*/, &cmdlist);
add_basic_prefix_cmd ("tcatch", class_breakpoint, _("\
Set temporary catchpoints to catch events."),
- &tcatch_cmdlist, "tcatch ",
+ &tcatch_cmdlist,
0/*allow-unknown*/, &cmdlist);
add_catch_command ("fork", _("Catch calls to fork."),
add_basic_prefix_cmd ("save", class_breakpoint,
_("Save breakpoint definitions as a script."),
- &save_cmdlist, "save ",
+ &save_cmdlist,
0/*allow-unknown*/, &cmdlist);
c = add_cmd ("breakpoints", class_breakpoint, save_breakpoints_command, _("\
Breakpoint specific settings.\n\
Configure various breakpoint-specific variables such as\n\
pending breakpoint behavior."),
- &breakpoint_set_cmdlist, "set breakpoint ",
+ &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, "show breakpoint ",
+ &breakpoint_show_cmdlist,
0/*allow-unknown*/, &showlist);
add_setshow_auto_boolean_cmd ("pending", no_class,
add_prefix_cmd ("kvm", class_obscure, bsd_kvm_cmd, _("\
Generic command for manipulating the kernel memory interface."),
- &bsd_kvm_cmdlist, "kvm ", 0, &cmdlist);
+ &bsd_kvm_cmdlist, 0, &cmdlist);
#ifndef HAVE_STRUCT_THREAD_TD_PCB
add_cmd ("proc", class_obscure, bsd_kvm_proc_cmd,
add_basic_prefix_cmd ("btrace", class_maintenance,
_("Branch tracing maintenance commands."),
- &maint_btrace_cmdlist, "maintenance btrace ",
- 0, &maintenancelist);
+ &maint_btrace_cmdlist, 0, &maintenancelist);
add_basic_prefix_cmd ("btrace", class_maintenance, _("\
Set branch tracing specific variables."),
- &maint_btrace_set_cmdlist, "maintenance set btrace ",
+ &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,
- "maintenance set btrace pt ",
0, &maint_btrace_set_cmdlist);
add_show_prefix_cmd ("btrace", class_maintenance, _("\
Show branch tracing specific variables."),
- &maint_btrace_show_cmdlist, "maintenance show btrace ",
+ &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,
- "maintenance show btrace pt ",
0, &maint_btrace_show_cmdlist);
add_setshow_boolean_cmd ("skip-pad", class_maintenance,
add_basic_prefix_cmd ("history", class_support, _("\
Generic command for setting command history parameters."),
- &sethistlist, "set history ", 0, &setlist);
+ &sethistlist, 0, &setlist);
add_show_prefix_cmd ("history", class_support, _("\
Generic command for showing command history parameters."),
- &showhistlist, "show history ", 0, &showlist);
+ &showhistlist, 0, &showlist);
add_setshow_boolean_cmd ("expansion", no_class, &history_expansion_p, _("\
Set history expansion on command input."), _("\
add_prefix_cmd ("info", class_info, info_command, _("\
Generic command for showing things about the program being debugged."),
- &infolist, "info ", 0, &cmdlist);
+ &infolist, 0, &cmdlist);
add_com_alias ("i", "info", class_info, 1);
add_com_alias ("inf", "info", class_info, 1);
c = add_show_prefix_cmd ("show", class_info, _("\
Generic command for showing things about the debugger."),
- &showlist, "show ", 0, &cmdlist);
+ &showlist, 0, &cmdlist);
/* Another way to get at the same thing. */
add_alias_cmd ("set", c, class_info, 0, &infolist);
add_basic_prefix_cmd ("debug", no_class,
_("Generic command for setting gdb debugging flags."),
- &setdebuglist, "set debug ", 0, &setlist);
+ &setdebuglist, 0, &setlist);
add_show_prefix_cmd ("debug", no_class,
_("Generic command for showing gdb debugging flags."),
- &showdebuglist, "show debug ", 0, &showlist);
+ &showdebuglist, 0, &showlist);
c = add_com ("shell", class_support, shell_command, _("\
Execute the rest of the line as a shell command.\n\
c->func = old->func;
c->function = old->function;
c->prefixlist = old->prefixlist;
- c->prefixname = old->prefixname;
c->allow_unknown = old->allow_unknown;
c->abbrev_flag = abbrev_flag;
c->cmd_pointer = old;
add_prefix_cmd (const char *name, enum command_class theclass,
cmd_const_cfunc_ftype *fun,
const char *doc, struct cmd_list_element **prefixlist,
- const char *prefixname, int allow_unknown,
- struct cmd_list_element **list)
+ int allow_unknown, struct cmd_list_element **list)
{
struct cmd_list_element *c = add_cmd (name, theclass, fun, doc, list);
c->prefixlist = prefixlist;
- c->prefixname = prefixname;
c->allow_unknown = allow_unknown;
/* Now that prefix command C is defined, we need to set the prefix field
while (c->cmd_pointer != nullptr)
c = c->cmd_pointer;
- help_list (*c->prefixlist, c->prefixname, all_commands, gdb_stdout);
+ help_list (*c->prefixlist, c->prefixname ().c_str (),
+ 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)
+ int allow_unknown, struct cmd_list_element **list)
{
struct cmd_list_element *cmd = add_prefix_cmd (name, theclass, nullptr,
- doc, prefixlist, prefixname,
+ doc, prefixlist,
allow_unknown, list);
set_cmd_sfunc (cmd, do_prefix_cmd);
return cmd;
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)
+ int allow_unknown, struct cmd_list_element **list)
{
struct cmd_list_element *cmd = add_prefix_cmd (name, theclass, nullptr,
- doc, prefixlist, prefixname,
+ doc, prefixlist,
allow_unknown, list);
set_cmd_sfunc (cmd, do_show_prefix_cmd);
return cmd;
(const char *name, enum command_class theclass,
cmd_const_cfunc_ftype *fun,
const char *doc, struct cmd_list_element **prefixlist,
- const char *prefixname, int allow_unknown,
- struct cmd_list_element **list,
+ int allow_unknown, struct cmd_list_element **list,
int *suppress_notification)
{
struct cmd_list_element *element
= add_prefix_cmd (name, theclass, fun, doc, prefixlist,
- prefixname, allow_unknown, list);
+ allow_unknown, list);
element->suppress_notification = suppress_notification;
return element;
}
add_abbrev_prefix_cmd (const char *name, enum command_class theclass,
cmd_const_cfunc_ftype *fun, const char *doc,
struct cmd_list_element **prefixlist,
- const char *prefixname,
int allow_unknown, struct cmd_list_element **list)
{
struct cmd_list_element *c = add_cmd (name, theclass, fun, doc, list);
c->prefixlist = prefixlist;
- c->prefixname = prefixname;
c->allow_unknown = allow_unknown;
c->abbrev_flag = 1;
return c;
static void
fput_command_name_styled (struct cmd_list_element *c, struct ui_file *stream)
{
- const char *prefixname
- = c->prefix == nullptr ? "" : c->prefix->prefixname;
+ std::string prefixname
+ = c->prefix == nullptr ? "" : c->prefix->prefixname ();
- fprintf_styled (stream, title_style.style (), "%s%s", prefixname, c->name);
+ fprintf_styled (stream, title_style.style (), "%s%s",
+ prefixname.c_str (), c->name);
}
/* Print the definition of alias C using title style for alias
{
/* Recursively call ourselves on the subcommand list,
passing the right prefix in. */
- apropos_cmd (stream, *c->prefixlist, verbose, regex, c->prefixname);
+ apropos_cmd (stream, *c->prefixlist, verbose, regex,
+ c->prefixname ().c_str ());
}
}
}
/* If this is a prefix command, print it's subcommands. */
if (c->prefixlist)
- help_list (*c->prefixlist, c->prefixname, all_commands, stream);
+ help_list (*c->prefixlist, c->prefixname ().c_str (),
+ all_commands, stream);
/* If this is a class name, print all of the commands in the class. */
if (c->func == NULL)
values. */
int local_allow_unknown = (last_list ? last_list->allow_unknown :
allow_unknown);
- const char *local_cmdtype = last_list ? last_list->prefixname : cmdtype;
+ std::string local_cmdtype
+ = last_list ? last_list->prefixname () : cmdtype;
struct cmd_list_element *local_list =
(last_list ? *(last_list->prefixlist) : list);
break;
}
}
- error (_("Ambiguous %scommand \"%s\": %s."), local_cmdtype,
- *line, ambbuf);
+ error (_("Ambiguous %scommand \"%s\": %s."),
+ local_cmdtype.c_str (), *line, ambbuf);
}
}
else
(*line)++;
if (c->prefixlist && **line && !c->allow_unknown)
- undef_cmd_error (c->prefixname, *line);
+ undef_cmd_error (c->prefixname ().c_str (), *line);
/* Seems to be what he wants. Return it. */
return c;
/* Join command prefix (if any) and the command name. */
std::string tmp_cmd_str;
if (cmd->prefix != nullptr)
- tmp_cmd_str += std::string (cmd->prefix->prefixname);
+ tmp_cmd_str += cmd->prefix->prefixname ();
tmp_cmd_str += std::string (cmd->name);
/* Display the appropriate first line, this warns that the thing the user
/* Join the alias prefix (if any) and the alias name. */
std::string tmp_alias_str;
if (alias->prefix != nullptr)
- tmp_alias_str += std::string (alias->prefix->prefixname);
+ tmp_alias_str += alias->prefix->prefixname ();
tmp_alias_str += std::string (alias->name);
if (cmd->cmd_deprecated)
DISABLE_COPY_AND_ASSIGN (cmd_list_element);
+ /* For prefix commands, return a string containing prefix commands to
+ get here: this one plus any others needed to get to it. Ends in a
+ space. It is used before the word "command" in describing the
+ commands reached through this prefix.
+
+ For non-prefix commands, an empty string is returned. */
+ std::string prefixname ()
+ {
+ if (prefixlist == nullptr)
+ /* Not a prefix command. */
+ return "";
+
+ std::string prefixname;
+ if (prefix != nullptr)
+ prefixname = prefix->prefixname ();
+ prefixname += name;
+ prefixname += " ";
+ return prefixname;
+ }
/* Points to next command in this list. */
struct cmd_list_element *next = nullptr;
of the variable containing the list of subcommands. */
struct cmd_list_element **prefixlist = nullptr;
- /* For prefix commands only:
- String containing prefix commands to get here: this one
- plus any others needed to get to it. Should end in a space.
- It is used before the word "command" in describing the
- commands reached through this prefix. */
- const char *prefixname = nullptr;
-
/* The prefix command of this command. */
struct cmd_list_element *prefix = nullptr;
add_basic_prefix_cmd ("dump", class_vars,
_("Dump target code/data to a local file."),
- &dump_cmdlist, "dump ",
+ &dump_cmdlist,
0/*allow-unknown*/,
&cmdlist);
add_basic_prefix_cmd ("append", class_vars,
_("Append target code/data to a local file."),
- &append_cmdlist, "append ",
+ &append_cmdlist,
0/*allow-unknown*/,
&cmdlist);
add_basic_prefix_cmd ("srec", all_commands,
_("Write target code/data to an srec file."),
- &srec_cmdlist, "dump srec ",
+ &srec_cmdlist,
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 ",
+ &ihex_cmdlist,
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 ",
+ &verilog_cmdlist,
0 /*allow-unknown*/,
&dump_cmdlist);
add_basic_prefix_cmd ("tekhex", all_commands,
_("Write target code/data to a tekhex file."),
- &tekhex_cmdlist, "dump tekhex ",
+ &tekhex_cmdlist,
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 ",
+ &binary_dump_cmdlist,
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 ",
+ &binary_append_cmdlist,
0 /*allow-unknown*/,
&append_cmdlist);
add_basic_prefix_cmd ("logging", class_support,
_("Set logging options."), &set_logging_cmdlist,
- "set logging ", 0, &setlist);
+ 0, &setlist);
add_show_prefix_cmd ("logging", class_support,
_("Show logging options."), &show_logging_cmdlist,
- "show logging ", 0, &showlist);
+ 0, &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 **c_prefixlist
= c == nullptr ? nullptr : c->prefixlist;
- const char *c_prefixname = c == nullptr ? nullptr : c->prefixname;
newc = add_cmd (comname, class_user, user_defined_command,
(c != nullptr && c->theclass == class_user)
if (c_prefixlist != nullptr)
{
newc->prefixlist = c_prefixlist;
- newc->prefixname = c_prefixname;
/* allow_unknown: see explanation in equivalent logic in
define_prefix_command (). */
newc->allow_unknown = newc->user_commands.get () != nullptr;
command. */
c->prefixlist = new struct cmd_list_element*;
*(c->prefixlist) = nullptr;
- c->prefixname = xstrprintf ("%s ", comfull);
/* If the prefix command C is not a command, then it must be followed
by known subcommands. Otherwise, if C is also a normal command,
it can be followed by C args that must not cause a 'subcommand'
if (c->prefixlist != NULL)
{
- const char *prefixname = c->prefixname;
+ const std::string prefixname = c->prefixname ();
for (c = *c->prefixlist; c != NULL; c = c->next)
if (c->theclass == class_user || c->prefixlist != NULL)
- show_user_1 (c, prefixname, c->name, gdb_stdout);
+ show_user_1 (c, prefixname.c_str (), c->name, gdb_stdout);
}
}
if (list->prefixlist && list->cmd_pointer == nullptr)
{
ui_out_emit_tuple optionlist_emitter (uiout, "optionlist");
- const char *new_prefix = strstr (list->prefixname, "show ") + 5;
+ std::string prefixname = list->prefixname ();
+ const char *new_prefix = strstr (prefixname.c_str (), "show ") + 5;
if (uiout->is_mi_like_p ())
uiout->field_string ("prefix", new_prefix);
{
ui_out_emit_tuple option_emitter (uiout, "option");
- {
- /* If we find a prefix, output it (with "show " skipped). */
- const char *prefixname
- = (list->prefix == nullptr ? ""
- : strstr (list->prefix->prefixname, "show ") + 5);
- uiout->text (prefixname);
- }
+ if (list->prefix != nullptr)
+ {
+ /* If we find a prefix, output it (with "show " skipped). */
+ std::string prefixname = list->prefix->prefixname ();
+ prefixname = (list->prefix->prefixlist == nullptr ? ""
+ : strstr (prefixname.c_str (), "show ") + 5);
+ uiout->text (prefixname.c_str ());
+ }
uiout->field_string ("name", list->name);
uiout->text (": ");
if (list->type == show_cmd)
struct cmd_list_element **show_list,
bool skip_intensity)
{
- m_set_prefix = std::string ("set style ") + m_name + " ";
- m_show_prefix = std::string ("show style ") + m_name + " ";
-
add_basic_prefix_cmd (m_name, no_class, prefix_doc, &m_set_list,
- m_set_prefix.c_str (), 0, set_list);
+ 0, set_list);
add_show_prefix_cmd (m_name, no_class, prefix_doc, &m_show_list,
- m_show_prefix.c_str (), 0, show_list);
+ 0, show_list);
add_setshow_enum_cmd ("foreground", theclass, cli_colors,
&m_foreground,
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);
+ &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, "show style ", 0, &showlist);
+ &style_show_list, 0, &showlist);
add_setshow_boolean_cmd ("enabled", no_class, &cli_styling, _("\
Set whether CLI styling is enabled."), _("\
/* The intensity. */
const char *m_intensity;
- /* Storage for prefixes needed when registering the commands. */
- std::string m_show_prefix;
- std::string m_set_prefix;
/* Storage for command lists needed when registering
subcommands. */
struct cmd_list_element *m_set_list = nullptr;
cmd_const_cfunc_ftype *fun,
const char *,
struct cmd_list_element **,
- const char *, int,
+ int,
struct cmd_list_element **);
/* Like add_prefix_cmd, but sets the callback to a function that
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 **);
+ 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 **);
+ 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,
const char *doc, struct cmd_list_element **prefixlist,
- const char *prefixname, int allow_unknown,
+ int allow_unknown,
struct cmd_list_element **list,
int *suppress_notification);
cmd_const_cfunc_ftype *fun,
const char *,
struct cmd_list_element
- **, const char *, int,
+ **, int,
struct cmd_list_element
**);
compile_cmd_element = add_prefix_cmd ("compile", class_obscure,
compile_command, _("\
Command to compile source code and inject it into the inferior."),
- &compile_command_list, "compile ", 1, &cmdlist);
+ &compile_command_list, 1, &cmdlist);
add_com_alias ("expression", "compile", class_obscure, 0);
const auto compile_opts = make_compile_options_def_group (nullptr);
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,
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);
+ &dcache_set_list, /*allow_unknown*/0, &setlist);
add_show_prefix_cmd ("dcache", class_obscure, _("\
Show dcachesettings."),
- &dcache_show_list, "show dcache ", /*allow_unknown*/0,
+ &dcache_show_list, /*allow_unknown*/0,
&showlist);
add_setshow_zuinteger_cmd ("line-size", class_obscure,
add_basic_prefix_cmd ("index-cache", class_files,
_("Set index-cache options."),
&set_index_cache_prefix_list,
- "set index-cache ", false, &setlist);
+ false, &setlist);
/* show index-cache */
add_prefix_cmd ("index-cache", class_files, show_index_cache_command,
_("Show index-cache options."), &show_index_cache_prefix_list,
- "show index-cache ", false, &showlist);
+ false, &showlist);
/* set index-cache on */
add_cmd ("on", class_files, set_index_cache_on_command,
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 ",
+ &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, "maintenance show dwarf ",
+ &show_dwarf_cmdlist,
0/*allow-unknown*/, &maintenance_show_cmdlist);
add_setshow_zinteger_cmd ("max-cache-age", class_obscure,
add_basic_prefix_cmd ("fortran", no_class,
_("Prefix command for changing Fortran-specific settings."),
- &set_fortran_list, "set fortran ", 0, &setlist);
+ &set_fortran_list, 0, &setlist);
add_show_prefix_cmd ("fortran", no_class,
_("Generic command for showing Fortran-specific settings."),
- &show_fortran_list, "show fortran ", 0, &showlist);
+ &show_fortran_list, 0, &showlist);
add_setshow_boolean_cmd ("repack-array-slices", class_vars,
&repack_array_slices, _("\
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 ",
+ &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, "show backtrace ",
+ &show_backtrace_cmdlist,
0/*allow-unknown*/, &showlist);
add_setshow_uinteger_cmd ("limit", class_obscure,
add_prefix_cmd ("task", no_class, set_task_cmd,
_("Command prefix for setting task attributes."),
- &set_task_cmd_list, "set task ", 0, &setlist);
+ &set_task_cmd_list, 0, &setlist);
add_prefix_cmd ("task", no_class, show_task_cmd,
_("Command prefix for showing task attributes."),
- &show_task_cmd_list, "show task ", 0, &showlist);
+ &show_task_cmd_list, 0, &showlist);
add_cmd ("pause", class_run, set_task_pause_cmd, _("\
Set whether the task is suspended while gdb has control.\n\
{
add_prefix_cmd ("thread", no_class, set_thread_cmd,
_("Command prefix for setting thread properties."),
- &set_thread_cmd_list, "set thread ", 0, &setlist);
+ &set_thread_cmd_list, 0, &setlist);
add_prefix_cmd ("default", no_class, show_thread_cmd,
_("Command prefix for setting default thread properties."),
- &set_thread_default_cmd_list, "set thread default ", 0,
+ &set_thread_default_cmd_list, 0,
&set_thread_cmd_list);
add_prefix_cmd ("thread", no_class, set_thread_default_cmd,
_("Command prefix for showing thread properties."),
- &show_thread_cmd_list, "show thread ", 0, &showlist);
+ &show_thread_cmd_list, 0, &showlist);
add_prefix_cmd ("default", no_class, show_thread_default_cmd,
_("Command prefix for showing default thread properties."),
- &show_thread_default_cmd_list, "show thread default ", 0,
+ &show_thread_default_cmd_list, 0,
&show_thread_cmd_list);
add_cmd ("pause", class_run, set_thread_pause_cmd, _("\
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, 0, &infolist);
add_cmd ("sysinfo", class_info, go32_sysinfo, _("\
Display information about the target system, including CPU, OS, DPMI, etc."),
add_basic_prefix_cmd ("guile", class_obscure,
_("Prefix command for Guile preference settings."),
- &set_guile_list, "set guile ", 0,
- &setlist);
+ &set_guile_list, 0, &setlist);
add_alias_cmd ("gu", "guile", class_obscure, 1, &setlist);
add_show_prefix_cmd ("guile", class_obscure,
_("Prefix command for Guile preference settings."),
- &show_guile_list, "show guile ", 0,
- &showlist);
+ &show_guile_list, 0, &showlist);
add_alias_cmd ("gu", "guile", class_obscure, 1, &showlist);
add_basic_prefix_cmd ("guile", class_obscure,
_("Prefix command for Guile info displays."),
- &info_guile_list, "info guile ", 0,
- &infolist);
+ &info_guile_list, 0, &infolist);
add_info_alias ("gu", "guile", 1);
/* The name "print-stack" is carried over from Python.
cmd = add_prefix_cmd (c_smob->cmd_name, c_smob->cmd_class,
NULL, c_smob->doc, &c_smob->sub_list,
- c_smob->name, allow_unknown, cmd_list);
+ allow_unknown, cmd_list);
}
else
{
add_basic_prefix_cmd ("mpx", class_support, _("\
Set Intel Memory Protection Extensions specific variables."),
- &mpx_set_cmdlist, "set mpx ",
+ &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, "show mpx ",
+ &mpx_show_cmdlist,
0 /* allow-unknown */, &showlist);
/* Add "bound" command for the show mpx commands list. */
add_basic_prefix_cmd ("unset", no_class,
_("Complement to certain \"set\" commands."),
- &unsetlist, "unset ", 0, &cmdlist);
+ &unsetlist, 0, &cmdlist);
c = add_cmd ("environment", class_run, unset_environment_command, _("\
Cancel environment variable VAR for the program.\n\
add_prefix_cmd ("kill", class_run, kill_command,
_("Kill execution of program being debugged."),
- &killlist, "kill ", 0, &cmdlist);
+ &killlist, 0, &cmdlist);
add_com ("attach", class_run, attach_command, _("\
Attach to a process or file outside of GDB.\n\
Detach a process or file previously attached.\n\
If a process, it is no longer traced, and it continues its execution. If\n\
you were debugging a file, the file is closed and gdb no longer accesses it."),
- &detachlist, "detach ", 0, &cmdlist);
+ &detachlist, 0, &cmdlist);
add_com ("disconnect", class_run, disconnect_command, _("\
Disconnect from a target.\n\
_("\
Show additional information about a process.\n\
Specify any process id, or use the program being debugged by default."),
- &info_proc_cmdlist, "info proc ",
+ &info_proc_cmdlist,
1/*allow-unknown*/, &infolist);
add_cmd ("mappings", class_info, info_proc_cmd_mappings, _("\
add_basic_prefix_cmd ("check", no_class,
_("Set the status of the type/range checker."),
- &setchecklist, "set check ", 0, &setlist);
+ &setchecklist, 0, &setlist);
add_alias_cmd ("c", "check", no_class, 1, &setlist);
add_alias_cmd ("ch", "check", no_class, 1, &setlist);
add_show_prefix_cmd ("check", no_class,
_("Show the status of the type/range checker."),
- &showchecklist, "show check ", 0, &showlist);
+ &showchecklist, 0, &showlist);
add_alias_cmd ("c", "check", no_class, 1, &showlist);
add_alias_cmd ("ch", "check", no_class, 1, &showlist);
the various commands for working with preprocessor macros. */
add_basic_prefix_cmd ("macro", class_info,
_("Prefix for commands dealing with C preprocessor macros."),
- ¯olist, "macro ", 0, &cmdlist);
+ ¯olist, 0, &cmdlist);
add_cmd ("expand", no_class, macro_expand_command, _("\
Fully expand any C/C++ preprocessor macro invocations in EXPRESSION.\n\
_("\
Generic command for testing the options infrastructure."),
&maintenance_test_options_list,
- "maintenance test-options ", 0,
- &maintenancelist);
+ 0, &maintenancelist);
const auto def_group = make_test_options_options_def_group (nullptr);
_("\
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);
_("\
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);
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,
+ &maintenancelist, 0,
&cmdlist);
add_com_alias ("mt", "maintenance", class_maintenance, 1);
add_basic_prefix_cmd ("info", class_maintenance, _("\
Commands for showing internal info about the program being debugged."),
- &maintenanceinfolist, "maintenance info ", 0,
+ &maintenanceinfolist, 0,
&maintenancelist);
add_alias_cmd ("i", "info", class_maintenance, 1, &maintenancelist);
add_basic_prefix_cmd ("print", class_maintenance,
_("Maintenance command for printing GDB internal state."),
- &maintenanceprintlist, "maintenance print ", 0,
+ &maintenanceprintlist, 0,
&maintenancelist);
add_basic_prefix_cmd ("flush", class_maintenance,
_("Maintenance command for flushing GDB internal caches."),
- &maintenanceflushlist, "maintenance flush ", 0,
+ &maintenanceflushlist, 0,
&maintenancelist);
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 ",
+ &maintenance_set_cmdlist,
0/*allow-unknown*/,
&maintenancelist);
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 ",
+ &maintenance_show_cmdlist,
0/*allow-unknown*/,
&maintenancelist);
add_prefix_cmd ("per-command", class_maintenance, set_per_command_cmd, _("\
Per-command statistics settings."),
- &per_command_setlist, "maintenance set per-command ",
+ &per_command_setlist,
1/*allow-unknown*/, &maintenance_set_cmdlist);
add_show_prefix_cmd ("per-command", class_maintenance, _("\
Show per-command statistics settings."),
- &per_command_showlist, "maintenance show per-command ",
+ &per_command_showlist,
0/*allow-unknown*/, &maintenance_show_cmdlist);
add_setshow_boolean_cmd ("time", class_maintenance,
add_basic_prefix_cmd ("check", class_maintenance, _("\
Commands for checking internal gdb state."),
- &maintenancechecklist, "maintenance check ", 0,
+ &maintenancechecklist, 0,
&maintenancelist);
add_cmd ("translate-address", class_maintenance,
add_basic_prefix_cmd ("mem", class_vars, _("\
Memory regions settings."),
- &mem_set_cmdlist, "set mem ",
+ &mem_set_cmdlist,
0/* allow-unknown */, &setlist);
add_show_prefix_cmd ("mem", class_vars, _("\
Memory regions settings."),
- &mem_show_cmdlist, "show mem ",
+ &mem_show_cmdlist,
0/* allow-unknown */, &showlist);
add_setshow_boolean_cmd ("inaccessible-by-default", no_class,
/* Add root prefix command for all "set mips"/"show mips" commands. */
add_basic_prefix_cmd ("mips", no_class,
_("Various MIPS specific commands."),
- &setmipscmdlist, "set mips ", 0, &setlist);
+ &setmipscmdlist, 0, &setlist);
add_show_prefix_cmd ("mips", no_class,
_("Various MIPS specific commands."),
- &showmipscmdlist, "show mips ", 0, &showlist);
+ &showmipscmdlist, 0, &showlist);
/* Allow the user to override the ABI. */
add_setshow_enum_cmd ("abi", class_obscure, mips_abi_strings,
add_basic_prefix_cmd ("mipsfpu", class_support,
_("Set use of MIPS floating-point coprocessor."),
- &mipsfpulist, "set mipsfpu ", 0, &setlist);
+ &mipsfpulist, 0, &setlist);
add_cmd ("single", class_support, set_mipsfpu_single_command,
_("Select single-precision MIPS floating-point coprocessor."),
&mipsfpulist);
\n\
With a subcommand, this command modifies parts of the gdb environment.\n\
You can see these environment settings with the \"show\" command."),
- &setlist, "set ", 1, &cmdlist);
+ &setlist, 1, &cmdlist);
if (dbx_commands)
add_com ("assign", class_vars, set_command, _("\
Evaluate expression EXP and assign result to variable VAR.\n\
/* Memory tagging commands. */
add_prefix_cmd ("memory-tag", class_vars, memory_tag_command, _("\
Generic command for printing and manipulating memory tag properties."),
- &memory_tag_list, "memory-tag ", 0, &cmdlist);
+ &memory_tag_list, 0, &cmdlist);
add_cmd ("print-logical-tag", class_vars,
memory_tag_print_logical_tag_command,
("Print the logical tag from POINTER.\n\
subcommand.\n\
If you do not specify any argument, or specify `all', then the command\n\
will show information about all types of probes."),
- &info_probes_cmdlist, "info probes ",
- 0/*allow-unknown*/, &infolist);
+ &info_probes_cmdlist, 0/*allow-unknown*/, &infolist);
return &info_probes_cmdlist;
}
/* Release our hold on the command object. */
gdbpy_ref<cmdpy_object> cmd ((cmdpy_object *) context);
cmd->command = NULL;
-
- /* We may have allocated the prefix name. */
- xfree ((char *) self->prefixname);
}
/* Called by gdb to invoke the command. */
error (_("Invalid invocation of Python command object."));
if (! PyObject_HasAttr ((PyObject *) obj, invoke_cst))
{
- if (obj->command->prefixname)
+ if (obj->command->prefixlist != nullptr)
{
/* A prefix command does not need an invoke method. */
return;
int completetype = -1;
char *docstring = NULL;
struct cmd_list_element **cmd_list;
- char *cmd_name, *pfx_name;
+ char *cmd_name;
static const char *keywords[] = { "name", "command_class", "completer_class",
"prefix", NULL };
- PyObject *is_prefix = NULL;
- int cmp;
+ PyObject *is_prefix_obj = NULL;
+ bool is_prefix = false;
if (obj->command)
{
if (!gdb_PyArg_ParseTupleAndKeywords (args, kw, "si|iO",
keywords, &name, &cmdtype,
- &completetype, &is_prefix))
+ &completetype, &is_prefix_obj))
return -1;
if (cmdtype != no_class && cmdtype != class_run
if (! cmd_name)
return -1;
- pfx_name = NULL;
- if (is_prefix != NULL)
+ if (is_prefix_obj != NULL)
{
- cmp = PyObject_IsTrue (is_prefix);
- if (cmp == 1)
- {
- int i, out;
-
- /* Make a normalized form of the command name. */
- pfx_name = (char *) xmalloc (strlen (name) + 2);
-
- i = 0;
- out = 0;
- while (name[i])
- {
- /* Skip whitespace. */
- while (name[i] == ' ' || name[i] == '\t')
- ++i;
- /* Copy non-whitespace characters. */
- while (name[i] && name[i] != ' ' && name[i] != '\t')
- pfx_name[out++] = name[i++];
- /* Add a single space after each word -- including the final
- word. */
- pfx_name[out++] = ' ';
- }
- pfx_name[out] = '\0';
- }
- else if (cmp < 0)
+ int cmp = PyObject_IsTrue (is_prefix_obj);
+ if (cmp < 0)
{
xfree (cmd_name);
return -1;
}
+ is_prefix = cmp > 0;
}
+
if (PyObject_HasAttr (self, gdbpy_doc_cst))
{
gdbpy_ref<> ds_obj (PyObject_GetAttr (self, gdbpy_doc_cst));
if (docstring == NULL)
{
xfree (cmd_name);
- xfree (pfx_name);
return -1;
}
}
{
struct cmd_list_element *cmd;
- if (pfx_name)
+ if (is_prefix)
{
int allow_unknown;
allow_unknown = PyObject_HasAttr (self, invoke_cst);
cmd = add_prefix_cmd (cmd_name, (enum command_class) cmdtype,
NULL, docstring, &obj->sub_list,
- pfx_name, allow_unknown, cmd_list);
+ allow_unknown, cmd_list);
}
else
cmd = add_cmd (cmd_name, (enum command_class) cmdtype,
{
xfree (cmd_name);
xfree (docstring);
- xfree (pfx_name);
gdbpy_convert_exception (except);
return -1;
}
/* Add set/show python print-stack. */
add_basic_prefix_cmd ("python", no_class,
_("Prefix command for python preference settings."),
- &user_show_python_list, "show python ", 0,
- &showlist);
+ &user_show_python_list, 0, &showlist);
add_show_prefix_cmd ("python", no_class,
_("Prefix command for python preference settings."),
- &user_set_python_list, "set python ", 0,
- &setlist);
+ &user_set_python_list, 0, &setlist);
add_setshow_enum_cmd ("print-stack", no_class, python_excp_enums,
&gdbpy_should_print_stack, _("\
add_basic_prefix_cmd ("ravenscar", no_class,
_("Prefix command for changing Ravenscar-specific settings."),
- &set_ravenscar_list, "set ravenscar ", 0, &setlist);
+ &set_ravenscar_list, 0, &setlist);
add_show_prefix_cmd ("ravenscar", no_class,
_("Prefix command for showing Ravenscar-specific settings."),
- &show_ravenscar_list, "show ravenscar ", 0, &showlist);
+ &show_ravenscar_list, 0, &showlist);
add_setshow_boolean_cmd ("task-switching", class_obscure,
&ravenscar_task_support, _("\
{
add_prefix_cmd ("btrace", class_obscure, cmd_record_btrace_start,
_("Start branch trace recording."), &record_btrace_cmdlist,
- "record btrace ", 0, &record_cmdlist);
+ 0, &record_cmdlist);
add_alias_cmd ("b", "btrace", class_obscure, 1, &record_cmdlist);
add_cmd ("bts", class_obscure, cmd_record_btrace_bts_start,
add_basic_prefix_cmd ("btrace", class_support,
_("Set record options."), &set_record_btrace_cmdlist,
- "set record btrace ", 0, &set_record_cmdlist);
+ 0, &set_record_cmdlist);
add_show_prefix_cmd ("btrace", class_support,
_("Show record options."), &show_record_btrace_cmdlist,
- "show record btrace ", 0, &show_record_cmdlist);
+ 0, &show_record_cmdlist);
add_setshow_enum_cmd ("replay-memory-access", no_class,
replay_memory_access_types, &replay_memory_access, _("\
workarounds for a similar cpu that GDB supports.\n\n\
When set to \"none\", errata workarounds are disabled."),
&set_record_btrace_cpu_cmdlist,
- "set record btrace cpu ", 1,
+ 1,
&set_record_btrace_cmdlist);
add_cmd ("auto", class_support, cmd_set_record_btrace_cpu_auto, _("\
add_basic_prefix_cmd ("bts", class_support,
_("Set record btrace bts options."),
&set_record_btrace_bts_cmdlist,
- "set record btrace bts ", 0,
+ 0,
&set_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,
+ 0,
&show_record_btrace_cmdlist);
add_setshow_uinteger_cmd ("buffer-size", no_class,
add_basic_prefix_cmd ("pt", class_support,
_("Set record btrace pt options."),
&set_record_btrace_pt_cmdlist,
- "set record btrace pt ", 0,
+ 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,
+ 0,
&show_record_btrace_cmdlist);
add_setshow_uinteger_cmd ("buffer-size", no_class,
add_prefix_cmd ("full", class_obscure, cmd_record_full_start,
_("Start full execution recording."), &record_full_cmdlist,
- "record full ", 0, &record_cmdlist);
+ 0, &record_cmdlist);
c = add_cmd ("restore", class_obscure, cmd_record_full_restore,
_("Restore the execution log from a file.\n\
add_basic_prefix_cmd ("full", class_support,
_("Set record options."), &set_record_full_cmdlist,
- "set record full ", 0, &set_record_cmdlist);
+ 0, &set_record_cmdlist);
add_show_prefix_cmd ("full", class_support,
_("Show record options."), &show_record_full_cmdlist,
- "show record full ", 0, &show_record_cmdlist);
+ 0, &show_record_cmdlist);
/* Record instructions number limit command. */
add_setshow_boolean_cmd ("stop-at-limit", no_class,
c = add_prefix_cmd ("record", class_obscure, cmd_record_start,
_("Start recording."),
- &record_cmdlist, "record ", 0, &cmdlist);
+ &record_cmdlist, 0, &cmdlist);
set_cmd_completer (c, filename_completer);
add_com_alias ("rec", "record", class_obscure, 1);
add_basic_prefix_cmd ("record", class_support,
_("Set record options."), &set_record_cmdlist,
- "set record ", 0, &setlist);
+ 0, &setlist);
add_alias_cmd ("rec", "record", class_obscure, 1, &setlist);
add_show_prefix_cmd ("record", class_support,
_("Show record options."), &show_record_cmdlist,
- "show record ", 0, &showlist);
+ 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,
- "info record ", 0, &infolist);
+ 0, &infolist);
add_alias_cmd ("rec", "record", class_obscure, 1, &infolist);
c = add_cmd ("save", class_obscure, cmd_record_save,
add_prefix_cmd ("goto", class_obscure, cmd_record_goto, _("\
Restore the program to its state at instruction number N.\n\
Argument is instruction number, as shown by 'info record'."),
- &record_goto_cmdlist, "record goto ", 1, &record_cmdlist);
+ &record_goto_cmdlist, 1, &record_cmdlist);
add_cmd ("begin", class_obscure, cmd_record_goto_begin,
_("Go to the beginning of the execution log."),
Remote protocol specific variables.\n\
Configure various remote-protocol specific variables such as\n\
the packets being used."),
- &remote_set_cmdlist, "set remote ",
+ &remote_set_cmdlist,
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\
the packets being used."),
- &remote_show_cmdlist, "show remote ",
+ &remote_show_cmdlist,
0 /* allow-unknown */, &showlist);
add_cmd ("compare-sections", class_obscure, compare_sections_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 ",
+ &remote_cmdlist,
0 /* allow-unknown */, &cmdlist);
add_cmd ("put", class_files, remote_put_command,
riscv" commands. */
add_basic_prefix_cmd ("riscv", no_class,
_("RISC-V specific debug commands."),
- &setdebugriscvcmdlist, "set debug riscv ", 0,
+ &setdebugriscvcmdlist, 0,
&setdebuglist);
add_show_prefix_cmd ("riscv", no_class,
_("RISC-V specific debug commands."),
- &showdebugriscvcmdlist, "show debug riscv ", 0,
+ &showdebugriscvcmdlist, 0,
&showdebuglist);
add_setshow_zuinteger_cmd ("breakpoints", class_maintenance,
/* Add root prefix command for all "set riscv" and "show riscv" commands. */
add_basic_prefix_cmd ("riscv", no_class,
_("RISC-V specific commands."),
- &setriscvcmdlist, "set riscv ", 0, &setlist);
+ &setriscvcmdlist, 0, &setlist);
add_show_prefix_cmd ("riscv", no_class,
_("RISC-V specific commands."),
- &showriscvcmdlist, "show riscv ", 0, &showlist);
+ &showriscvcmdlist, 0, &showlist);
use_compressed_breakpoints = AUTO_BOOLEAN_AUTO;
commands. */
add_basic_prefix_cmd ("powerpc", no_class,
_("Various PowerPC-specific commands."),
- &setpowerpccmdlist, "set powerpc ", 0, &setlist);
+ &setpowerpccmdlist, 0, &setlist);
add_show_prefix_cmd ("powerpc", no_class,
_("Various PowerPC-specific commands."),
- &showpowerpccmdlist, "show powerpc ", 0, &showlist);
+ &showpowerpccmdlist, 0, &showlist);
/* Add a command to allow the user to force the ABI. */
add_setshow_auto_boolean_cmd ("soft-float", class_support,
add_basic_prefix_cmd ("tcp", class_maintenance, _("\
TCP protocol specific variables.\n\
Configure variables specific to remote TCP connections."),
- &tcp_set_cmdlist, "set tcp ",
+ &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, "show tcp ",
+ &tcp_show_cmdlist,
0 /* allow-unknown */, &showlist);
add_setshow_boolean_cmd ("auto-retry", class_obscure,
add_basic_prefix_cmd ("serial", class_maintenance, _("\
Set default serial/parallel port configuration."),
- &serial_set_cmdlist, "set serial ",
+ &serial_set_cmdlist,
0/*allow-unknown*/,
&setlist);
add_show_prefix_cmd ("serial", class_maintenance, _("\
Show default serial/parallel port configuration."),
- &serial_show_cmdlist, "show serial ",
+ &serial_show_cmdlist,
0/*allow-unknown*/,
&showlist);
gdbarch_register (bfd_arch_sh, sh_gdbarch_init, NULL);
add_basic_prefix_cmd ("sh", no_class, "SH specific commands.",
- &setshcmdlist, "set sh ", 0, &setlist);
+ &setshcmdlist, 0, &setlist);
add_show_prefix_cmd ("sh", no_class, "SH specific commands.",
- &showshcmdlist, "show sh ", 0, &showlist);
+ &showshcmdlist, 0, &showlist);
add_setshow_enum_cmd ("calling-convention", class_vars, sh_cc_enum,
&sh_active_calling_convention,
FUNCTION-SPEC is one of:\n\
-fu|-function FUNCTION-NAME\n\
-rfu|-rfunction FUNCTION-NAME-REGULAR-EXPRESSION"),
- &skiplist, "skip ", 1, &cmdlist);
+ &skiplist, 1, &cmdlist);
c = add_cmd ("file", class_breakpoint, skip_file_command, _("\
Ignore a file while stepping.\n\
{
add_basic_prefix_cmd ("adi", class_support,
_("ADI version related commands."),
- &sparc64adilist, "adi ", 0, &cmdlist);
+ &sparc64adilist, 0, &cmdlist);
add_cmd ("examine", class_support, adi_examine_command,
_("Examine ADI versions."), &sparc64adilist);
add_alias_cmd ("x", "examine", no_class, 1, &sparc64adilist);
Select and print a stack frame.\n\
With no argument, print the selected stack frame. (See also \"info frame\").\n\
A single numerical argument specifies the frame to select."),
- &frame_cmd_list, "frame ", 1, &cmdlist);
+ &frame_cmd_list, 1, &cmdlist);
add_com_alias ("f", "frame", class_stack, 1);
#define FRAME_APPLY_OPTION_HELP "\
cmd = add_prefix_cmd ("apply", class_stack, frame_apply_command,
frame_apply_cmd_help.c_str (),
- &frame_apply_cmd_list, "frame apply ", 1,
+ &frame_apply_cmd_list, 1,
&frame_cmd_list);
set_cmd_completer_handle_brkchars (cmd, frame_apply_cmd_completer);
&select_frame_cmd.base_command, _("\
Select a stack frame without printing anything.\n\
A single numerical argument specifies the frame to select."),
- &select_frame_cmd_list, "select-frame ", 1, &cmdlist,
+ &select_frame_cmd_list, 1, &cmdlist,
&cli_suppress_notification.user_selected_context);
add_cmd_suppress_notification ("address", class_stack,
With no arguments, displays information about the currently selected stack\n\
frame. Alternatively a frame specification may be provided (See \"frame\")\n\
the information is then printed about the specified frame."),
- &info_frame_cmd_list, "info frame ", 1, &infolist);
+ &info_frame_cmd_list, 1, &infolist);
add_info_alias ("f", "frame", 1);
add_cmd ("address", class_stack, &info_frame_cmd.address,
add_basic_prefix_cmd ("overlay", class_support,
_("Commands for debugging overlays."), &overlaylist,
- "overlay ", 0, &cmdlist);
+ 0, &cmdlist);
add_com_alias ("ovly", "overlay", class_support, 1);
add_com_alias ("ov", "overlay", class_support, 1);
add_basic_prefix_cmd ("module", class_info, _("\
Print information about modules."),
- &info_module_cmdlist, "info module ",
- 0, &infolist);
+ &info_module_cmdlist, 0, &infolist);
c = add_cmd ("functions", class_info, info_module_functions_command, _("\
Display functions arranged by modules.\n\
add_basic_prefix_cmd ("tdesc", class_maintenance, _("\
Set target description specific variables."),
- &tdesc_set_cmdlist, "set tdesc ",
+ &tdesc_set_cmdlist,
0 /* allow-unknown */, &setlist);
add_show_prefix_cmd ("tdesc", class_maintenance, _("\
Show target description specific variables."),
- &tdesc_show_cmdlist, "show tdesc ",
+ &tdesc_show_cmdlist,
0 /* allow-unknown */, &showlist);
add_basic_prefix_cmd ("tdesc", class_maintenance, _("\
Unset target description specific variables."),
- &tdesc_unset_cmdlist, "unset tdesc ",
+ &tdesc_unset_cmdlist,
0 /* allow-unknown */, &unsetlist);
add_setshow_filename_cmd ("filename", class_obscure,
Remaining arguments are interpreted by the target protocol. For more\n\
information on the arguments for a particular protocol, type\n\
`help target ' followed by the protocol name."),
- &targetlist, "target ", 0, &cmdlist);
+ &targetlist, 0, &cmdlist);
c = add_cmd (t.shortname, no_class, t.doc, &targetlist);
set_cmd_context (c, (void *) &t);
set_cmd_sfunc (c, open_target);
add_prefix_cmd ("thread", class_run, thread_command, _("\
Use this command to switch between threads.\n\
The new thread ID must be currently known."),
- &thread_cmd_list, "thread ", 1, &cmdlist);
+ &thread_cmd_list, 1, &cmdlist);
#define THREAD_APPLY_OPTION_HELP "\
Prints per-inferior thread number and target system's thread id\n\
c = add_prefix_cmd ("apply", class_run, thread_apply_command,
thread_apply_help.c_str (),
- &thread_apply_list, "thread apply ", 1,
+ &thread_apply_list, 1,
&thread_cmd_list);
set_cmd_completer_handle_brkchars (c, thread_apply_command_completer);
that can be followed by its args), report the list of
subcommands. */
{
+ std::string prefixname = c->prefixname ();
+ std::string prefixname_no_space
+ = prefixname.substr (0, prefixname.length () - 1);
printf_unfiltered
- ("\"%.*s\" must be followed by the name of a subcommand.\n",
- (int) strlen (c->prefixname) - 1, c->prefixname);
- help_list (*c->prefixlist, c->prefixname, all_commands, gdb_stdout);
+ ("\"%s\" must be followed by the name of a subcommand.\n",
+ prefixname_no_space.c_str ());
+ help_list (*c->prefixlist, prefixname.c_str (), all_commands,
+ gdb_stdout);
}
else if (c->type == set_cmd)
do_set_command (arg, from_tty, c);
add_prefix_cmd ("tfind", class_trace, tfind_command, _("\
Select a trace frame.\n\
No argument means forward by one frame; '-' means backward by one frame."),
- &tfindlist, "tfind ", 1, &cmdlist);
+ &tfindlist, 1, &cmdlist);
add_cmd ("outside", class_trace, tfind_outside_command, _("\
Select a trace frame whose PC is outside the given range (exclusive).\n\
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, 0, &cmdlist);
add_cmd ("next", class_tui, tui_next_layout_command,
_("Apply the next TUI layout."),
if (tuilist == 0)
add_basic_prefix_cmd ("tui", class_tui,
_("Text User Interface commands."),
- &tuilist, "tui ", 0, &cmdlist);
+ &tuilist, 0, &cmdlist);
return &tuilist;
}
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, "set tui ",
- 0 /* allow-unknown */, &setlist);
+ &tui_setlist, 0 /* allow-unknown */, &setlist);
add_show_prefix_cmd ("tui", class_tui,
_("TUI configuration variables."),
- &tui_showlist, "show tui ",
- 0 /* allow-unknown */, &showlist);
+ &tui_showlist, 0 /* allow-unknown */, &showlist);
add_com ("refresh", class_tui, tui_refresh_all_command,
_("Refresh the terminal display."));
add_show_prefix_cmd ("type", no_class,
_("Generic command for showing type-printing settings."),
- &showprinttypelist, "show print type ", 0,
- &showprintlist);
+ &showprinttypelist, 0, &showprintlist);
add_basic_prefix_cmd ("type", no_class,
_("Generic command for setting how types print."),
- &setprinttypelist, "set print type ", 0,
- &setprintlist);
+ &setprinttypelist, 0, &setprintlist);
add_setshow_boolean_cmd ("methods", no_class, &print_methods,
_("\
{
/* Recursively call ourselves on the subcommand list,
passing the right prefix in. */
- check_doc (*c->prefixlist, c->prefixname);
+ check_doc (*c->prefixlist, c->prefixname ().c_str ());
}
}
}
{
/* Recursively call ourselves on the subcommand list,
passing the right prefix in. */
- traverse_command_structure (c->prefixlist, c->prefixname);
+ traverse_command_structure (c->prefixlist, c->prefixname ().c_str ());
}
if (prefixcmd != c->prefix
|| (prefixcmd == nullptr && *list != cmdlist))
add_basic_prefix_cmd (problem->name, class_maintenance, set_doc,
set_cmd_list,
- concat ("maintenance set ", problem->name, " ",
- (char *) NULL),
0/*allow-unknown*/, &maintenance_set_cmdlist);
add_show_prefix_cmd (problem->name, class_maintenance, show_doc,
show_cmd_list,
- concat ("maintenance show ", problem->name, " ",
- (char *) NULL),
0/*allow-unknown*/, &maintenance_show_cmdlist);
if (problem->user_settable_should_quit)
add_basic_prefix_cmd ("print", no_class,
_("Generic command for setting how things print."),
- &setprintlist, "set print ", 0, &setlist);
+ &setprintlist, 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_show_prefix_cmd ("print", no_class,
_("Generic command for showing print settings."),
- &showprintlist, "show print ", 0, &showlist);
+ &showprintlist, 0, &showlist);
add_alias_cmd ("p", "print", no_class, 1, &showlist);
add_alias_cmd ("pr", "print", no_class, 1, &showlist);
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, 0, &setprintlist);
deprecate_cmd (cmd, nullptr);
cmd = add_show_prefix_cmd ("raw", no_class,
_("Generic command for showing \"print raw\" settings."),
- &showprintrawlist, "show print raw ", 0,
- &showprintlist);
+ &showprintrawlist, 0, &showprintlist);
deprecate_cmd (cmd, nullptr);
gdb::option::add_setshow_cmds_for_options
add_prefix_cmd ("function", no_class, function_command, _("\
Placeholder command for showing help on convenience functions."),
- &functionlist, "function ", 0, &cmdlist);
+ &functionlist, 0, &cmdlist);
add_internal_function ("_isvoid", _("\
Check whether an expression is void.\n\
add_basic_prefix_cmd
("w32", class_info,
_("Print information specific to Win32 debugging."),
- &info_w32_cmdlist, "info w32 ", 0, &infolist);
+ &info_w32_cmdlist, 0, &infolist);
w32_prefix_command_valid = 1;
}
}