Re: [RFC 02/17] Move gdb-specific code out of start_event_loop

Pedro Alves
2019-09-26T14:02:19Z

On 2/24/19 4:51 PM, Tom Tromey wrote:
> This moves some gdb-specific code out of start_event_loop, into a new
> function that must be supplied by the event-loop client.
>
> gdb/ChangeLog
> 2019-02-24 Tom Tromey <tom@tromey.com>
>
> * main.c (handle_event_loop_exception): New function.
> * event-loop.c: Don't include event-top.h or observable.h.
> (start_event_loop): Remove gdb-specific code. Call
> handle_event_loop_exception.
> * event-loop.h (handle_event_loop_exception): Declare.

I think I'd rather move the whole start_event_loop to gdb.
IIUC, gdbserver version wants to let the exception propagate, so
it'd end up being a while (1) loop calling gdb_do_one_event.

I think the result will be clearer with fewer callsbacks and
no need for the shared ability to stop the event loop that is
only used by gdbserver.

Thanks,
Pedro Alves