diff options
author | John Hood <cgull@glup.org> | 2016-01-30 17:37:33 -0500 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2016-03-20 15:26:31 +0100 |
commit | 9f82de59a07da145c177648fe474f19cd9def7a1 (patch) | |
tree | f659ec35ec4757cff39490068fe6fd1391dda2c1 | |
parent | 6e70fd315a29578f090a98f84e9d8e95ddb156e3 (diff) | |
download | newlib-9f82de59a07da145c177648fe474f19cd9def7a1.zip newlib-9f82de59a07da145c177648fe474f19cd9def7a1.tar.gz newlib-9f82de59a07da145c177648fe474f19cd9def7a1.tar.bz2 |
Debug printfs.
* fhandler.cc (fhandler_base::get_readahead): Add debug code.
* fhandler_console.cc (fhandler_console::read): Add debug code.
* select.cc (pselect): Add debug code.
(peek_console): Add debug code.
-rw-r--r-- | winsup/cygwin/fhandler.cc | 1 | ||||
-rw-r--r-- | winsup/cygwin/fhandler_console.cc | 10 | ||||
-rw-r--r-- | winsup/cygwin/select.cc | 12 |
3 files changed, 21 insertions, 2 deletions
diff --git a/winsup/cygwin/fhandler.cc b/winsup/cygwin/fhandler.cc index 33743d4..86f77c3 100644 --- a/winsup/cygwin/fhandler.cc +++ b/winsup/cygwin/fhandler.cc @@ -90,6 +90,7 @@ fhandler_base::get_readahead () /* FIXME - not thread safe */ if (raixget >= ralen) raixget = raixput = ralen = 0; + debug_printf("available: %d", chret > -1); return chret; } diff --git a/winsup/cygwin/fhandler_console.cc b/winsup/cygwin/fhandler_console.cc index c510d70..e0e2813 100644 --- a/winsup/cygwin/fhandler_console.cc +++ b/winsup/cygwin/fhandler_console.cc @@ -309,6 +309,8 @@ fhandler_console::read (void *pv, size_t& buflen) int ch; set_input_state (); + debug_printf("requested buflen %d", buflen); + /* Check console read-ahead buffer filled from terminal requests */ if (con.cons_rapoi && *con.cons_rapoi) { @@ -318,6 +320,7 @@ fhandler_console::read (void *pv, size_t& buflen) } int copied_chars = get_readahead_into_buffer (buf, buflen); + debug_printf("copied_chars %d", copied_chars); if (copied_chars) { @@ -695,9 +698,11 @@ fhandler_console::read (void *pv, size_t& buflen) continue; } + debug_printf("toadd = %p, nread = %d", toadd, nread); if (toadd) { - line_edit_status res = line_edit (toadd, nread, ti); + ssize_t bytes_read; + line_edit_status res = line_edit (toadd, nread, ti, &bytes_read); if (res == line_edit_signalled) goto sig_exit; else if (res == line_edit_input_done) @@ -705,6 +710,8 @@ fhandler_console::read (void *pv, size_t& buflen) } } + debug_printf("ralen = %d, bytes = %d", ralen, ralen - raixget); + while (buflen) if ((ch = get_readahead ()) < 0) break; @@ -716,6 +723,7 @@ fhandler_console::read (void *pv, size_t& buflen) #undef buf buflen = copied_chars; + debug_printf("buflen set to %d", buflen); return; err: diff --git a/winsup/cygwin/select.cc b/winsup/cygwin/select.cc index 10205a0..25b0c5a 100644 --- a/winsup/cygwin/select.cc +++ b/winsup/cygwin/select.cc @@ -925,18 +925,28 @@ peek_console (select_record *me, bool) if (irec.Event.KeyEvent.bKeyDown && (irec.Event.KeyEvent.uChar.AsciiChar || fhandler_console::get_nonascii_key (irec, tmpbuf))) - return me->read_ready = true; + { + debug_printf("peeked KEY_EVENT"); + return me->read_ready = true; + } } else { if (irec.EventType == MOUSE_EVENT && fh->mouse_aware (irec.Event.MouseEvent)) + { + debug_printf("peeked MOUSE_EVENT"); return me->read_ready = true; + } if (irec.EventType == FOCUS_EVENT && fh->focus_aware ()) + { + debug_printf("peeked FOCUS_EVENT"); return me->read_ready = true; + } } /* Read and discard the event */ + debug_printf("discarded other event"); ReadConsoleInput (h, &irec, 1, &events_read); } |