This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]