aboutsummaryrefslogtreecommitdiff
path: root/gdb/top.h
diff options
context:
space:
mode:
authorPhilippe Waroquiers <philippe.waroquiers@skynet.be>2019-04-20 14:02:29 +0200
committerPhilippe Waroquiers <philippe.waroquiers@skynet.be>2019-05-31 17:10:08 +0200
commit68bb5386b84af4031175bf186269eb6b54b8611d (patch)
treeb3b9b003d4b9f692f2437a7afb86cd4f7efd1869 /gdb/top.h
parenta0486bac41d6ce47f27795a5abbca5cc53ddba00 (diff)
downloadgdb-68bb5386b84af4031175bf186269eb6b54b8611d.zip
gdb-68bb5386b84af4031175bf186269eb6b54b8611d.tar.gz
gdb-68bb5386b84af4031175bf186269eb6b54b8611d.tar.bz2
Add previous_saved_command_line to allow a command to repeat a previous command.
Currently, a previous command can be repeated when the user types an empty line. This is implemented in handle_line_of_input by returning saved_command_line in case an empty line has been input. If we want a command to repeat the previous command, we need to save the previous saved_command_line, as when a command runs, the saved_command_line already contains the current command line of the command being executed. As suggested by Tom, the previous_saved_command_line is made static. At the same time, saved_command_line is also made static. The support functions/variables for the repeat command logic are now all located inside top.c. gdb/ChangeLog 2019-05-31 Philippe Waroquiers <philippe.waroquiers@skynet.be> * top.h (saved_command_line): Remove declaration. * top.c (previous_saved_command_line, previous_repeat_arguments): New variables. (saved_command_line): Make static, define together with other 'repeat variables'. (dont_repeat): Clear repeat_arguments. (repeat_previous, get_saved_command_line, save_command_line): New functions. (gdb_init): Initialize saved_command_line and previous_saved_command_line. * main.c (captured_main_1): Remove saved_command_line initialization. * event-top.c (handle_line_of_input): Update to use the new 'repeat' related functions instead of direct access to saved_command_line. * command.h (repeat_previous, get_saved_command_line, save_command_line): New declarations. (dont_repeat): Add comment.
Diffstat (limited to 'gdb/top.h')
-rw-r--r--gdb/top.h1
1 files changed, 0 insertions, 1 deletions
diff --git a/gdb/top.h b/gdb/top.h
index 025d938..aab03c1 100644
--- a/gdb/top.h
+++ b/gdb/top.h
@@ -217,7 +217,6 @@ extern void ui_register_input_event_handler (struct ui *ui);
extern void ui_unregister_input_event_handler (struct ui *ui);
/* From top.c. */
-extern char *saved_command_line;
extern int confirm;
extern int inhibit_gdbinit;
extern const char gdbinit[];