Yea, seems right <br><div class="gmail_quote"><div dir="ltr">On Fri, Aug 12, 2016 at 4:29 AM Pavel Labath <<a href="mailto:labath@google.com">labath@google.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Fyi. Please check if I got that right.<br>
<br>
---------- Forwarded message ----------<br>
From: Pavel Labath via lldb-commits <<a href="mailto:lldb-commits@lists.llvm.org" target="_blank">lldb-commits@lists.llvm.org</a>><br>
Date: 12 August 2016 at 12:20<br>
Subject: [Lldb-commits] [lldb] r278500 - Fix-up r278299 for windows<br>
To: <a href="mailto:lldb-commits@lists.llvm.org" target="_blank">lldb-commits@lists.llvm.org</a><br>
<br>
<br>
Author: labath<br>
Date: Fri Aug 12 06:20:21 2016<br>
New Revision: 278500<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=278500&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=278500&view=rev</a><br>
Log:<br>
Fix-up r278299 for windows<br>
<br>
FD_SETSIZE on windows limits the number of file descriptors, rather<br>
than their individual<br>
magnitude (the underlying implementation uses an array rather than a<br>
bitset). This meant that the<br>
assert in the SelectHelper was incorrect, and failing all the time. Fix that.<br>
<br>
I am not sure whether this should be #ifdef MSVC, or #ifdef WINDOWS,<br>
but my feeling is that a<br>
more posix-conforming implementation on windows would choose the<br>
bitset implementation, so I'm<br>
sticking with the former.<br>
<br>
Modified:<br>
    lldb/trunk/source/Utility/SelectHelper.cpp<br>
<br>
Modified: lldb/trunk/source/Utility/SelectHelper.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Utility/SelectHelper.cpp?rev=278500&r1=278499&r2=278500&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Utility/SelectHelper.cpp?rev=278500&r1=278499&r2=278500&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/source/Utility/SelectHelper.cpp (original)<br>
+++ lldb/trunk/source/Utility/SelectHelper.cpp Fri Aug 12 06:20:21 2016<br>
@@ -100,6 +100,12 @@ lldb_private::Error<br>
 SelectHelper::Select()<br>
 {<br>
     lldb_private::Error error;<br>
+#ifdef _MSC_VER<br>
+    // On windows FD_SETSIZE limits the number of file descriptors,<br>
not their numeric value.<br>
+    lldbassert(m_fd_map.size() <= FD_SETSIZE);<br>
+    if (m_fd_map.size() > FD_SETSIZE)<br>
+        return lldb_private::Error("Too many file descriptors for select()");<br>
+#endif<br>
<br>
     int max_read_fd = -1;<br>
     int max_write_fd = -1;<br>
@@ -109,7 +115,7 @@ SelectHelper::Select()<br>
     {<br>
         pair.second.PrepareForSelect();<br>
         const int fd = pair.first;<br>
-#if !defined(__APPLE__)<br>
+#if !defined(__APPLE__) && !defined(_MSC_VER)<br>
         lldbassert(fd < FD_SETSIZE);<br>
         if (fd >= FD_SETSIZE)<br>
         {<br>
<br>
<br>
_______________________________________________<br>
lldb-commits mailing list<br>
<a href="mailto:lldb-commits@lists.llvm.org" target="_blank">lldb-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits</a><br>
</blockquote></div>