diff options
author | Stephane Carrez <stcarrez@nerim.fr> | 2012-11-10 12:25:02 +0000 |
---|---|---|
committer | Stephane Carrez <stcarrez@nerim.fr> | 2012-11-10 12:25:02 +0000 |
commit | 1ee58a290e0656014f80b5978aeae58f641cb000 (patch) | |
tree | ff9bcecb9d9c541bc1cf267516728181920b06df /gdb/tui/tui.c | |
parent | ef406d638c34cc1e08af5dd3cce0a956acc973f6 (diff) | |
download | gdb-1ee58a290e0656014f80b5978aeae58f641cb000.tar.gz |
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/tui/tui.c')
-rw-r--r-- | gdb/tui/tui.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/gdb/tui/tui.c b/gdb/tui/tui.c index 9ef3c309e3b..3e79b322336 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; } } |