diff options
author | Stephane Carrez <stcarrez@nerim.fr> | 2012-11-10 12:25:07 +0000 |
---|---|---|
committer | Stephane Carrez <stcarrez@nerim.fr> | 2012-11-10 12:25:07 +0000 |
commit | e840f632eb1879fd022f88ab1e2f5ce3a41d3cbe (patch) | |
tree | f297f9eb957641129a62017406e88f6cd97f2993 /gdb | |
parent | 9014f8246333be644269f9976373b896fcf8b50f (diff) | |
download | gdb-e840f632eb1879fd022f88ab1e2f5ce3a41d3cbe.zip gdb-e840f632eb1879fd022f88ab1e2f5ce3a41d3cbe.tar.gz gdb-e840f632eb1879fd022f88ab1e2f5ce3a41d3cbe.tar.bz2 |
PR tui/9584
* tui/tui.c (tui_rl_command_key): Do not call execute_command
but insert the command to execute in readline's buffer.
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/ChangeLog | 7 | ||||
-rw-r--r-- | gdb/tui/tui.c | 13 |
2 files changed, 14 insertions, 6 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 661985c..e85145b 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,10 @@ +2012-11-10 Stephane Carrez <Stephane.Carrez@gmail.com> + + PR tui/9584 + + * tui/tui.c (tui_rl_command_key): Do not call execute_command + but insert the command to execute in readline's buffer. + 2012-11-09 Tom Tromey <tromey@redhat.com> * gdbarch.sh (target_gdbarch): Remove macro. diff --git a/gdb/tui/tui.c b/gdb/tui/tui.c index 9ef3c30..3e79b32 100644 --- a/gdb/tui/tui.c +++ b/gdb/tui/tui.c @@ -240,12 +240,13 @@ tui_rl_command_key (int count, int key) { if (tui_commands[i].key == key) { - /* Must save the command because it can be modified by - execute_command. */ - char *cmd = alloca (strlen (tui_commands[i].cmd) + 1); - - strcpy (cmd, tui_commands[i].cmd); - execute_command (cmd, TRUE); + /* Insert the command in the readline buffer. + Avoid calling the gdb command here since it creates + a possible recursion on readline if prompt_for_continue + is called (See PR 9584). The command will also appear + in the readline history which turns out to be better. */ + rl_insert_text (tui_commands[i].cmd); + rl_newline (1, '\n'); return 0; } } |