summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>2005-04-05 17:53:05 +0000
committerMark Mitchell <mark@codesourcery.com>2005-04-05 17:53:05 +0000
commit163189b4694fd3af5e09472c0b985b1240724ad7 (patch)
treedd2932894804e5e96dc1e843f47433eccd031105
parentf431c67c50915ccb250dd3c5b2097a86d92268bb (diff)
downloadgdb-163189b4694fd3af5e09472c0b985b1240724ad7.tar.gz
* 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.
-rw-r--r--ChangeLog.csl12
-rw-r--r--gdb/event-top.c19
-rw-r--r--gdb/ser-tcp.c4
-rw-r--r--readline/input.c7
4 files changed, 21 insertions, 21 deletions
diff --git a/ChangeLog.csl b/ChangeLog.csl
index 115621dd069..1b63fb3fbc3 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 f65c98b9572..4614d4d2f4c 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 f8b6d2eb100..3ff15413e83 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 841f05d1af9..feef459205c 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))