Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(818)

Unified Diff: gdb/tui/tui.c

Issue 124383005: GDB 7.6.50 (Closed) Base URL: http://git.chromium.org/native_client/nacl-gdb.git@upstream
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gdb/tui/tui.h ('k') | gdb/tui/tui-command.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gdb/tui/tui.c
diff --git a/gdb/tui/tui.c b/gdb/tui/tui.c
index 9ef3c309e3be6d2eb4c62a28eb48227032965174..27d51576e1b06508dc85fec8e588032fe4b069e4 100644
--- a/gdb/tui/tui.c
+++ b/gdb/tui/tui.c
@@ -1,6 +1,6 @@
/* General functions for the WDB TUI.
- Copyright (C) 1998-2004, 2007-2012 Free Software Foundation, Inc.
+ Copyright (C) 1998-2013 Free Software Foundation, Inc.
Contributed by Hewlett-Packard Company.
@@ -240,12 +240,17 @@ 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');
+
+ /* Switch to gdb command mode while executing the command.
+ This way the gdb's continue prompty will be displayed. */
+ tui_set_key_mode (TUI_ONE_COMMAND_MODE);
return 0;
}
}
@@ -284,7 +289,7 @@ static int
tui_rl_startup_hook (void)
{
rl_already_prompted = 1;
- if (tui_current_key_mode != TUI_COMMAND_MODE)
+ if (tui_current_key_mode != TUI_COMMAND_MODE && immediate_quit == 0)
tui_set_key_mode (TUI_SINGLE_KEY_MODE);
tui_redisplay_readline ();
return 0;
@@ -527,7 +532,7 @@ tui_reset (void)
#endif
void
-tui_show_source (const char *file, int line)
+tui_show_source (const char *fullname, int line)
{
struct symtab_and_line cursal = get_current_source_symtab_and_line ();
@@ -535,7 +540,7 @@ tui_show_source (const char *file, int line)
tui_add_win_to_layout (SRC_WIN);
tui_update_source_windows_with_line (cursal.symtab, line);
- tui_update_locator_filename (file);
+ tui_update_locator_fullname (fullname);
}
void
« no previous file with comments | « gdb/tui/tui.h ('k') | gdb/tui/tui-command.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698