This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH 1/5] [PR gdb/15224] Unify interactivity tests to use input_from_terminal_p:
- From: Muhammad Bilal <mbilal at codesourcery dot com>
- To: "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>
- Cc: Pedro Alves <palves at redhat dot com>, <jan dot kratochvil at redhat dot com>
- Date: Thu, 8 Aug 2013 10:17:58 +0500
- Subject: [PATCH 1/5] [PR gdb/15224] Unify interactivity tests to use input_from_terminal_p:
Currently commands are added to gdb history with out checking the
interactive debugging
In this patch we are performing the interactivity tests to use
input_from_terminal_p.
2013-08-08 Muhammad Bilal <mbilal@codesourcery.com>
PR gdb/15224
* top.c (command_line_input): Unify interactivity tests to use
input_from_terminal_p.
* event-top.c (command_line_input): Likewise.
gdb/event-top.c | 3 +--
gdb/top.c | 3 +--
2 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/gdb/event-top.c b/gdb/event-top.c
index f00ab7d..5f35bac 100644
--- a/gdb/event-top.c
+++ b/gdb/event-top.c
@@ -604,8 +604,7 @@ command_line_handler (char *rl)
*p = 0;
/* Add line to history if appropriate. */
- if (instream == stdin
- && ISATTY (stdin) && *linebuffer)
+ if (*linebuffer && input_from_terminal_p ())
add_history (linebuffer);
/* Note: lines consisting solely of comments are added to the command
diff --git a/gdb/top.c b/gdb/top.c
index 33a78da..b8a743e 100644
--- a/gdb/top.c
+++ b/gdb/top.c
@@ -1073,8 +1073,7 @@ command_line_input (char *prompt_arg, int repeat,
char *annotation_suffix)
*p = 0;
/* Add line to history if appropriate. */
- if (instream == stdin
- && ISATTY (stdin) && *linebuffer)
+ if (*linebuffer && input_from_terminal_p ())
add_history (linebuffer);
/* Note: lines consisting solely of comments are added to the command
Thanks,
-Bilal