Implement event-loop glue for gdbserver
authorTom Tromey <tom@tromey.com>
Mon, 13 Apr 2020 18:42:59 +0000 (12:42 -0600)
committerTom Tromey <tromey@adacore.com>
Mon, 13 Apr 2020 20:10:04 +0000 (14:10 -0600)
event-loop.c requires the client to provide some functions.  This
patch implements these functions for gdbserver.

gdbserver/ChangeLog
2020-04-13  Tom Tromey  <tom@tromey.com>

* server.c (invoke_async_signal_handlers)
(check_async_event_handlers, flush_streams, gdb_select): New
functions.

gdbserver/ChangeLog
gdbserver/server.cc

index b5c428a5b8841158ff845e13783765b612713f89..309cae3d70124c55e6d4c904f0d2d32ffa077496 100644 (file)
@@ -1,3 +1,9 @@
+2020-04-13  Tom Tromey  <tom@tromey.com>
+
+       * server.c (invoke_async_signal_handlers)
+       (check_async_event_handlers, flush_streams, gdb_select): New
+       functions.
+
 2020-04-13  Tom Tromey  <tom@tromey.com>
 
        * configure: Rebuild.
index 43962adc86c456c72a7a57aa8afe68cb8e5ff4ce..ac7a7fd75aa2cc4962d2c740dc96adafdd65040d 100644 (file)
@@ -47,6 +47,7 @@
 
 #include "gdbsupport/selftest.h"
 #include "gdbsupport/scope-exit.h"
+#include "gdbsupport/gdb_select.h"
 
 #define require_running_or_return(BUF)         \
   if (!target_running ())                      \
@@ -4477,6 +4478,40 @@ handle_target_event (int err, gdb_client_data client_data)
   return 0;
 }
 
+/* See gdbsupport/event-loop.h.  */
+
+int
+invoke_async_signal_handlers ()
+{
+  return 0;
+}
+
+/* See gdbsupport/event-loop.h.  */
+
+int
+check_async_event_handlers ()
+{
+  return 0;
+}
+
+/* See gdbsupport/errors.h  */
+
+void
+flush_streams ()
+{
+  fflush (stdout);
+  fflush (stderr);
+}
+
+/* See gdbsupport/gdb_select.h.  */
+
+int
+gdb_select (int n, fd_set *readfds, fd_set *writefds,
+           fd_set *exceptfds, struct timeval *timeout)
+{
+  return select (n, readfds, writefds, exceptfds, timeout);
+}
+
 #if GDB_SELF_TEST
 namespace selftests
 {