]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
* gdb/ser-tcp.c (net_write_prim): Correct prototype.
authorMark Mitchell <mark@codesourcery.com>
Tue, 5 Apr 2005 17:53:05 +0000 (17:53 +0000)
committerMark Mitchell <mark@codesourcery.com>
Tue, 5 Apr 2005 17:53:05 +0000 (17:53 +0000)
* readline/input.c (rl_getc): Use getche to read console input on
Windows.

Revert:
2005-03-28  Mark Mitchell  <mark@codesourcery.com>
* gdb/event-top.c (gdb_setup_readline): Put console into
character-at-a-time mode under Windows.

ChangeLog.csl
gdb/event-top.c
gdb/ser-tcp.c
readline/input.c

index 115621dd069469aefcf3d2faebd9c4d3e9557b08..1b63fb3fbc3ce8b98300f7473dc074178d8a2eb3 100644 (file)
@@ -1,3 +1,15 @@
+2005-03-31  Mark Mitchell  <mark@codesourcery.com>
+
+       * gdb/ser-tcp.c (net_write_prim): Correct prototype.
+       
+       * readline/input.c (rl_getc): Use getche to read console input on
+       Windows.
+       
+       Revert:
+       2005-03-28  Mark Mitchell  <mark@codesourcery.com>
+       * gdb/event-top.c (gdb_setup_readline): Put console into
+       character-at-a-time mode under Windows.
+
 2005-03-30  Paul Brook  <paul@codesourcery.com>
 
        * arm/wrapper.c: Provide SIGTRAP and SIGBUS.
index f65c98b9572c27edeb167804deb045b549ed81e0..4614d4d2f4c8af13589f7479821997357c85708d 100644 (file)
 #include "readline/readline.h"
 #include "readline/history.h"
 
-#ifdef __MINGW32__
-#include <windows.h>
-#include <io.h>
-#endif
-
 /* readline defines this.  */
 #undef savestring
 
@@ -1133,20 +1128,6 @@ gdb_setup_readline (void)
       /* 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;
-#ifdef WINAPI
-      /* Set the console to character-at-a-time (as opposed to
-        line-at-a-time) mode.  Otherwise, we will get only a single
-        keyboard event for the entire line, and readline will not
-        see each character as it arrives.  */
-      {
-       DWORD mode;
-       HANDLE console_handle;
-       console_handle = (HANDLE) _get_osfhandle (fileno (instream));
-       GetConsoleMode(console_handle, &mode);
-       mode &= ~ENABLE_LINE_INPUT;
-       SetConsoleMode(console_handle, mode);
-      }
-#endif
     }
   else
     {
index f8b6d2eb100c63f7ca8524a0dbca3bee306df262..3ff15413e836a13ad4787f3c7ff67f7dad3276e8 100644 (file)
@@ -241,9 +241,9 @@ net_read_prim (struct serial *scb, size_t count)
 }
 
 static int
-net_write_prim (struct serial *scb, const char *str, int len)
+net_write_prim (struct serial *scb, const void *buf, size_t count)
 {
-  return send (scb->fd, str, len, 0);
+  return send (scb->fd, buf, count, 0);
 }
 
 void
index 841f05d1af9ccf55a7cae4cc59beee899c6f0e3a..feef459205cd7c0fa6cc39fde6e62f41fb17aed3 100644 (file)
@@ -424,6 +424,13 @@ rl_getc (stream)
 
   while (1)
     {
+#ifdef __MINGW32__
+      /* On Windows, use a special routine to read a single character
+        from the console.  (Otherwise, no characters are available
+        until the user hits the return key.)  */
+      if (isatty (fileno (stream)))
+         return getche ();
+#endif
       result = read (fileno (stream), &c, sizeof (unsigned char));
 
       if (result == sizeof (unsigned char))