public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Tom Tromey <tom@tromey.com>
To: gdb-patches@sourceware.org
Cc: Tom Tromey <tom@tromey.com>
Subject: [PATCH v2 09/12] Implement event-loop glue for gdbserver
Date: Sat, 14 Mar 2020 12:51:55 -0600	[thread overview]
Message-ID: <20200314185158.7816-10-tom@tromey.com> (raw)
In-Reply-To: <20200314185158.7816-1-tom@tromey.com>

event-loop.c requires the client to provide some functions.  This
patch implements these functions for gdbserver.

gdbserver/ChangeLog
2020-03-14  Tom Tromey  <tom@tromey.com>

	* server.c (invoke_async_signal_handlers)
	(check_async_event_handlers, flush_streams, gdb_select): New
	functions.
---
 gdbserver/ChangeLog |  6 ++++++
 gdbserver/server.cc | 35 +++++++++++++++++++++++++++++++++++
 2 files changed, 41 insertions(+)

diff --git a/gdbserver/server.cc b/gdbserver/server.cc
index 43962adc86c..ac7a7fd75aa 100644
--- a/gdbserver/server.cc
+++ b/gdbserver/server.cc
@@ -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
 {
-- 
2.17.2


  parent reply	other threads:[~2020-03-14 18:52 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-14 18:51 [PATCH v2 00/12] Merge event loop implementations Tom Tromey
2020-03-14 18:51 ` [PATCH v2 01/12] Move start_event_loop out of event-loop.c Tom Tromey
2020-03-14 18:51 ` [PATCH v2 02/12] Move event-loop configury to common.m4 Tom Tromey
2020-03-14 18:51 ` [PATCH v2 03/12] Move gdb_select.h to gdbsupport/ Tom Tromey
2020-03-14 18:51 ` [PATCH v2 04/12] Include <chrono> in event-loop.c Tom Tromey
2020-03-14 18:51 ` [PATCH v2 05/12] Use warning in event-loop Tom Tromey
2020-03-14 18:51 ` [PATCH v2 06/12] Introduce and use flush_streams Tom Tromey
2020-03-14 18:51 ` [PATCH v2 07/12] Introduce async-event.[ch] Tom Tromey
2020-03-14 18:51 ` [PATCH v2 08/12] Move event-loop.[ch] to gdbsupport/ Tom Tromey
2020-03-14 18:51 ` Tom Tromey [this message]
2020-03-14 18:51 ` [PATCH v2 10/12] Switch gdbserver to gdbsupport event loop Tom Tromey
2020-03-14 18:51 ` [PATCH v2 11/12] Move gdb_notifier comment Tom Tromey
2020-03-14 18:51 ` [PATCH v2 12/12] Remove gdb_fildes_t Tom Tromey
2020-04-13 21:08 ` [PATCH v2 00/12] Merge event loop implementations Tom Tromey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200314185158.7816-10-tom@tromey.com \
    --to=tom@tromey.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).