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

Unified Diff: gdb/tui/tui-hooks.c

Issue 11969036: Merge GDB 7.5.1 (Closed) Base URL: http://git.chromium.org/native_client/nacl-gdb.git@master
Patch Set: Created 7 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-data.c ('k') | gdb/tui/tui-main.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gdb/tui/tui-hooks.c
diff --git a/gdb/tui/tui-hooks.c b/gdb/tui/tui-hooks.c
index 17a95937c107489b3af8b18336ecafdc96a8badc..4d1e06346f4244bfd0f548733be7baa531a8847a 100644
--- a/gdb/tui/tui-hooks.c
+++ b/gdb/tui/tui-hooks.c
@@ -69,6 +69,13 @@ tui_query_hook (const char *msg, va_list argp)
int retval;
int ans2;
int answer;
+ char *question;
+ struct cleanup *old_chain;
+
+ /* Format the question outside of the loop, to avoid reusing
+ ARGP. */
+ question = xstrvprintf (msg, argp);
+ old_chain = make_cleanup (xfree, question);
echo ();
while (1)
@@ -76,7 +83,7 @@ tui_query_hook (const char *msg, va_list argp)
wrap_here (""); /* Flush any buffered output. */
gdb_flush (gdb_stdout);
- vfprintf_filtered (gdb_stdout, msg, argp);
+ fputs_filtered (question, gdb_stdout);
printf_filtered (_("(y or n) "));
wrap_here ("");
@@ -113,6 +120,8 @@ tui_query_hook (const char *msg, va_list argp)
printf_filtered (_("Please answer y or n.\n"));
}
noecho ();
+
+ do_cleanups (old_chain);
return retval;
}
« no previous file with comments | « gdb/tui/tui-data.c ('k') | gdb/tui/tui-main.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698