[Lldb-commits] [lldb] r234995 - Fixed remote failures in TestCPP11EnumTypes, probably others

Vince Harron vince at nethacker.com
Wed Apr 15 03:40:51 PDT 2015


Author: vharron
Date: Wed Apr 15 05:40:51 2015
New Revision: 234995

URL: http://llvm.org/viewvc/llvm-project?rev=234995&view=rev
Log:
Fixed remote failures in TestCPP11EnumTypes, probably others

Typically, LLGS only sends stdout/stderr notifications when the inferior
process is running.

Because LLGS reads stdout from the process in a separate thread, sometimes
these stdout notifications can be received after the server has sent a thread
stop message. The host isn't expecting stdout to be generated by the target
after a stop message and these messages interfere with the host's request/
response paradigm.

Differential Revision: http://reviews.llvm.org/D9024


Modified:
    lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp

Modified: lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp?rev=234995&r1=234994&r2=234995&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp (original)
+++ lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp Wed Apr 15 05:40:51 2015
@@ -747,6 +747,11 @@ GDBRemoteCommunicationServerLLGS::Proces
                 StateAsCString (state));
     }
 
+    // Make sure we get all of the pending stdout/stderr from the inferior
+    // and send it to the lldb host before we send the state change
+    // notification
+    m_stdio_communication.SynchronizeWithReadThread();
+
     switch (state)
     {
     case StateType::eStateExited:





More information about the lldb-commits mailing list