+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.
#include "readline/readline.h"
#include "readline/history.h"
-#ifdef __MINGW32__
-#include <windows.h>
-#include <io.h>
-#endif
-
/* readline defines this. */
#undef savestring
/* 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
{
}
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
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))