diff options
author | Tom Tromey <tom@tromey.com> | 2017-10-12 08:27:21 -0600 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2017-11-07 13:59:09 -0700 |
commit | 85c4be7c83b80acf647e6ffcaed0f0cdbcb8c3eb (patch) | |
tree | e5beb6ee1907869e987937ee92538274d0fa560d /gdb/cli | |
parent | 022643b4456ee13752b0f3a8411238ab8c53bf6d (diff) | |
download | binutils-85c4be7c83b80acf647e6ffcaed0f0cdbcb8c3eb.zip binutils-85c4be7c83b80acf647e6ffcaed0f0cdbcb8c3eb.tar.gz binutils-85c4be7c83b80acf647e6ffcaed0f0cdbcb8c3eb.tar.bz2 |
Add set_repeat_arguments function
The "x", "list", and "show commands" commands have special repetition
behavior: repeating the command doesn't re-run it with the same
arguments
This is currently implemented by modifying the passed-in argument; but
that won't work properly with const arguments (and seems pretty
obscure besides).
This patch adds a new "set_repeat_arguments" function and changes the
relevant places to call it.
gdb/ChangeLog
2017-11-07 Tom Tromey <tom@tromey.com>
* printcmd.c (x_command): Call set_repeat_arguments.
* cli/cli-cmds.c (list_command): Call set_repeat_arguments.
* top.c (repeat_arguments): New global.
(set_repeat_arguments): New function.
(execute_command): Handle repeat_arguments.
(show_commands): Calls set_repeat_arguments.
* command.h (set_repeat_arguments): Declare.
Diffstat (limited to 'gdb/cli')
-rw-r--r-- | gdb/cli/cli-cmds.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gdb/cli/cli-cmds.c b/gdb/cli/cli-cmds.c index a1c308a..a8edb13 100644 --- a/gdb/cli/cli-cmds.c +++ b/gdb/cli/cli-cmds.c @@ -1082,7 +1082,7 @@ list_command (char *arg, int from_tty) turn it into the no-arg variant. */ if (from_tty) - *arg = 0; + set_repeat_arguments (""); if (dummy_beg && sal_end.symtab == 0) error (_("No default source file yet. Do \"help list\".")); |