This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: PATCH: Support Windows in event-loop.c
On Thu, Apr 21, 2005 at 09:41:28PM +0300, Eli Zaretskii wrote:
> > Date: Wed, 20 Apr 2005 22:49:02 -0700
> > From: Mark Mitchell <mark@codesourcery.com>
> >
> > This patch adds support for Windows to event-loop.c. The key issue is
> > that "select" on Windows only works on sockets; it does not work on
> > general file descriptors. For that, one must use
> > WaitForMultipleObjects, and that requires converting file descriptors
> > (as used by read/write/open/close) to native HANDLEs.
>
> Ouch! ugly OS-dependent #ifdef's in event-loop.c!
>
> Is it perhaps possible to write an emulation of `select' that would
> handle file handles as well, put it on win32-nat.c, say, and then
> leave event-loop.c more or less alone? That would be much cleaner, I
> think.
If so, please don't use win32-nat.c; this is Windows hosting support
rather than Windows native debugging support.
Honestly, I don't find Mark's changes any worse than the already
present ifdefs to select between select and poll. It's the same sort
of choice.
--
Daniel Jacobowitz
CodeSourcery, LLC