Make processes use InputReaders for their input.  Move the process
ReadThread stuff into the main Process class (out of the Process Plugins).
This has the (intended) side effect of disabling the command line tool
from reading input/commands while the process is running (the input is
directed to the running process rather than to the command interpreter).



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@119329 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp b/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
index 93c6730..52499ba 100644
--- a/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+++ b/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
@@ -104,9 +104,7 @@
     Process (target, listener),
     m_dynamic_loader_ap (),
     m_flags (0),
-    m_stdio_communication ("gdb-remote.stdio"),
     m_stdio_mutex (Mutex::eMutexTypeRecursive),
-    m_stdout_data (),
     m_byte_order (eByteOrderHost),
     m_gdb_comm(),
     m_debugserver_pid (LLDB_INVALID_PROCESS_ID),
@@ -1634,23 +1632,23 @@
     return error;
 }
 
-void
-ProcessGDBRemote::STDIOReadThreadBytesReceived (void *baton, const void *src, size_t src_len)
-{
-    ProcessGDBRemote *process = (ProcessGDBRemote *)baton;
-    process->AppendSTDOUT(static_cast<const char *>(src), src_len);
-}
+//void
+//ProcessGDBRemote::STDIOReadThreadBytesReceived (void *baton, const void *src, size_t src_len)
+//{
+//    ProcessGDBRemote *process = (ProcessGDBRemote *)baton;
+//    process->AppendSTDOUT(static_cast<const char *>(src), src_len);
+//}
 
-void
-ProcessGDBRemote::AppendSTDOUT (const char* s, size_t len)
-{
-    ProcessGDBRemoteLog::LogIf (GDBR_LOG_PROCESS, "ProcessGDBRemote::%s (<%d> %s) ...", __FUNCTION__, len, s);
-    Mutex::Locker locker(m_stdio_mutex);
-    m_stdout_data.append(s, len);
-
-    // FIXME: Make a real data object for this and put it out.
-    BroadcastEventIfUnique (eBroadcastBitSTDOUT);
-}
+//void
+//ProcessGDBRemote::AppendSTDOUT (const char* s, size_t len)
+//{
+//    ProcessGDBRemoteLog::LogIf (GDBR_LOG_PROCESS, "ProcessGDBRemote::%s (<%d> %s) ...", __FUNCTION__, len, s);
+//    Mutex::Locker locker(m_stdio_mutex);
+//    m_stdout_data.append(s, len);
+//
+//    // FIXME: Make a real data object for this and put it out.
+//    BroadcastEventIfUnique (eBroadcastBitSTDOUT);
+//}
 
 
 Error
@@ -1867,18 +1865,7 @@
             if (m_debugserver_pid != LLDB_INVALID_PROCESS_ID)
             {
                 if (pty.GetMasterFileDescriptor() != lldb_utility::PseudoTerminal::invalid_fd)
-                {
-                    std::auto_ptr<ConnectionFileDescriptor> conn_ap(new ConnectionFileDescriptor (pty.ReleaseMasterFileDescriptor(), true));
-                    if (conn_ap.get())
-                    {
-                        m_stdio_communication.SetConnection(conn_ap.release());
-                        if (m_stdio_communication.IsConnected())
-                        {
-                            m_stdio_communication.SetReadThreadBytesReceivedCallback (STDIOReadThreadBytesReceived, this);
-                            m_stdio_communication.StartReadThread();
-                        }
-                    }
-                }
+                    SetUpProcessInputReader (pty.ReleaseMasterFileDescriptor());
             }
         }
         else