[Lldb-commits] [lldb] r119877 - in /lldb/trunk/source/Core: Communication.cpp ConnectionFileDescriptor.cpp

Greg Clayton gclayton at apple.com
Fri Nov 19 16:17:58 PST 2010


Author: gclayton
Date: Fri Nov 19 18:17:57 2010
New Revision: 119877

URL: http://llvm.org/viewvc/llvm-project?rev=119877&view=rev
Log:
Revert the End of file stuff that was added as it was causing read threads
to hang around and take a ton of CPU time. Caroline will fix this when she
gets back from vacation.


Modified:
    lldb/trunk/source/Core/Communication.cpp
    lldb/trunk/source/Core/ConnectionFileDescriptor.cpp

Modified: lldb/trunk/source/Core/Communication.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Communication.cpp?rev=119877&r1=119876&r2=119877&view=diff
==============================================================================
--- lldb/trunk/source/Core/Communication.cpp (original)
+++ lldb/trunk/source/Core/Communication.cpp Fri Nov 19 18:17:57 2010
@@ -265,8 +265,7 @@
     lldb_private::LogIfAnyCategoriesSet (LIBLLDB_LOG_COMMUNICATION,
                                  "%p Communication::AppendBytesToCache (src = %p, src_len = %zu, broadcast = %i)",
                                  this, bytes, len, broadcast);
-    if ((bytes == NULL || len == 0)
-        && (status != eConnectionStatusEndOfFile))
+    if (bytes == NULL || len == 0)
         return;
     if (m_callback)
     {
@@ -321,17 +320,14 @@
             size_t bytes_read = comm->ReadFromConnection (buf, sizeof(buf), status, &error);
             if (bytes_read > 0)
                 comm->AppendBytesToCache (buf, bytes_read, true, status);
-            else if ((bytes_read == 0) 
-                      && status == eConnectionStatusEndOfFile)
-                comm->AppendBytesToCache (buf, bytes_read, true, status);
         }
 
         switch (status)
         {
         case eConnectionStatusSuccess:
-        case eConnectionStatusEndOfFile:
             break;
 
+        case eConnectionStatusEndOfFile:
         case eConnectionStatusNoConnection:     // No connection
         case eConnectionStatusLostConnection:   // Lost connection while connected to a valid connection
             done = true;

Modified: lldb/trunk/source/Core/ConnectionFileDescriptor.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ConnectionFileDescriptor.cpp?rev=119877&r1=119876&r2=119877&view=diff
==============================================================================
--- lldb/trunk/source/Core/ConnectionFileDescriptor.cpp (original)
+++ lldb/trunk/source/Core/ConnectionFileDescriptor.cpp Fri Nov 19 18:17:57 2010
@@ -156,18 +156,8 @@
     ssize_t bytes_read = ::read (m_fd, dst, dst_len);
     if (bytes_read == 0)
     {
-        // 'read' did not return an error, but it didn't return any bytes either ==> End-of-File.
-        //  If the file descriptor is still valid, then we don't return an error; otherwise we do.
-        //  This allows whoever called us to act on the end-of-file, with a valid file descriptor, if they wish.
-        if (fcntl (m_fd, F_GETFL, 0) >= 0)
-        {
-            error.Clear(); // End-of-file, but not an error.  Pass along for the end-of-file handlers.
-        }
-        else
-        {
-            error.SetErrorStringWithFormat("End-of-file.\n");
-        }
-        status = eConnectionStatusEndOfFile;
+        error.SetErrorStringWithFormat("End-of-file.\n");
+        status = eConnectionStatusLostConnection;
     }
     else if (bytes_read < 0)
     {





More information about the lldb-commits mailing list