+/* Start up the event loop. This is the entry point to the event
+ loop. */
+
+static void
+start_event_loop ()
+{
+ /* Loop until there is nothing to do. This is the entry point to
+ the event loop engine. If nothing is ready at this time, wait
+ for something to happen (via wait_for_event), then process it.
+ Return when there are no longer event sources to wait for. */
+
+ keep_processing_events = true;
+ while (keep_processing_events)
+ {
+ /* Any events already waiting in the queue? */
+ int res = gdb_do_one_event ();
+
+ /* Was there an error? */
+ if (res == -1)
+ break;
+ }
+
+ /* We are done with the event loop. There are no more event sources
+ to listen to. So we exit gdbserver. */
+}
+