Re: [RFC 00/17] Merge event loop implementations

Eli Zaretskii
2019-02-24T17:45:47Z

> From: Tom Tromey <tom@tromey.com>
> Cc: Tom Tromey <tom@tromey.com>, gdb-patches@sourceware.org
> Date: Sun, 24 Feb 2019 10:25:55 -0700
>
> >>>>> "Eli" == Eli Zaretskii <eliz@gnu.org> writes:
>
> Eli> The problem here is that Windows' implementation of 'select' works
> Eli> only on sockets, and wants HSOCKET handles instead of file
> Eli> descriptors. If you feed it a file descriptor, it won't work, even if
> Eli> the descriptor is for a socket.
>
> Thanks.
>
> I am still not sure what to do. Move the mingw-hdep select code to
> common? Or is it better to reintroduce gdb_fildes_t and use it
> everywhere? The former seems simpler I suppose, but the way that the
> mingw-hdep select implementation relies on readline gives me pause.

The readline bits should IMO be moved to readline, where it calls
'select'.

> Though perhaps that code will be removed in the readline upgrade, when I
> get back to that? So one idea might be to try to land that first.

I'm sorry, I cannot help you with this dilemma. Not unless someone
describes in more detail the actual needs of both GDB and gdbserver
for which they call 'select'. I myself don't know enough about the
internals to give any advice.

The long-term goal is probably to import the Gnulib implementation of
'select', which AFAIR supports any kind of descriptors. But that
would need some adaptation work.

So, if no one chimes in with more specific advice, perhaps leave this
particular part out of this series.