aboutsummaryrefslogtreecommitdiff
path: root/gdbserver/remote-utils.cc
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2020-04-13 12:42:59 -0600
committerTom Tromey <tromey@adacore.com>2020-04-13 14:10:04 -0600
commit55d7aec85e81c4597e94ebcc8b85f20a1d439bd0 (patch)
tree664fe7b861844fbe141d01768c38e2f6b033399e /gdbserver/remote-utils.cc
parente487f9949ab654b20da8ac01b8311ae956136e5e (diff)
downloadgdb-55d7aec85e81c4597e94ebcc8b85f20a1d439bd0.zip
gdb-55d7aec85e81c4597e94ebcc8b85f20a1d439bd0.tar.gz
gdb-55d7aec85e81c4597e94ebcc8b85f20a1d439bd0.tar.bz2
Switch gdbserver to gdbsupport event loop
This changes gdbserver to use the gdbserver event loop, removing the ancient fork. gdbserver/ChangeLog 2020-04-13 Tom Tromey <tom@tromey.com> * server.h (handle_serial_event, handle_target_event): Update. * server.c: Don't call initialize_event_loop. (keep_processing_events): New global. (handle_serial_event): Return void. Set keep_processing_events. (handle_target_event): Return void. (start_event_loop): Move from event-loop.c. Rewrite. * remote-utils.c (handle_accept_event): Return void. (reset_readchar): Use delete_timer. (process_remaining): Return void. (reschedule): Use create_timer. * event-loop.h: Remove. * event-loop.cc: Remove. * Makefile.in (OBS): Use gdbsupport/event-loop.o, not event-loop.o.
Diffstat (limited to 'gdbserver/remote-utils.cc')
-rw-r--r--gdbserver/remote-utils.cc18
1 files changed, 5 insertions, 13 deletions
diff --git a/gdbserver/remote-utils.cc b/gdbserver/remote-utils.cc
index 1c211e2..6249691 100644
--- a/gdbserver/remote-utils.cc
+++ b/gdbserver/remote-utils.cc
@@ -144,7 +144,7 @@ enable_async_notification (int fd)
#endif
}
-static int
+static void
handle_accept_event (int err, gdb_client_data client_data)
{
struct sockaddr_storage sockaddr;
@@ -213,8 +213,6 @@ handle_accept_event (int err, gdb_client_data client_data)
until GDB as selected all-stop/non-stop, and has queried the
threads' status ('?'). */
target_async (0);
-
- return 0;
}
/* Prepare for a later connection to a remote debugger.
@@ -930,27 +928,21 @@ reset_readchar (void)
readchar_bufcnt = 0;
if (readchar_callback != NOT_SCHEDULED)
{
- delete_callback_event (readchar_callback);
+ delete_timer (readchar_callback);
readchar_callback = NOT_SCHEDULED;
}
}
/* Process remaining data in readchar_buf. */
-static int
+static void
process_remaining (void *context)
{
- int res;
-
/* This is a one-shot event. */
readchar_callback = NOT_SCHEDULED;
if (readchar_bufcnt > 0)
- res = handle_serial_event (0, NULL);
- else
- res = 0;
-
- return res;
+ handle_serial_event (0, NULL);
}
/* If there is still data in the buffer, queue another event to process it,
@@ -960,7 +952,7 @@ static void
reschedule (void)
{
if (readchar_bufcnt > 0 && readchar_callback == NOT_SCHEDULED)
- readchar_callback = append_callback_event (process_remaining, NULL);
+ readchar_callback = create_timer (0, process_remaining, NULL);
}
/* Read a packet from the remote machine, with error checking,