aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2000-03-19 12:30:38 +0000
committerEli Zaretskii <eliz@gnu.org>2000-03-19 12:30:38 +0000
commitc5201926ef9986c74125e31a43a2f8af8d83d604 (patch)
tree643fac56f03ff4b57be5fb6cafdb7fafc75b76bf
parentded59a1e28dc98f0198900bf4c08097f01eb7c6d (diff)
downloadfsf-binutils-gdb-c5201926ef9986c74125e31a43a2f8af8d83d604.zip
fsf-binutils-gdb-c5201926ef9986c74125e31a43a2f8af8d83d604.tar.gz
fsf-binutils-gdb-c5201926ef9986c74125e31a43a2f8af8d83d604.tar.bz2
* event-top.c (_initialize_event_loop): If instream is not
connected to a terminal device, turn editing off.
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/event-top.c27
2 files changed, 24 insertions, 8 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 83676d7..727c0db 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,10 @@
2000-03-19 Eli Zaretskii <eliz@is.elta.co.il>
+ * event-top.c (_initialize_event_loop): If instream is not
+ connected to a terminal device, turn editing off.
+
+2000-03-19 Eli Zaretskii <eliz@is.elta.co.il>
+
Support for building GDB with DJGPP, and running the test suite on
it:
* config/djgpp/djconfig.sh: New file.
diff --git a/gdb/event-top.c b/gdb/event-top.c
index 6122cba..d9a0a7c 100644
--- a/gdb/event-top.c
+++ b/gdb/event-top.c
@@ -1133,9 +1133,25 @@ _initialize_event_loop (void)
{
if (event_loop_p)
{
- /* When a character is detected on instream by select or poll,
- readline will be invoked via this callback function. */
- call_readline = rl_callback_read_char_wrapper;
+ /* If the input stream is connected to a terminal, turn on
+ editing. */
+ if (ISATTY (instream))
+ {
+ /* Tell gdb that we will be using the readline library. This
+ could be overwritten by a command in .gdbinit like 'set
+ editing on' or 'off'. */
+ async_command_editing_p = 1;
+
+ /* When a character is detected on instream by select or
+ poll, readline will be invoked via this callback
+ function. */
+ call_readline = rl_callback_read_char_wrapper;
+ }
+ else
+ {
+ async_command_editing_p = 0;
+ call_readline = gdb_readline2;
+ }
/* When readline has read an end-of-line character, it passes
the complete line to gdb for processing. command_line_handler
@@ -1160,10 +1176,5 @@ _initialize_event_loop (void)
only when it actually exists (I.e. after we say 'run' or
after we connect to a remote target. */
add_file_handler (input_fd, stdin_event_handler, 0);
-
- /* Tell gdb that we will be using the readline library. This
- could be overwritten by a command in .gdbinit like 'set
- editing on' or 'off'. */
- async_command_editing_p = 1;
}
}