<div dir="ltr">So I've run into a potentially difficult issue on Windows.<div><br></div><div>I have the test suite actually running. A few tests even passed surprisingly. But what doesn't work is one-shot script commands. e.g. the following:</div>
<div><br></div><div>(lldb) script print "foo"</div><div><br></div><div>Running this deadlocks. The reason is related to the ConnectionFileDescriptor class. Basically, on Windows the select() API will only accept sockets, nothing else. It seems select() is only used from the BytesAvailable() function, but that it attempts to simultaneously check if data is available on a) the read file descriptor, which could be an arbitrary object (pipe, socket, file, etc), and b) optionally, a pipe.</div>
<div><br></div><div>Is this correct? There isn't a great equivalent for this on Windows. </div><div><br></div><div>It's possible to make it work, but at a minimum it's going to involve re-implementing Pipe in terms of HANDLEs on Windows, because it's the only way you can do non-blocking I/O on a Pipe.<br>
</div><div><br></div><div>For starters, we could just stub out an entirely separate implementation of the function on Windows that makes use of this new HANDLE-based Pipe class, but I imagine that's going to get old pretty fast if we need to use select() in other places. I did search the code and only saw select() used in one other place, but perhaps at some point we'll need to abstract this out into an actual platform-specific version of select. FWIW Windows does provide a rough equivalent, it just uses an entirely different API, and is completely HANDLE-based, so this approach will probably require some more work to make other types of objects (files, sockets, processes, etc) HANDLE-based instead of fd-based on Windows.</div>
<div><br></div><div>Thoughts? Suggestions?</div></div>