[Lldb-commits] [lldb] r177116 - Recommit lldb realtime output for POSIX.

Matt Kopec Matt.Kopec at intel.com
Thu Mar 14 14:35:26 PDT 2013


Author: mkopec
Date: Thu Mar 14 16:35:26 2013
New Revision: 177116

URL: http://llvm.org/viewvc/llvm-project?rev=177116&view=rev
Log:
Recommit lldb realtime output for POSIX.
 -Adds workaround for assertion in lldb for TestEvents.py

Modified:
    lldb/trunk/source/Plugins/Process/Linux/ProcessMonitor.cpp
    lldb/trunk/source/Plugins/Process/POSIX/ProcessPOSIX.cpp
    lldb/trunk/source/Plugins/Process/POSIX/ProcessPOSIX.h

Modified: lldb/trunk/source/Plugins/Process/Linux/ProcessMonitor.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Linux/ProcessMonitor.cpp?rev=177116&r1=177115&r2=177116&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Linux/ProcessMonitor.cpp (original)
+++ lldb/trunk/source/Plugins/Process/Linux/ProcessMonitor.cpp Thu Mar 14 16:35:26 2013
@@ -1571,7 +1571,8 @@ ProcessMonitor::ServeOperation(Operation
                 assert(errno == EINTR);
                 goto READ_AGAIN;
             }
-
+            if (status == 0)
+                continue; // Poll again. The connection probably terminated.
             assert(status == sizeof(op));
             op->Execute(monitor);
             write(fdset.fd, &op, sizeof(op));

Modified: lldb/trunk/source/Plugins/Process/POSIX/ProcessPOSIX.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/POSIX/ProcessPOSIX.cpp?rev=177116&r1=177115&r2=177116&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/POSIX/ProcessPOSIX.cpp (original)
+++ lldb/trunk/source/Plugins/Process/POSIX/ProcessPOSIX.cpp Thu Mar 14 16:35:26 2013
@@ -206,6 +206,8 @@ ProcessPOSIX::DoLaunch (Module *module,
     if (!error.Success())
         return error;
 
+    SetSTDIOFileDescriptor(m_monitor->GetTerminalFD());
+
     SetID(m_monitor->GetPID());
     return error;
 }
@@ -277,7 +279,6 @@ ProcessPOSIX::DoHalt(bool &caused_stop)
     {
         caused_stop = true;
     }
-
     return error;
 }
 
@@ -584,27 +585,6 @@ ProcessPOSIX::PutSTDIN(const char *buf,
     return status;
 }
 
-size_t
-ProcessPOSIX::GetSTDOUT(char *buf, size_t len, Error &error)
-{
-    ssize_t bytes_read;
-
-    // The terminal file descriptor is always in non-block mode.
-    if ((bytes_read = read(m_monitor->GetTerminalFD(), buf, len)) < 0) 
-    {
-        if (errno != EAGAIN)
-            error.SetErrorToErrno();
-        return 0;
-    }
-    return bytes_read;
-}
-
-size_t
-ProcessPOSIX::GetSTDERR(char *buf, size_t len, Error &error)
-{
-    return GetSTDOUT(buf, len, error);
-}
-
 UnixSignals &
 ProcessPOSIX::GetUnixSignals()
 {

Modified: lldb/trunk/source/Plugins/Process/POSIX/ProcessPOSIX.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/POSIX/ProcessPOSIX.h?rev=177116&r1=177115&r2=177116&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/POSIX/ProcessPOSIX.h (original)
+++ lldb/trunk/source/Plugins/Process/POSIX/ProcessPOSIX.h Thu Mar 14 16:35:26 2013
@@ -124,12 +124,6 @@ public:
     virtual size_t
     PutSTDIN(const char *buf, size_t len, lldb_private::Error &error);
 
-    virtual size_t
-    GetSTDOUT(char *buf, size_t len, lldb_private::Error &error);
-
-    virtual size_t
-    GetSTDERR(char *buf, size_t len, lldb_private::Error &error);
-
     //--------------------------------------------------------------------------
     // ProcessPOSIX internal API.
 





More information about the lldb-commits mailing list