diff options
-rw-r--r-- | ChangeLog.csl | 12 | ||||
-rw-r--r-- | gdb/event-top.c | 19 | ||||
-rw-r--r-- | gdb/ser-tcp.c | 4 | ||||
-rw-r--r-- | readline/input.c | 7 |
4 files changed, 21 insertions, 21 deletions
diff --git a/ChangeLog.csl b/ChangeLog.csl index 115621d..1b63fb3 100644 --- a/ChangeLog.csl +++ b/ChangeLog.csl @@ -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. diff --git a/gdb/event-top.c b/gdb/event-top.c index f65c98b..4614d4d 100644 --- a/gdb/event-top.c +++ b/gdb/event-top.c @@ -40,11 +40,6 @@ #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 { diff --git a/gdb/ser-tcp.c b/gdb/ser-tcp.c index f8b6d2e..3ff1541 100644 --- a/gdb/ser-tcp.c +++ b/gdb/ser-tcp.c @@ -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 diff --git a/readline/input.c b/readline/input.c index 841f05d..feef459 100644 --- a/readline/input.c +++ b/readline/input.c @@ -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)) |