gdb: make add_com_alias accept target as a cmd_list_element
The alias creation functions currently accept a name to specify the target command. They pass this to add_alias_cmd, which needs to lookup the target command by name. Given that: - We don't support creating an alias for a command before that command exists. - We always use add_info_alias just after creating that target command, and therefore have access to the target command's cmd_list_element. ... change add_com_alias to accept the target command as a cmd_list_element (other functions are done in subsequent patches). This ensures we don't create the alias before the target command, because you need to get the cmd_list_element from somewhere when you call the alias creation function. And it avoids an unecessary command lookup. So it seems better to me in every aspect. gdb/ChangeLog: * command.h (add_com_alias): Accept target as cmd_list_element. Update callers. Change-Id: I24bed7da57221cc77606034de3023fedac015150
This commit is contained in:
parent
7bd22f56a3
commit
3947f654ea
22 changed files with 219 additions and 173 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
2021-05-27 Simon Marchi <simon.marchi@polymtl.ca>
|
||||||
|
|
||||||
|
* command.h (add_com_alias): Accept target as
|
||||||
|
cmd_list_element. Update callers.
|
||||||
|
|
||||||
2021-05-27 Simon Marchi <simon.marchi@polymtl.ca>
|
2021-05-27 Simon Marchi <simon.marchi@polymtl.ca>
|
||||||
|
|
||||||
* python/py-param.c (add_setshow_generic): Use return values of
|
* python/py-param.c (add_setshow_generic): Use return values of
|
||||||
|
|
|
@ -15724,7 +15724,8 @@ so it will be deleted when hit.\n\
|
||||||
BREAK_ARGS_HELP ("thbreak")));
|
BREAK_ARGS_HELP ("thbreak")));
|
||||||
set_cmd_completer (c, location_completer);
|
set_cmd_completer (c, location_completer);
|
||||||
|
|
||||||
add_prefix_cmd ("enable", class_breakpoint, enable_command, _("\
|
cmd_list_element *enable_cmd
|
||||||
|
= add_prefix_cmd ("enable", class_breakpoint, enable_command, _("\
|
||||||
Enable all or some breakpoints.\n\
|
Enable all or some breakpoints.\n\
|
||||||
Usage: enable [BREAKPOINTNUM]...\n\
|
Usage: enable [BREAKPOINTNUM]...\n\
|
||||||
Give breakpoint numbers (separated by spaces) as arguments.\n\
|
Give breakpoint numbers (separated by spaces) as arguments.\n\
|
||||||
|
@ -15733,7 +15734,7 @@ This is used to cancel the effect of the \"disable\" command.\n\
|
||||||
With a subcommand you can enable temporarily."),
|
With a subcommand you can enable temporarily."),
|
||||||
&enablelist, 1, &cmdlist);
|
&enablelist, 1, &cmdlist);
|
||||||
|
|
||||||
add_com_alias ("en", "enable", class_breakpoint, 1);
|
add_com_alias ("en", enable_cmd, class_breakpoint, 1);
|
||||||
|
|
||||||
add_prefix_cmd ("breakpoints", class_breakpoint, enable_command, _("\
|
add_prefix_cmd ("breakpoints", class_breakpoint, enable_command, _("\
|
||||||
Enable all or some breakpoints.\n\
|
Enable all or some breakpoints.\n\
|
||||||
|
@ -15781,15 +15782,16 @@ If a breakpoint is hit while enabled in this fashion,\n\
|
||||||
the count is decremented; when it reaches zero, the breakpoint is disabled."),
|
the count is decremented; when it reaches zero, the breakpoint is disabled."),
|
||||||
&enablelist);
|
&enablelist);
|
||||||
|
|
||||||
add_prefix_cmd ("disable", class_breakpoint, disable_command, _("\
|
cmd_list_element *disable_cmd
|
||||||
|
= add_prefix_cmd ("disable", class_breakpoint, disable_command, _("\
|
||||||
Disable all or some breakpoints.\n\
|
Disable all or some breakpoints.\n\
|
||||||
Usage: disable [BREAKPOINTNUM]...\n\
|
Usage: disable [BREAKPOINTNUM]...\n\
|
||||||
Arguments are breakpoint numbers with spaces in between.\n\
|
Arguments are breakpoint numbers with spaces in between.\n\
|
||||||
To disable all breakpoints, give no argument.\n\
|
To disable all breakpoints, give no argument.\n\
|
||||||
A disabled breakpoint is not forgotten, but has no effect until re-enabled."),
|
A disabled breakpoint is not forgotten, but has no effect until re-enabled."),
|
||||||
&disablelist, 1, &cmdlist);
|
&disablelist, 1, &cmdlist);
|
||||||
add_com_alias ("dis", "disable", class_breakpoint, 1);
|
add_com_alias ("dis", disable_cmd, class_breakpoint, 1);
|
||||||
add_com_alias ("disa", "disable", class_breakpoint, 1);
|
add_com_alias ("disa", disable_cmd, class_breakpoint, 1);
|
||||||
|
|
||||||
add_cmd ("breakpoints", class_breakpoint, disable_command, _("\
|
add_cmd ("breakpoints", class_breakpoint, disable_command, _("\
|
||||||
Disable all or some breakpoints.\n\
|
Disable all or some breakpoints.\n\
|
||||||
|
@ -15800,7 +15802,8 @@ A disabled breakpoint is not forgotten, but has no effect until re-enabled.\n\
|
||||||
This command may be abbreviated \"disable\"."),
|
This command may be abbreviated \"disable\"."),
|
||||||
&disablelist);
|
&disablelist);
|
||||||
|
|
||||||
add_prefix_cmd ("delete", class_breakpoint, delete_command, _("\
|
cmd_list_element *delete_cmd
|
||||||
|
= add_prefix_cmd ("delete", class_breakpoint, delete_command, _("\
|
||||||
Delete all or some breakpoints.\n\
|
Delete all or some breakpoints.\n\
|
||||||
Usage: delete [BREAKPOINTNUM]...\n\
|
Usage: delete [BREAKPOINTNUM]...\n\
|
||||||
Arguments are breakpoint numbers with spaces in between.\n\
|
Arguments are breakpoint numbers with spaces in between.\n\
|
||||||
|
@ -15808,8 +15811,8 @@ To delete all breakpoints, give no argument.\n\
|
||||||
\n\
|
\n\
|
||||||
Also a prefix command for deletion of other GDB objects."),
|
Also a prefix command for deletion of other GDB objects."),
|
||||||
&deletelist, 1, &cmdlist);
|
&deletelist, 1, &cmdlist);
|
||||||
add_com_alias ("d", "delete", class_breakpoint, 1);
|
add_com_alias ("d", delete_cmd, class_breakpoint, 1);
|
||||||
add_com_alias ("del", "delete", class_breakpoint, 1);
|
add_com_alias ("del", delete_cmd, class_breakpoint, 1);
|
||||||
|
|
||||||
add_cmd ("breakpoints", class_breakpoint, delete_command, _("\
|
add_cmd ("breakpoints", class_breakpoint, delete_command, _("\
|
||||||
Delete all or some breakpoints or auto-display expressions.\n\
|
Delete all or some breakpoints or auto-display expressions.\n\
|
||||||
|
@ -15819,7 +15822,8 @@ To delete all breakpoints, give no argument.\n\
|
||||||
This command may be abbreviated \"delete\"."),
|
This command may be abbreviated \"delete\"."),
|
||||||
&deletelist);
|
&deletelist);
|
||||||
|
|
||||||
add_com ("clear", class_breakpoint, clear_command, _("\
|
cmd_list_element *clear_cmd
|
||||||
|
= add_com ("clear", class_breakpoint, clear_command, _("\
|
||||||
Clear breakpoint at specified location.\n\
|
Clear breakpoint at specified location.\n\
|
||||||
Argument may be a linespec, explicit, or address location as described below.\n\
|
Argument may be a linespec, explicit, or address location as described below.\n\
|
||||||
\n\
|
\n\
|
||||||
|
@ -15827,17 +15831,18 @@ With no argument, clears all breakpoints in the line that the selected frame\n\
|
||||||
is executing in.\n"
|
is executing in.\n"
|
||||||
"\n" LOCATION_HELP_STRING "\n\n\
|
"\n" LOCATION_HELP_STRING "\n\n\
|
||||||
See also the \"delete\" command which clears breakpoints by number."));
|
See also the \"delete\" command which clears breakpoints by number."));
|
||||||
add_com_alias ("cl", "clear", class_breakpoint, 1);
|
add_com_alias ("cl", clear_cmd, class_breakpoint, 1);
|
||||||
|
|
||||||
c = add_com ("break", class_breakpoint, break_command, _("\
|
cmd_list_element *break_cmd
|
||||||
|
= add_com ("break", class_breakpoint, break_command, _("\
|
||||||
Set breakpoint at specified location.\n"
|
Set breakpoint at specified location.\n"
|
||||||
BREAK_ARGS_HELP ("break")));
|
BREAK_ARGS_HELP ("break")));
|
||||||
set_cmd_completer (c, location_completer);
|
set_cmd_completer (break_cmd, location_completer);
|
||||||
|
|
||||||
add_com_alias ("b", "break", class_run, 1);
|
add_com_alias ("b", break_cmd, class_run, 1);
|
||||||
add_com_alias ("br", "break", class_run, 1);
|
add_com_alias ("br", break_cmd, class_run, 1);
|
||||||
add_com_alias ("bre", "break", class_run, 1);
|
add_com_alias ("bre", break_cmd, class_run, 1);
|
||||||
add_com_alias ("brea", "break", class_run, 1);
|
add_com_alias ("brea", break_cmd, class_run, 1);
|
||||||
|
|
||||||
if (dbx_commands)
|
if (dbx_commands)
|
||||||
{
|
{
|
||||||
|
@ -16006,17 +16011,18 @@ hardware.)"),
|
||||||
|
|
||||||
/* Tracepoint manipulation commands. */
|
/* Tracepoint manipulation commands. */
|
||||||
|
|
||||||
c = add_com ("trace", class_breakpoint, trace_command, _("\
|
cmd_list_element *trace_cmd
|
||||||
|
= add_com ("trace", class_breakpoint, trace_command, _("\
|
||||||
Set a tracepoint at specified location.\n\
|
Set a tracepoint at specified location.\n\
|
||||||
\n"
|
\n"
|
||||||
BREAK_ARGS_HELP ("trace") "\n\
|
BREAK_ARGS_HELP ("trace") "\n\
|
||||||
Do \"help tracepoints\" for info on other tracepoint commands."));
|
Do \"help tracepoints\" for info on other tracepoint commands."));
|
||||||
set_cmd_completer (c, location_completer);
|
set_cmd_completer (trace_cmd, location_completer);
|
||||||
|
|
||||||
add_com_alias ("tp", "trace", class_breakpoint, 0);
|
add_com_alias ("tp", trace_cmd, class_breakpoint, 0);
|
||||||
add_com_alias ("tr", "trace", class_breakpoint, 1);
|
add_com_alias ("tr", trace_cmd, class_breakpoint, 1);
|
||||||
add_com_alias ("tra", "trace", class_breakpoint, 1);
|
add_com_alias ("tra", trace_cmd, class_breakpoint, 1);
|
||||||
add_com_alias ("trac", "trace", class_breakpoint, 1);
|
add_com_alias ("trac", trace_cmd, class_breakpoint, 1);
|
||||||
|
|
||||||
c = add_com ("ftrace", class_breakpoint, ftrace_command, _("\
|
c = add_com ("ftrace", class_breakpoint, ftrace_command, _("\
|
||||||
Set a fast tracepoint at specified location.\n\
|
Set a fast tracepoint at specified location.\n\
|
||||||
|
@ -16094,13 +16100,14 @@ session to restore them."),
|
||||||
&save_cmdlist);
|
&save_cmdlist);
|
||||||
set_cmd_completer (c, filename_completer);
|
set_cmd_completer (c, filename_completer);
|
||||||
|
|
||||||
c = add_cmd ("tracepoints", class_trace, save_tracepoints_command, _("\
|
cmd_list_element *save_tracepoints_cmd
|
||||||
|
= add_cmd ("tracepoints", class_trace, save_tracepoints_command, _("\
|
||||||
Save current tracepoint definitions as a script.\n\
|
Save current tracepoint definitions as a script.\n\
|
||||||
Use the 'source' command in another debug session to restore them."),
|
Use the 'source' command in another debug session to restore them."),
|
||||||
&save_cmdlist);
|
&save_cmdlist);
|
||||||
set_cmd_completer (c, filename_completer);
|
set_cmd_completer (save_tracepoints_cmd, filename_completer);
|
||||||
|
|
||||||
c = add_com_alias ("save-tracepoints", "save tracepoints", class_trace, 0);
|
c = add_com_alias ("save-tracepoints", save_tracepoints_cmd, class_trace, 0);
|
||||||
deprecate_cmd (c, "save tracepoints");
|
deprecate_cmd (c, "save tracepoints");
|
||||||
|
|
||||||
add_basic_prefix_cmd ("breakpoint", class_maintenance, _("\
|
add_basic_prefix_cmd ("breakpoint", class_maintenance, _("\
|
||||||
|
|
|
@ -1750,19 +1750,20 @@ argv_to_string (char **argv, int n)
|
||||||
and the user would expect bbb to execute 'backtrace -full -past-main'
|
and the user would expect bbb to execute 'backtrace -full -past-main'
|
||||||
while it will execute 'backtrace -past-main'. */
|
while it will execute 'backtrace -past-main'. */
|
||||||
|
|
||||||
static void
|
static cmd_list_element *
|
||||||
validate_aliased_command (const char *command)
|
validate_aliased_command (const char *command)
|
||||||
{
|
{
|
||||||
struct cmd_list_element *c;
|
|
||||||
std::string default_args;
|
std::string default_args;
|
||||||
|
cmd_list_element *c
|
||||||
c = lookup_cmd_1 (& command, cmdlist, NULL, &default_args, 1);
|
= lookup_cmd_1 (& command, cmdlist, NULL, &default_args, 1);
|
||||||
|
|
||||||
if (c == NULL || c == (struct cmd_list_element *) -1)
|
if (c == NULL || c == (struct cmd_list_element *) -1)
|
||||||
error (_("Invalid command to alias to: %s"), command);
|
error (_("Invalid command to alias to: %s"), command);
|
||||||
|
|
||||||
if (!default_args.empty ())
|
if (!default_args.empty ())
|
||||||
error (_("Cannot define an alias of an alias that has default args"));
|
error (_("Cannot define an alias of an alias that has default args"));
|
||||||
|
|
||||||
|
return c;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Called when "alias" was incorrectly used. */
|
/* Called when "alias" was incorrectly used. */
|
||||||
|
@ -1832,7 +1833,7 @@ alias_command (const char *args, int from_tty)
|
||||||
std::string command_string (argv_to_string (command_argv.get (),
|
std::string command_string (argv_to_string (command_argv.get (),
|
||||||
command_argc));
|
command_argc));
|
||||||
command = command_string.c_str ();
|
command = command_string.c_str ();
|
||||||
validate_aliased_command (command);
|
cmd_list_element *target_cmd = validate_aliased_command (command);
|
||||||
|
|
||||||
/* ALIAS must not exist. */
|
/* ALIAS must not exist. */
|
||||||
std::string alias_string (argv_to_string (alias_argv, alias_argc));
|
std::string alias_string (argv_to_string (alias_argv, alias_argc));
|
||||||
|
@ -1875,8 +1876,8 @@ alias_command (const char *args, int from_tty)
|
||||||
if (alias_argc == 1)
|
if (alias_argc == 1)
|
||||||
{
|
{
|
||||||
/* add_cmd requires *we* allocate space for name, hence the xstrdup. */
|
/* add_cmd requires *we* allocate space for name, hence the xstrdup. */
|
||||||
alias_cmd = add_com_alias (xstrdup (alias_argv[0]), command, class_alias,
|
alias_cmd = add_com_alias (xstrdup (alias_argv[0]), target_cmd,
|
||||||
a_opts.abbrev_flag);
|
class_alias, a_opts.abbrev_flag);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -2332,16 +2333,18 @@ strict == evaluate script according to filename extension, error if not supporte
|
||||||
show_script_ext_mode,
|
show_script_ext_mode,
|
||||||
&setlist, &showlist);
|
&setlist, &showlist);
|
||||||
|
|
||||||
add_com ("quit", class_support, quit_command, _("\
|
cmd_list_element *quit_cmd
|
||||||
|
= add_com ("quit", class_support, quit_command, _("\
|
||||||
Exit gdb.\n\
|
Exit gdb.\n\
|
||||||
Usage: quit [EXPR]\n\
|
Usage: quit [EXPR]\n\
|
||||||
The optional expression EXPR, if present, is evaluated and the result\n\
|
The optional expression EXPR, if present, is evaluated and the result\n\
|
||||||
used as GDB's exit code. The default is zero."));
|
used as GDB's exit code. The default is zero."));
|
||||||
c = add_com ("help", class_support, help_command,
|
cmd_list_element *help_cmd
|
||||||
|
= add_com ("help", class_support, help_command,
|
||||||
_("Print list of commands."));
|
_("Print list of commands."));
|
||||||
set_cmd_completer (c, command_completer);
|
set_cmd_completer (help_cmd, command_completer);
|
||||||
add_com_alias ("q", "quit", class_support, 1);
|
add_com_alias ("q", quit_cmd, class_support, 1);
|
||||||
add_com_alias ("h", "help", class_support, 1);
|
add_com_alias ("h", help_cmd, class_support, 1);
|
||||||
|
|
||||||
add_setshow_boolean_cmd ("verbose", class_support, &info_verbose, _("\
|
add_setshow_boolean_cmd ("verbose", class_support, &info_verbose, _("\
|
||||||
Set verbosity."), _("\
|
Set verbosity."), _("\
|
||||||
|
@ -2365,11 +2368,12 @@ Without an argument, history expansion is enabled."),
|
||||||
show_history_expansion_p,
|
show_history_expansion_p,
|
||||||
&sethistlist, &showhistlist);
|
&sethistlist, &showhistlist);
|
||||||
|
|
||||||
add_prefix_cmd ("info", class_info, info_command, _("\
|
cmd_list_element *info_cmd
|
||||||
|
= add_prefix_cmd ("info", class_info, info_command, _("\
|
||||||
Generic command for showing things about the program being debugged."),
|
Generic command for showing things about the program being debugged."),
|
||||||
&infolist, 0, &cmdlist);
|
&infolist, 0, &cmdlist);
|
||||||
add_com_alias ("i", "info", class_info, 1);
|
add_com_alias ("i", info_cmd, class_info, 1);
|
||||||
add_com_alias ("inf", "info", class_info, 1);
|
add_com_alias ("inf", info_cmd, class_info, 1);
|
||||||
|
|
||||||
add_com ("complete", class_obscure, complete_command,
|
add_com ("complete", class_obscure, complete_command,
|
||||||
_("List the completions for the rest of the line as a command."));
|
_("List the completions for the rest of the line as a command."));
|
||||||
|
@ -2380,7 +2384,8 @@ Generic command for showing things about the debugger."),
|
||||||
/* Another way to get at the same thing. */
|
/* Another way to get at the same thing. */
|
||||||
add_alias_cmd ("set", c, class_info, 0, &infolist);
|
add_alias_cmd ("set", c, class_info, 0, &infolist);
|
||||||
|
|
||||||
c = add_com ("with", class_vars, with_command, _("\
|
cmd_list_element *with_cmd
|
||||||
|
= add_com ("with", class_vars, with_command, _("\
|
||||||
Temporarily set SETTING to VALUE, run COMMAND, and restore SETTING.\n\
|
Temporarily set SETTING to VALUE, run COMMAND, and restore SETTING.\n\
|
||||||
Usage: with SETTING [VALUE] [-- COMMAND]\n\
|
Usage: with SETTING [VALUE] [-- COMMAND]\n\
|
||||||
Usage: w SETTING [VALUE] [-- COMMAND]\n\
|
Usage: w SETTING [VALUE] [-- COMMAND]\n\
|
||||||
|
@ -2394,8 +2399,8 @@ E.g.:\n\
|
||||||
You can change multiple settings using nested with, and use\n\
|
You can change multiple settings using nested with, and use\n\
|
||||||
abbreviations for commands and/or values. E.g.:\n\
|
abbreviations for commands and/or values. E.g.:\n\
|
||||||
w la p -- w p el u -- p obj"));
|
w la p -- w p el u -- p obj"));
|
||||||
set_cmd_completer_handle_brkchars (c, with_command_completer);
|
set_cmd_completer_handle_brkchars (with_cmd, with_command_completer);
|
||||||
add_com_alias ("w", "with", class_vars, 1);
|
add_com_alias ("w", with_cmd, class_vars, 1);
|
||||||
|
|
||||||
add_internal_function ("_gdb_setting_str", _("\
|
add_internal_function ("_gdb_setting_str", _("\
|
||||||
$_gdb_setting_str - returns the value of a GDB setting as a string.\n\
|
$_gdb_setting_str - returns the value of a GDB setting as a string.\n\
|
||||||
|
@ -2455,12 +2460,13 @@ the previous command number shown."),
|
||||||
_("Generic command for showing gdb debugging flags."),
|
_("Generic command for showing gdb debugging flags."),
|
||||||
&showdebuglist, 0, &showlist);
|
&showdebuglist, 0, &showlist);
|
||||||
|
|
||||||
c = add_com ("shell", class_support, shell_command, _("\
|
cmd_list_element *shell_cmd
|
||||||
|
= add_com ("shell", class_support, shell_command, _("\
|
||||||
Execute the rest of the line as a shell command.\n\
|
Execute the rest of the line as a shell command.\n\
|
||||||
With no arguments, run an inferior shell."));
|
With no arguments, run an inferior shell."));
|
||||||
set_cmd_completer (c, filename_completer);
|
set_cmd_completer (shell_cmd, filename_completer);
|
||||||
|
|
||||||
add_com_alias ("!", "shell", class_support, 0);
|
add_com_alias ("!", shell_cmd, class_support, 0);
|
||||||
|
|
||||||
c = add_com ("edit", class_files, edit_command, _("\
|
c = add_com ("edit", class_files, edit_command, _("\
|
||||||
Edit specified file or function.\n\
|
Edit specified file or function.\n\
|
||||||
|
@ -2474,7 +2480,8 @@ Uses EDITOR environment variable contents as editor (or ex as default)."));
|
||||||
|
|
||||||
c->completer = location_completer;
|
c->completer = location_completer;
|
||||||
|
|
||||||
c = add_com ("pipe", class_support, pipe_command, _("\
|
cmd_list_element *pipe_cmd
|
||||||
|
= add_com ("pipe", class_support, pipe_command, _("\
|
||||||
Send the output of a gdb command to a shell command.\n\
|
Send the output of a gdb command to a shell command.\n\
|
||||||
Usage: | [COMMAND] | SHELL_COMMAND\n\
|
Usage: | [COMMAND] | SHELL_COMMAND\n\
|
||||||
Usage: | -d DELIM COMMAND DELIM SHELL_COMMAND\n\
|
Usage: | -d DELIM COMMAND DELIM SHELL_COMMAND\n\
|
||||||
|
@ -2489,10 +2496,11 @@ case COMMAND contains a | character.\n\
|
||||||
\n\
|
\n\
|
||||||
With no COMMAND, repeat the last executed command\n\
|
With no COMMAND, repeat the last executed command\n\
|
||||||
and send its output to SHELL_COMMAND."));
|
and send its output to SHELL_COMMAND."));
|
||||||
set_cmd_completer_handle_brkchars (c, pipe_command_completer);
|
set_cmd_completer_handle_brkchars (pipe_cmd, pipe_command_completer);
|
||||||
add_com_alias ("|", "pipe", class_support, 0);
|
add_com_alias ("|", pipe_cmd, class_support, 0);
|
||||||
|
|
||||||
add_com ("list", class_files, list_command, _("\
|
cmd_list_element *list_cmd
|
||||||
|
= add_com ("list", class_files, list_command, _("\
|
||||||
List specified function or line.\n\
|
List specified function or line.\n\
|
||||||
With no argument, lists ten more lines after or around previous listing.\n\
|
With no argument, lists ten more lines after or around previous listing.\n\
|
||||||
\"list -\" lists the ten lines before a previous ten-line listing.\n\
|
\"list -\" lists the ten lines before a previous ten-line listing.\n\
|
||||||
|
@ -2511,10 +2519,10 @@ By default, when a single location is given, display ten lines.\n\
|
||||||
This can be changed using \"set listsize\", and the current value\n\
|
This can be changed using \"set listsize\", and the current value\n\
|
||||||
can be shown using \"show listsize\"."));
|
can be shown using \"show listsize\"."));
|
||||||
|
|
||||||
add_com_alias ("l", "list", class_files, 1);
|
add_com_alias ("l", list_cmd, class_files, 1);
|
||||||
|
|
||||||
if (dbx_commands)
|
if (dbx_commands)
|
||||||
add_com_alias ("file", "list", class_files, 1);
|
add_com_alias ("file", list_cmd, class_files, 1);
|
||||||
|
|
||||||
c = add_com ("disassemble", class_vars, disassemble_command, _("\
|
c = add_com ("disassemble", class_vars, disassemble_command, _("\
|
||||||
Disassemble a specified section of memory.\n\
|
Disassemble a specified section of memory.\n\
|
||||||
|
|
|
@ -1007,11 +1007,11 @@ add_com (const char *name, enum command_class theclass,
|
||||||
different of class_alias, as class_alias is used to identify
|
different of class_alias, as class_alias is used to identify
|
||||||
user defined aliases. */
|
user defined aliases. */
|
||||||
|
|
||||||
struct cmd_list_element *
|
cmd_list_element *
|
||||||
add_com_alias (const char *name, const char *target_name,
|
add_com_alias (const char *name, cmd_list_element *target,
|
||||||
command_class theclass, int abbrev_flag)
|
command_class theclass, int abbrev_flag)
|
||||||
{
|
{
|
||||||
return add_alias_cmd (name, target_name, theclass, abbrev_flag, &cmdlist);
|
return add_alias_cmd (name, target, theclass, abbrev_flag, &cmdlist);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Add an element with a suppress notification to the list of commands. */
|
/* Add an element with a suppress notification to the list of commands. */
|
||||||
|
|
|
@ -359,8 +359,10 @@ extern struct cmd_list_element *add_com (const char *, enum command_class,
|
||||||
cmd_const_cfunc_ftype *fun,
|
cmd_const_cfunc_ftype *fun,
|
||||||
const char *);
|
const char *);
|
||||||
|
|
||||||
extern struct cmd_list_element *add_com_alias (const char *, const char *,
|
extern cmd_list_element *add_com_alias (const char *name,
|
||||||
enum command_class, int);
|
cmd_list_element *target,
|
||||||
|
command_class theclass,
|
||||||
|
int abbrev_flag);
|
||||||
|
|
||||||
extern struct cmd_list_element *add_com_suppress_notification
|
extern struct cmd_list_element *add_com_suppress_notification
|
||||||
(const char *name, enum command_class theclass,
|
(const char *name, enum command_class theclass,
|
||||||
|
|
|
@ -931,7 +931,7 @@ _initialize_compile ()
|
||||||
compile_command, _("\
|
compile_command, _("\
|
||||||
Command to compile source code and inject it into the inferior."),
|
Command to compile source code and inject it into the inferior."),
|
||||||
&compile_command_list, 1, &cmdlist);
|
&compile_command_list, 1, &cmdlist);
|
||||||
add_com_alias ("expression", "compile", class_obscure, 0);
|
add_com_alias ("expression", compile_cmd_element, class_obscure, 0);
|
||||||
|
|
||||||
const auto compile_opts = make_compile_options_def_group (nullptr);
|
const auto compile_opts = make_compile_options_def_group (nullptr);
|
||||||
|
|
||||||
|
|
|
@ -604,10 +604,11 @@ void _initialize_gcore ();
|
||||||
void
|
void
|
||||||
_initialize_gcore ()
|
_initialize_gcore ()
|
||||||
{
|
{
|
||||||
add_com ("generate-core-file", class_files, gcore_command, _("\
|
cmd_list_element *generate_core_file_cmd
|
||||||
|
= add_com ("generate-core-file", class_files, gcore_command, _("\
|
||||||
Save a core file with the current state of the debugged process.\n\
|
Save a core file with the current state of the debugged process.\n\
|
||||||
Usage: generate-core-file [FILENAME]\n\
|
Usage: generate-core-file [FILENAME]\n\
|
||||||
Argument is optional filename. Default filename is 'core.PROCESS_ID'."));
|
Argument is optional filename. Default filename is 'core.PROCESS_ID'."));
|
||||||
|
|
||||||
add_com_alias ("gcore", "generate-core-file", class_files, 1);
|
add_com_alias ("gcore", generate_core_file_cmd, class_files, 1);
|
||||||
}
|
}
|
||||||
|
|
|
@ -726,8 +726,8 @@ cmd_list_element *guile_cmd_element = nullptr;
|
||||||
static void
|
static void
|
||||||
install_gdb_commands (void)
|
install_gdb_commands (void)
|
||||||
{
|
{
|
||||||
add_com ("guile-repl", class_obscure,
|
cmd_list_element *guile_repl_cmd
|
||||||
guile_repl_command,
|
= add_com ("guile-repl", class_obscure, guile_repl_command,
|
||||||
#ifdef HAVE_GUILE
|
#ifdef HAVE_GUILE
|
||||||
_("\
|
_("\
|
||||||
Start an interactive Guile prompt.\n\
|
Start an interactive Guile prompt.\n\
|
||||||
|
@ -742,7 +742,7 @@ Guile scripting is not supported in this copy of GDB.\n\
|
||||||
This command is only a placeholder.")
|
This command is only a placeholder.")
|
||||||
#endif /* HAVE_GUILE */
|
#endif /* HAVE_GUILE */
|
||||||
);
|
);
|
||||||
add_com_alias ("gr", "guile-repl", class_obscure, 1);
|
add_com_alias ("gr", guile_repl_cmd, class_obscure, 1);
|
||||||
|
|
||||||
/* Since "help guile" is easy to type, and intuitive, we add general help
|
/* Since "help guile" is easy to type, and intuitive, we add general help
|
||||||
in using GDB+Guile to this command. */
|
in using GDB+Guile to this command. */
|
||||||
|
@ -778,7 +778,7 @@ Guile scripting is not supported in this copy of GDB.\n\
|
||||||
This command is only a placeholder.")
|
This command is only a placeholder.")
|
||||||
#endif /* HAVE_GUILE */
|
#endif /* HAVE_GUILE */
|
||||||
);
|
);
|
||||||
add_com_alias ("gu", "guile", class_obscure, 1);
|
add_com_alias ("gu", guile_cmd_element, class_obscure, 1);
|
||||||
|
|
||||||
add_basic_prefix_cmd ("guile", class_obscure,
|
add_basic_prefix_cmd ("guile", class_obscure,
|
||||||
_("Prefix command for Guile preference settings."),
|
_("Prefix command for Guile preference settings."),
|
||||||
|
|
53
gdb/infcmd.c
53
gdb/infcmd.c
|
@ -3174,48 +3174,54 @@ In a multi-threaded program the signal is queued with, or discarded from,\n\
|
||||||
the current thread only."));
|
the current thread only."));
|
||||||
set_cmd_completer (c, signal_completer);
|
set_cmd_completer (c, signal_completer);
|
||||||
|
|
||||||
add_com ("stepi", class_run, stepi_command, _("\
|
cmd_list_element *stepi_cmd
|
||||||
|
= add_com ("stepi", class_run, stepi_command, _("\
|
||||||
Step one instruction exactly.\n\
|
Step one instruction exactly.\n\
|
||||||
Usage: stepi [N]\n\
|
Usage: stepi [N]\n\
|
||||||
Argument N means step N times (or till program stops for another \
|
Argument N means step N times (or till program stops for another \
|
||||||
reason)."));
|
reason)."));
|
||||||
add_com_alias ("si", "stepi", class_run, 0);
|
add_com_alias ("si", stepi_cmd, class_run, 0);
|
||||||
|
|
||||||
add_com ("nexti", class_run, nexti_command, _("\
|
cmd_list_element *nexti_cmd
|
||||||
|
= add_com ("nexti", class_run, nexti_command, _("\
|
||||||
Step one instruction, but proceed through subroutine calls.\n\
|
Step one instruction, but proceed through subroutine calls.\n\
|
||||||
Usage: nexti [N]\n\
|
Usage: nexti [N]\n\
|
||||||
Argument N means step N times (or till program stops for another \
|
Argument N means step N times (or till program stops for another \
|
||||||
reason)."));
|
reason)."));
|
||||||
add_com_alias ("ni", "nexti", class_run, 0);
|
add_com_alias ("ni", nexti_cmd, class_run, 0);
|
||||||
|
|
||||||
add_com ("finish", class_run, finish_command, _("\
|
cmd_list_element *finish_cmd
|
||||||
|
= add_com ("finish", class_run, finish_command, _("\
|
||||||
Execute until selected stack frame returns.\n\
|
Execute until selected stack frame returns.\n\
|
||||||
Usage: finish\n\
|
Usage: finish\n\
|
||||||
Upon return, the value returned is printed and put in the value history."));
|
Upon return, the value returned is printed and put in the value history."));
|
||||||
add_com_alias ("fin", "finish", class_run, 1);
|
add_com_alias ("fin", finish_cmd, class_run, 1);
|
||||||
|
|
||||||
add_com ("next", class_run, next_command, _("\
|
cmd_list_element *next_cmd
|
||||||
|
= add_com ("next", class_run, next_command, _("\
|
||||||
Step program, proceeding through subroutine calls.\n\
|
Step program, proceeding through subroutine calls.\n\
|
||||||
Usage: next [N]\n\
|
Usage: next [N]\n\
|
||||||
Unlike \"step\", if the current source line calls a subroutine,\n\
|
Unlike \"step\", if the current source line calls a subroutine,\n\
|
||||||
this command does not enter the subroutine, but instead steps over\n\
|
this command does not enter the subroutine, but instead steps over\n\
|
||||||
the call, in effect treating it as a single source line."));
|
the call, in effect treating it as a single source line."));
|
||||||
add_com_alias ("n", "next", class_run, 1);
|
add_com_alias ("n", next_cmd, class_run, 1);
|
||||||
|
|
||||||
add_com ("step", class_run, step_command, _("\
|
cmd_list_element *step_cmd
|
||||||
|
= add_com ("step", class_run, step_command, _("\
|
||||||
Step program until it reaches a different source line.\n\
|
Step program until it reaches a different source line.\n\
|
||||||
Usage: step [N]\n\
|
Usage: step [N]\n\
|
||||||
Argument N means step N times (or till program stops for another \
|
Argument N means step N times (or till program stops for another \
|
||||||
reason)."));
|
reason)."));
|
||||||
add_com_alias ("s", "step", class_run, 1);
|
add_com_alias ("s", step_cmd, class_run, 1);
|
||||||
|
|
||||||
c = add_com ("until", class_run, until_command, _("\
|
cmd_list_element *until_cmd
|
||||||
|
= add_com ("until", class_run, until_command, _("\
|
||||||
Execute until past the current line or past a LOCATION.\n\
|
Execute until past the current line or past a LOCATION.\n\
|
||||||
Execute until the program reaches a source line greater than the current\n\
|
Execute until the program reaches a source line greater than the current\n\
|
||||||
or a specified location (same args as break command) within the current \
|
or a specified location (same args as break command) within the current \
|
||||||
frame."));
|
frame."));
|
||||||
set_cmd_completer (c, location_completer);
|
set_cmd_completer (until_cmd, location_completer);
|
||||||
add_com_alias ("u", "until", class_run, 1);
|
add_com_alias ("u", until_cmd, class_run, 1);
|
||||||
|
|
||||||
c = add_com ("advance", class_run, advance_command, _("\
|
c = add_com ("advance", class_run, advance_command, _("\
|
||||||
Continue the program up to the given location (same form as args for break \
|
Continue the program up to the given location (same form as args for break \
|
||||||
|
@ -3223,15 +3229,17 @@ command).\n\
|
||||||
Execution will also stop upon exit from the current stack frame."));
|
Execution will also stop upon exit from the current stack frame."));
|
||||||
set_cmd_completer (c, location_completer);
|
set_cmd_completer (c, location_completer);
|
||||||
|
|
||||||
c = add_com ("jump", class_run, jump_command, _("\
|
cmd_list_element *jump_cmd
|
||||||
|
= add_com ("jump", class_run, jump_command, _("\
|
||||||
Continue program being debugged at specified line or address.\n\
|
Continue program being debugged at specified line or address.\n\
|
||||||
Usage: jump LOCATION\n\
|
Usage: jump LOCATION\n\
|
||||||
Give as argument either LINENUM or *ADDR, where ADDR is an expression\n\
|
Give as argument either LINENUM or *ADDR, where ADDR is an expression\n\
|
||||||
for an address to start at."));
|
for an address to start at."));
|
||||||
set_cmd_completer (c, location_completer);
|
set_cmd_completer (jump_cmd, location_completer);
|
||||||
add_com_alias ("j", "jump", class_run, 1);
|
add_com_alias ("j", jump_cmd, class_run, 1);
|
||||||
|
|
||||||
add_com ("continue", class_run, continue_command, _("\
|
cmd_list_element *continue_cmd
|
||||||
|
= add_com ("continue", class_run, continue_command, _("\
|
||||||
Continue program being debugged, after signal or breakpoint.\n\
|
Continue program being debugged, after signal or breakpoint.\n\
|
||||||
Usage: continue [N]\n\
|
Usage: continue [N]\n\
|
||||||
If proceeding from breakpoint, a number N may be used as an argument,\n\
|
If proceeding from breakpoint, a number N may be used as an argument,\n\
|
||||||
|
@ -3242,14 +3250,15 @@ If non-stop mode is enabled, continue only the current thread,\n\
|
||||||
otherwise all the threads in the program are continued. To \n\
|
otherwise all the threads in the program are continued. To \n\
|
||||||
continue all stopped threads in non-stop mode, use the -a option.\n\
|
continue all stopped threads in non-stop mode, use the -a option.\n\
|
||||||
Specifying -a and an ignore count simultaneously is an error."));
|
Specifying -a and an ignore count simultaneously is an error."));
|
||||||
add_com_alias ("c", "cont", class_run, 1);
|
add_com_alias ("c", continue_cmd, class_run, 1);
|
||||||
add_com_alias ("fg", "cont", class_run, 1);
|
add_com_alias ("fg", continue_cmd, class_run, 1);
|
||||||
|
|
||||||
c = add_com ("run", class_run, run_command, _("\
|
cmd_list_element *run_cmd
|
||||||
|
= add_com ("run", class_run, run_command, _("\
|
||||||
Start debugged program.\n"
|
Start debugged program.\n"
|
||||||
RUN_ARGS_HELP));
|
RUN_ARGS_HELP));
|
||||||
set_cmd_completer (c, filename_completer);
|
set_cmd_completer (run_cmd, filename_completer);
|
||||||
add_com_alias ("r", "run", class_run, 1);
|
add_com_alias ("r", run_cmd, class_run, 1);
|
||||||
|
|
||||||
c = add_com ("start", class_run, start_command, _("\
|
c = add_com ("start", class_run, start_command, _("\
|
||||||
Start the debugged program stopping at the beginning of the main procedure.\n"
|
Start the debugged program stopping at the beginning of the main procedure.\n"
|
||||||
|
|
|
@ -1133,14 +1133,15 @@ _initialize_maint_cmds ()
|
||||||
{
|
{
|
||||||
struct cmd_list_element *cmd;
|
struct cmd_list_element *cmd;
|
||||||
|
|
||||||
add_basic_prefix_cmd ("maintenance", class_maintenance, _("\
|
cmd_list_element *maintenance_cmd
|
||||||
|
= add_basic_prefix_cmd ("maintenance", class_maintenance, _("\
|
||||||
Commands for use by GDB maintainers.\n\
|
Commands for use by GDB maintainers.\n\
|
||||||
Includes commands to dump specific internal GDB structures in\n\
|
Includes commands to dump specific internal GDB structures in\n\
|
||||||
a human readable form, to cause GDB to deliberately dump core, etc."),
|
a human readable form, to cause GDB to deliberately dump core, etc."),
|
||||||
&maintenancelist, 0,
|
&maintenancelist, 0,
|
||||||
&cmdlist);
|
&cmdlist);
|
||||||
|
|
||||||
add_com_alias ("mt", "maintenance", class_maintenance, 1);
|
add_com_alias ("mt", maintenance_cmd, class_maintenance, 1);
|
||||||
|
|
||||||
add_basic_prefix_cmd ("info", class_maintenance, _("\
|
add_basic_prefix_cmd ("info", class_maintenance, _("\
|
||||||
Commands for showing internal info about the program being debugged."),
|
Commands for showing internal info about the program being debugged."),
|
||||||
|
|
|
@ -1319,9 +1319,10 @@ _initialize_objc_language ()
|
||||||
_("All Objective-C selectors, or those matching REGEXP."));
|
_("All Objective-C selectors, or those matching REGEXP."));
|
||||||
add_info ("classes", info_classes_command,
|
add_info ("classes", info_classes_command,
|
||||||
_("All Objective-C classes, or those matching REGEXP."));
|
_("All Objective-C classes, or those matching REGEXP."));
|
||||||
add_com ("print-object", class_vars, print_object_command,
|
cmd_list_element *print_object_cmd
|
||||||
|
= add_com ("print-object", class_vars, print_object_command,
|
||||||
_("Ask an Objective-C object to print itself."));
|
_("Ask an Objective-C object to print itself."));
|
||||||
add_com_alias ("po", "print-object", class_vars, 1);
|
add_com_alias ("po", print_object_cmd, class_vars, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
|
@ -3351,10 +3351,11 @@ EXP may be preceded with /FMT, where FMT is a format letter\n\
|
||||||
but no count or size letter (see \"x\" command)."),
|
but no count or size letter (see \"x\" command)."),
|
||||||
print_opts);
|
print_opts);
|
||||||
|
|
||||||
c = add_com ("print", class_vars, print_command, print_help.c_str ());
|
cmd_list_element *print_cmd
|
||||||
set_cmd_completer_handle_brkchars (c, print_command_completer);
|
= add_com ("print", class_vars, print_command, print_help.c_str ());
|
||||||
add_com_alias ("p", "print", class_vars, 1);
|
set_cmd_completer_handle_brkchars (print_cmd, print_command_completer);
|
||||||
add_com_alias ("inspect", "print", class_vars, 1);
|
add_com_alias ("p", print_cmd, class_vars, 1);
|
||||||
|
add_com_alias ("inspect", print_cmd, class_vars, 1);
|
||||||
|
|
||||||
add_setshow_uinteger_cmd ("max-symbolic-offset", no_class,
|
add_setshow_uinteger_cmd ("max-symbolic-offset", no_class,
|
||||||
&max_symbolic_offset, _("\
|
&max_symbolic_offset, _("\
|
||||||
|
|
|
@ -1886,7 +1886,8 @@ void _initialize_python ();
|
||||||
void
|
void
|
||||||
_initialize_python ()
|
_initialize_python ()
|
||||||
{
|
{
|
||||||
add_com ("python-interactive", class_obscure,
|
cmd_list_element *python_interactive_cmd
|
||||||
|
= add_com ("python-interactive", class_obscure,
|
||||||
python_interactive_command,
|
python_interactive_command,
|
||||||
#ifdef HAVE_PYTHON
|
#ifdef HAVE_PYTHON
|
||||||
_("\
|
_("\
|
||||||
|
@ -1909,7 +1910,7 @@ Python scripting is not supported in this copy of GDB.\n\
|
||||||
This command is only a placeholder.")
|
This command is only a placeholder.")
|
||||||
#endif /* HAVE_PYTHON */
|
#endif /* HAVE_PYTHON */
|
||||||
);
|
);
|
||||||
add_com_alias ("pi", "python-interactive", class_obscure, 1);
|
add_com_alias ("pi", python_interactive_cmd, class_obscure, 1);
|
||||||
|
|
||||||
python_cmd_element = add_com ("python", class_obscure, python_command,
|
python_cmd_element = add_com ("python", class_obscure, python_command,
|
||||||
#ifdef HAVE_PYTHON
|
#ifdef HAVE_PYTHON
|
||||||
|
@ -1931,7 +1932,7 @@ Python scripting is not supported in this copy of GDB.\n\
|
||||||
This command is only a placeholder.")
|
This command is only a placeholder.")
|
||||||
#endif /* HAVE_PYTHON */
|
#endif /* HAVE_PYTHON */
|
||||||
);
|
);
|
||||||
add_com_alias ("py", "python", class_obscure, 1);
|
add_com_alias ("py", python_cmd_element, class_obscure, 1);
|
||||||
|
|
||||||
/* Add set/show python print-stack. */
|
/* Add set/show python print-stack. */
|
||||||
add_basic_prefix_cmd ("python", no_class,
|
add_basic_prefix_cmd ("python", no_class,
|
||||||
|
|
|
@ -785,12 +785,13 @@ A size of \"unlimited\" means unlimited lines. The default is 10."),
|
||||||
set_record_call_history_size, NULL,
|
set_record_call_history_size, NULL,
|
||||||
&set_record_cmdlist, &show_record_cmdlist);
|
&set_record_cmdlist, &show_record_cmdlist);
|
||||||
|
|
||||||
c = add_prefix_cmd ("record", class_obscure, cmd_record_start,
|
cmd_list_element *record_cmd
|
||||||
|
= add_prefix_cmd ("record", class_obscure, cmd_record_start,
|
||||||
_("Start recording."),
|
_("Start recording."),
|
||||||
&record_cmdlist, 0, &cmdlist);
|
&record_cmdlist, 0, &cmdlist);
|
||||||
set_cmd_completer (c, filename_completer);
|
set_cmd_completer (record_cmd, filename_completer);
|
||||||
|
|
||||||
add_com_alias ("rec", "record", class_obscure, 1);
|
add_com_alias ("rec", record_cmd, class_obscure, 1);
|
||||||
add_basic_prefix_cmd ("record", class_support,
|
add_basic_prefix_cmd ("record", class_support,
|
||||||
_("Set record options."), &set_record_cmdlist,
|
_("Set record options."), &set_record_cmdlist,
|
||||||
0, &setlist);
|
0, &setlist);
|
||||||
|
|
|
@ -2092,10 +2092,11 @@ _initialize_regcache ()
|
||||||
gdb::observers::thread_ptid_changed.attach (regcache_thread_ptid_changed,
|
gdb::observers::thread_ptid_changed.attach (regcache_thread_ptid_changed,
|
||||||
"regcache");
|
"regcache");
|
||||||
|
|
||||||
add_cmd ("register-cache", class_maintenance, reg_flush_command,
|
cmd_list_element *maintenance_flush_register_cache_cmd
|
||||||
|
= add_cmd ("register-cache", class_maintenance, reg_flush_command,
|
||||||
_("Force gdb to flush its register and frame cache."),
|
_("Force gdb to flush its register and frame cache."),
|
||||||
&maintenanceflushlist);
|
&maintenanceflushlist);
|
||||||
c = add_com_alias ("flushregs", "maintenance flush register-cache",
|
c = add_com_alias ("flushregs", maintenance_flush_register_cache_cmd,
|
||||||
class_maintenance, 0);
|
class_maintenance, 0);
|
||||||
deprecate_cmd (c, "maintenance flush register-cache");
|
deprecate_cmd (c, "maintenance flush register-cache");
|
||||||
|
|
||||||
|
|
|
@ -326,38 +326,39 @@ void _initialize_reverse ();
|
||||||
void
|
void
|
||||||
_initialize_reverse ()
|
_initialize_reverse ()
|
||||||
{
|
{
|
||||||
add_com ("reverse-step", class_run, reverse_step, _("\
|
cmd_list_element *reverse_step_cmd
|
||||||
|
= add_com ("reverse-step", class_run, reverse_step, _("\
|
||||||
Step program backward until it reaches the beginning of another source line.\n\
|
Step program backward until it reaches the beginning of another source line.\n\
|
||||||
Argument N means do this N times (or till program stops for another reason).")
|
Argument N means do this N times (or till program stops for another reason)."));
|
||||||
);
|
add_com_alias ("rs", reverse_step_cmd, class_run, 1);
|
||||||
add_com_alias ("rs", "reverse-step", class_run, 1);
|
|
||||||
|
|
||||||
add_com ("reverse-next", class_run, reverse_next, _("\
|
cmd_list_element *reverse_next_cmd
|
||||||
|
= add_com ("reverse-next", class_run, reverse_next, _("\
|
||||||
Step program backward, proceeding through subroutine calls.\n\
|
Step program backward, proceeding through subroutine calls.\n\
|
||||||
Like the \"reverse-step\" command as long as subroutine calls do not happen;\n\
|
Like the \"reverse-step\" command as long as subroutine calls do not happen;\n\
|
||||||
when they do, the call is treated as one instruction.\n\
|
when they do, the call is treated as one instruction.\n\
|
||||||
Argument N means do this N times (or till program stops for another reason).")
|
Argument N means do this N times (or till program stops for another reason)."));
|
||||||
);
|
add_com_alias ("rn", reverse_next_cmd, class_run, 1);
|
||||||
add_com_alias ("rn", "reverse-next", class_run, 1);
|
|
||||||
|
|
||||||
add_com ("reverse-stepi", class_run, reverse_stepi, _("\
|
cmd_list_element *reverse_stepi_cmd
|
||||||
|
= add_com ("reverse-stepi", class_run, reverse_stepi, _("\
|
||||||
Step backward exactly one instruction.\n\
|
Step backward exactly one instruction.\n\
|
||||||
Argument N means do this N times (or till program stops for another reason).")
|
Argument N means do this N times (or till program stops for another reason)."));
|
||||||
);
|
add_com_alias ("rsi", reverse_stepi_cmd, class_run, 0);
|
||||||
add_com_alias ("rsi", "reverse-stepi", class_run, 0);
|
|
||||||
|
|
||||||
add_com ("reverse-nexti", class_run, reverse_nexti, _("\
|
cmd_list_element *reverse_nexti_cmd
|
||||||
|
= add_com ("reverse-nexti", class_run, reverse_nexti, _("\
|
||||||
Step backward one instruction, but proceed through called subroutines.\n\
|
Step backward one instruction, but proceed through called subroutines.\n\
|
||||||
Argument N means do this N times (or till program stops for another reason).")
|
Argument N means do this N times (or till program stops for another reason)."));
|
||||||
);
|
add_com_alias ("rni", reverse_nexti_cmd, class_run, 0);
|
||||||
add_com_alias ("rni", "reverse-nexti", class_run, 0);
|
|
||||||
|
|
||||||
add_com ("reverse-continue", class_run, reverse_continue, _("\
|
cmd_list_element *reverse_continue_cmd
|
||||||
|
= add_com ("reverse-continue", class_run, reverse_continue, _("\
|
||||||
Continue program being debugged but run it in reverse.\n\
|
Continue program being debugged but run it in reverse.\n\
|
||||||
If proceeding from breakpoint, a number N may be used as an argument,\n\
|
If proceeding from breakpoint, a number N may be used as an argument,\n\
|
||||||
which means to set the ignore count of that breakpoint to N - 1 (so that\n\
|
which means to set the ignore count of that breakpoint to N - 1 (so that\n\
|
||||||
the breakpoint won't break until the Nth time it is reached)."));
|
the breakpoint won't break until the Nth time it is reached)."));
|
||||||
add_com_alias ("rc", "reverse-continue", class_run, 0);
|
add_com_alias ("rc", reverse_continue_cmd, class_run, 0);
|
||||||
|
|
||||||
add_com ("reverse-finish", class_run, reverse_finish, _("\
|
add_com ("reverse-finish", class_run, reverse_finish, _("\
|
||||||
Execute backward until just before selected stack frame is called."));
|
Execute backward until just before selected stack frame is called."));
|
||||||
|
|
21
gdb/source.c
21
gdb/source.c
|
@ -1904,8 +1904,6 @@ void _initialize_source ();
|
||||||
void
|
void
|
||||||
_initialize_source ()
|
_initialize_source ()
|
||||||
{
|
{
|
||||||
struct cmd_list_element *c;
|
|
||||||
|
|
||||||
init_source_path ();
|
init_source_path ();
|
||||||
|
|
||||||
/* The intention is to use POSIX Basic Regular Expressions.
|
/* The intention is to use POSIX Basic Regular Expressions.
|
||||||
|
@ -1914,7 +1912,8 @@ _initialize_source ()
|
||||||
just an approximation. */
|
just an approximation. */
|
||||||
re_set_syntax (RE_SYNTAX_GREP);
|
re_set_syntax (RE_SYNTAX_GREP);
|
||||||
|
|
||||||
c = add_cmd ("directory", class_files, directory_command, _("\
|
cmd_list_element *directory_cmd
|
||||||
|
= add_cmd ("directory", class_files, directory_command, _("\
|
||||||
Add directory DIR to beginning of search path for source files.\n\
|
Add directory DIR to beginning of search path for source files.\n\
|
||||||
Forget cached info on source file locations and line positions.\n\
|
Forget cached info on source file locations and line positions.\n\
|
||||||
DIR can also be $cwd for the current working directory, or $cdir for the\n\
|
DIR can also be $cwd for the current working directory, or $cdir for the\n\
|
||||||
|
@ -1923,9 +1922,9 @@ With no argument, reset the search path to $cdir:$cwd, the default."),
|
||||||
&cmdlist);
|
&cmdlist);
|
||||||
|
|
||||||
if (dbx_commands)
|
if (dbx_commands)
|
||||||
add_com_alias ("use", "directory", class_files, 0);
|
add_com_alias ("use", directory_cmd, class_files, 0);
|
||||||
|
|
||||||
set_cmd_completer (c, filename_completer);
|
set_cmd_completer (directory_cmd, filename_completer);
|
||||||
|
|
||||||
add_setshow_optional_filename_cmd ("directories",
|
add_setshow_optional_filename_cmd ("directories",
|
||||||
class_files,
|
class_files,
|
||||||
|
@ -1959,16 +1958,18 @@ This sets the default address for \"x\" to the line's first instruction\n\
|
||||||
so that \"x/i\" suffices to start examining the machine code.\n\
|
so that \"x/i\" suffices to start examining the machine code.\n\
|
||||||
The address is also stored as the value of \"$_\"."));
|
The address is also stored as the value of \"$_\"."));
|
||||||
|
|
||||||
add_com ("forward-search", class_files, forward_search_command, _("\
|
cmd_list_element *forward_search_cmd
|
||||||
|
= add_com ("forward-search", class_files, forward_search_command, _("\
|
||||||
Search for regular expression (see regex(3)) from last line listed.\n\
|
Search for regular expression (see regex(3)) from last line listed.\n\
|
||||||
The matching line number is also stored as the value of \"$_\"."));
|
The matching line number is also stored as the value of \"$_\"."));
|
||||||
add_com_alias ("search", "forward-search", class_files, 0);
|
add_com_alias ("search", forward_search_cmd, class_files, 0);
|
||||||
add_com_alias ("fo", "forward-search", class_files, 1);
|
add_com_alias ("fo", forward_search_cmd, class_files, 1);
|
||||||
|
|
||||||
add_com ("reverse-search", class_files, reverse_search_command, _("\
|
cmd_list_element *reverse_search_cmd
|
||||||
|
= add_com ("reverse-search", class_files, reverse_search_command, _("\
|
||||||
Search backward for regular expression (see regex(3)) from last line listed.\n\
|
Search backward for regular expression (see regex(3)) from last line listed.\n\
|
||||||
The matching line number is also stored as the value of \"$_\"."));
|
The matching line number is also stored as the value of \"$_\"."));
|
||||||
add_com_alias ("rev", "reverse-search", class_files, 1);
|
add_com_alias ("rev", reverse_search_cmd, class_files, 1);
|
||||||
|
|
||||||
add_setshow_integer_cmd ("listsize", class_support, &lines_to_list, _("\
|
add_setshow_integer_cmd ("listsize", class_support, &lines_to_list, _("\
|
||||||
Set number of source lines gdb will list by default."), _("\
|
Set number of source lines gdb will list by default."), _("\
|
||||||
|
|
22
gdb/stack.c
22
gdb/stack.c
|
@ -3329,22 +3329,24 @@ An argument says how many frames up to go."));
|
||||||
Same as the `up' command, but does not print anything.\n\
|
Same as the `up' command, but does not print anything.\n\
|
||||||
This is useful in command scripts."));
|
This is useful in command scripts."));
|
||||||
|
|
||||||
add_com ("down", class_stack, down_command, _("\
|
cmd_list_element *down_cmd
|
||||||
|
= add_com ("down", class_stack, down_command, _("\
|
||||||
Select and print stack frame called by this one.\n\
|
Select and print stack frame called by this one.\n\
|
||||||
An argument says how many frames down to go."));
|
An argument says how many frames down to go."));
|
||||||
add_com_alias ("do", "down", class_stack, 1);
|
add_com_alias ("do", down_cmd, class_stack, 1);
|
||||||
add_com_alias ("dow", "down", class_stack, 1);
|
add_com_alias ("dow", down_cmd, class_stack, 1);
|
||||||
add_com ("down-silently", class_support, down_silently_command, _("\
|
add_com ("down-silently", class_support, down_silently_command, _("\
|
||||||
Same as the `down' command, but does not print anything.\n\
|
Same as the `down' command, but does not print anything.\n\
|
||||||
This is useful in command scripts."));
|
This is useful in command scripts."));
|
||||||
|
|
||||||
add_prefix_cmd ("frame", class_stack,
|
cmd_list_element *frame_cmd_el
|
||||||
|
= add_prefix_cmd ("frame", class_stack,
|
||||||
&frame_cmd.base_command, _("\
|
&frame_cmd.base_command, _("\
|
||||||
Select and print a stack frame.\n\
|
Select and print a stack frame.\n\
|
||||||
With no argument, print the selected stack frame. (See also \"info frame\").\n\
|
With no argument, print the selected stack frame. (See also \"info frame\").\n\
|
||||||
A single numerical argument specifies the frame to select."),
|
A single numerical argument specifies the frame to select."),
|
||||||
&frame_cmd_list, 1, &cmdlist);
|
&frame_cmd_list, 1, &cmdlist);
|
||||||
add_com_alias ("f", "frame", class_stack, 1);
|
add_com_alias ("f", frame_cmd_el, class_stack, 1);
|
||||||
|
|
||||||
#define FRAME_APPLY_OPTION_HELP "\
|
#define FRAME_APPLY_OPTION_HELP "\
|
||||||
Prints the frame location information followed by COMMAND output.\n\
|
Prints the frame location information followed by COMMAND output.\n\
|
||||||
|
@ -3498,14 +3500,14 @@ For backward compatibility, the following qualifiers are supported:\n\
|
||||||
With a negative COUNT, print outermost -COUNT frames."),
|
With a negative COUNT, print outermost -COUNT frames."),
|
||||||
backtrace_opts);
|
backtrace_opts);
|
||||||
|
|
||||||
cmd_list_element *c = add_com ("backtrace", class_stack,
|
cmd_list_element *backtrace_cmd
|
||||||
backtrace_command,
|
= add_com ("backtrace", class_stack, backtrace_command,
|
||||||
backtrace_help.c_str ());
|
backtrace_help.c_str ());
|
||||||
set_cmd_completer_handle_brkchars (c, backtrace_command_completer);
|
set_cmd_completer_handle_brkchars (backtrace_cmd, backtrace_command_completer);
|
||||||
|
|
||||||
add_com_alias ("bt", "backtrace", class_stack, 0);
|
add_com_alias ("bt", backtrace_cmd, class_stack, 0);
|
||||||
|
|
||||||
add_com_alias ("where", "backtrace", class_stack, 0);
|
add_com_alias ("where", backtrace_cmd, class_stack, 0);
|
||||||
add_info ("stack", backtrace_command,
|
add_info ("stack", backtrace_command,
|
||||||
_("Backtrace of the stack, or innermost COUNT frames."));
|
_("Backtrace of the stack, or innermost COUNT frames."));
|
||||||
add_info_alias ("s", "stack", 1);
|
add_info_alias ("s", "stack", 1);
|
||||||
|
|
|
@ -3863,12 +3863,13 @@ When OFFSET is provided, FILE must also be provided. FILE can be provided\n\
|
||||||
on its own."), &cmdlist);
|
on its own."), &cmdlist);
|
||||||
set_cmd_completer (c, filename_completer);
|
set_cmd_completer (c, filename_completer);
|
||||||
|
|
||||||
add_basic_prefix_cmd ("overlay", class_support,
|
cmd_list_element *overlay_cmd
|
||||||
|
= add_basic_prefix_cmd ("overlay", class_support,
|
||||||
_("Commands for debugging overlays."), &overlaylist,
|
_("Commands for debugging overlays."), &overlaylist,
|
||||||
0, &cmdlist);
|
0, &cmdlist);
|
||||||
|
|
||||||
add_com_alias ("ovly", "overlay", class_support, 1);
|
add_com_alias ("ovly", overlay_cmd, class_support, 1);
|
||||||
add_com_alias ("ov", "overlay", class_support, 1);
|
add_com_alias ("ov", overlay_cmd, class_support, 1);
|
||||||
|
|
||||||
add_cmd ("map-overlay", class_support, map_overlay_command,
|
add_cmd ("map-overlay", class_support, map_overlay_command,
|
||||||
_("Assert that an overlay section is mapped."), &overlaylist);
|
_("Assert that an overlay section is mapped."), &overlaylist);
|
||||||
|
|
|
@ -2133,11 +2133,14 @@ Options:\n\
|
||||||
c = add_info ("threads", info_threads_command, info_threads_help.c_str ());
|
c = add_info ("threads", info_threads_command, info_threads_help.c_str ());
|
||||||
set_cmd_completer_handle_brkchars (c, info_threads_command_completer);
|
set_cmd_completer_handle_brkchars (c, info_threads_command_completer);
|
||||||
|
|
||||||
add_prefix_cmd ("thread", class_run, thread_command, _("\
|
cmd_list_element *thread_cmd
|
||||||
|
= add_prefix_cmd ("thread", class_run, thread_command, _("\
|
||||||
Use this command to switch between threads.\n\
|
Use this command to switch between threads.\n\
|
||||||
The new thread ID must be currently known."),
|
The new thread ID must be currently known."),
|
||||||
&thread_cmd_list, 1, &cmdlist);
|
&thread_cmd_list, 1, &cmdlist);
|
||||||
|
|
||||||
|
add_com_alias ("t", thread_cmd, class_run, 1);
|
||||||
|
|
||||||
#define THREAD_APPLY_OPTION_HELP "\
|
#define THREAD_APPLY_OPTION_HELP "\
|
||||||
Prints per-inferior thread number and target system's thread id\n\
|
Prints per-inferior thread number and target system's thread id\n\
|
||||||
followed by COMMAND output.\n\
|
followed by COMMAND output.\n\
|
||||||
|
@ -2203,8 +2206,6 @@ Usage: thread find REGEXP\n\
|
||||||
Will display thread ids whose name, target ID, or extra info matches REGEXP."),
|
Will display thread ids whose name, target ID, or extra info matches REGEXP."),
|
||||||
&thread_cmd_list);
|
&thread_cmd_list);
|
||||||
|
|
||||||
add_com_alias ("t", "thread", class_run, 1);
|
|
||||||
|
|
||||||
add_setshow_boolean_cmd ("thread-events", no_class,
|
add_setshow_boolean_cmd ("thread-events", no_class,
|
||||||
&print_thread_events, _("\
|
&print_thread_events, _("\
|
||||||
Set printing of thread events (such as thread start and exit)."), _("\
|
Set printing of thread events (such as thread start and exit)."), _("\
|
||||||
|
|
|
@ -4116,8 +4116,8 @@ one or more \"collect\" commands, to specify what to collect\n\
|
||||||
while single-stepping.\n\n\
|
while single-stepping.\n\n\
|
||||||
Note: this command can only be used in a tracepoint \"actions\" list."));
|
Note: this command can only be used in a tracepoint \"actions\" list."));
|
||||||
|
|
||||||
add_com_alias ("ws", "while-stepping", class_trace, 0);
|
add_com_alias ("ws", while_stepping_cmd_element, class_trace, 0);
|
||||||
add_com_alias ("stepping", "while-stepping", class_trace, 0);
|
add_com_alias ("stepping", while_stepping_cmd_element, class_trace, 0);
|
||||||
|
|
||||||
add_com ("collect", class_trace, collect_pseudocommand, _("\
|
add_com ("collect", class_trace, collect_pseudocommand, _("\
|
||||||
Specify one or more data items to be collected at a tracepoint.\n\
|
Specify one or more data items to be collected at a tracepoint.\n\
|
||||||
|
|
|
@ -990,7 +990,6 @@ _initialize_tui_win ()
|
||||||
{
|
{
|
||||||
static struct cmd_list_element *tui_setlist;
|
static struct cmd_list_element *tui_setlist;
|
||||||
static struct cmd_list_element *tui_showlist;
|
static struct cmd_list_element *tui_showlist;
|
||||||
struct cmd_list_element *cmd;
|
|
||||||
|
|
||||||
/* Define the classes of commands.
|
/* Define the classes of commands.
|
||||||
They will appear in the help list in the reverse of this order. */
|
They will appear in the help list in the reverse of this order. */
|
||||||
|
@ -1004,26 +1003,29 @@ _initialize_tui_win ()
|
||||||
add_com ("refresh", class_tui, tui_refresh_all_command,
|
add_com ("refresh", class_tui, tui_refresh_all_command,
|
||||||
_("Refresh the terminal display."));
|
_("Refresh the terminal display."));
|
||||||
|
|
||||||
cmd = add_com ("tabset", class_tui, tui_set_tab_width_command, _("\
|
cmd_list_element *tabset_cmd
|
||||||
|
= add_com ("tabset", class_tui, tui_set_tab_width_command, _("\
|
||||||
Set the width (in characters) of tab stops.\n\
|
Set the width (in characters) of tab stops.\n\
|
||||||
Usage: tabset N"));
|
Usage: tabset N"));
|
||||||
deprecate_cmd (cmd, "set tui tab-width");
|
deprecate_cmd (tabset_cmd, "set tui tab-width");
|
||||||
|
|
||||||
cmd = add_com ("winheight", class_tui, tui_set_win_height_command, _("\
|
cmd_list_element *winheight_cmd
|
||||||
|
= add_com ("winheight", class_tui, tui_set_win_height_command, _("\
|
||||||
Set or modify the height of a specified window.\n\
|
Set or modify the height of a specified window.\n\
|
||||||
Usage: winheight WINDOW-NAME [+ | -] NUM-LINES\n\
|
Usage: winheight WINDOW-NAME [+ | -] NUM-LINES\n\
|
||||||
Use \"info win\" to see the names of the windows currently being displayed."));
|
Use \"info win\" to see the names of the windows currently being displayed."));
|
||||||
add_com_alias ("wh", "winheight", class_tui, 0);
|
add_com_alias ("wh", winheight_cmd, class_tui, 0);
|
||||||
set_cmd_completer (cmd, winheight_completer);
|
set_cmd_completer (winheight_cmd, winheight_completer);
|
||||||
add_info ("win", tui_all_windows_info,
|
add_info ("win", tui_all_windows_info,
|
||||||
_("List of all displayed windows.\n\
|
_("List of all displayed windows.\n\
|
||||||
Usage: info win"));
|
Usage: info win"));
|
||||||
cmd = add_com ("focus", class_tui, tui_set_focus_command, _("\
|
cmd_list_element *focus_cmd
|
||||||
|
= add_com ("focus", class_tui, tui_set_focus_command, _("\
|
||||||
Set focus to named window or next/prev window.\n\
|
Set focus to named window or next/prev window.\n\
|
||||||
Usage: focus [WINDOW-NAME | next | prev]\n\
|
Usage: focus [WINDOW-NAME | next | prev]\n\
|
||||||
Use \"info win\" to see the names of the windows currently being displayed."));
|
Use \"info win\" to see the names of the windows currently being displayed."));
|
||||||
add_com_alias ("fs", "focus", class_tui, 0);
|
add_com_alias ("fs", focus_cmd, class_tui, 0);
|
||||||
set_cmd_completer (cmd, focus_completer);
|
set_cmd_completer (focus_cmd, focus_completer);
|
||||||
add_com ("+", class_tui, tui_scroll_forward_command, _("\
|
add_com ("+", class_tui, tui_scroll_forward_command, _("\
|
||||||
Scroll window forward.\n\
|
Scroll window forward.\n\
|
||||||
Usage: + [N] [WIN]\n\
|
Usage: + [N] [WIN]\n\
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue