aboutsummaryrefslogtreecommitdiff
path: root/gdb/command.h
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2017-10-12 08:27:21 -0600
committerTom Tromey <tom@tromey.com>2017-11-07 13:59:09 -0700
commit85c4be7c83b80acf647e6ffcaed0f0cdbcb8c3eb (patch)
treee5beb6ee1907869e987937ee92538274d0fa560d /gdb/command.h
parent022643b4456ee13752b0f3a8411238ab8c53bf6d (diff)
downloadgdb-85c4be7c83b80acf647e6ffcaed0f0cdbcb8c3eb.zip
gdb-85c4be7c83b80acf647e6ffcaed0f0cdbcb8c3eb.tar.gz
gdb-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/command.h')
-rw-r--r--gdb/command.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/gdb/command.h b/gdb/command.h
index a995445..63c7658 100644
--- a/gdb/command.h
+++ b/gdb/command.h
@@ -445,6 +445,11 @@ extern void dont_repeat (void);
extern scoped_restore_tmpl<int> prevent_dont_repeat (void);
+/* Set the arguments that will be passed if the current command is
+ repeated. Note that the passed-in string must be a constant. */
+
+extern void set_repeat_arguments (const char *args);
+
/* Used to mark commands that don't do anything. If we just leave the
function field NULL, the command is interpreted as a help topic, or
as a class of commands. */