[Lldb-commits] [lldb] r236231 - Fix Process::ResumeSynchronous which waits a process even in case of error

Ilia K ki.stfu at gmail.com
Thu Apr 30 06:10:32 PDT 2015


Author: ki.stfu
Date: Thu Apr 30 08:10:32 2015
New Revision: 236231

URL: http://llvm.org/viewvc/llvm-project?rev=236231&view=rev
Log:
Fix Process::ResumeSynchronous which waits a process even in case of error


Modified:
    lldb/trunk/source/Target/Process.cpp

Modified: lldb/trunk/source/Target/Process.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Process.cpp?rev=236231&r1=236230&r2=236231&view=diff
==============================================================================
--- lldb/trunk/source/Target/Process.cpp (original)
+++ lldb/trunk/source/Target/Process.cpp Thu Apr 30 08:10:32 2015
@@ -1731,15 +1731,17 @@ Process::ResumeSynchronous (Stream *stre
     HijackProcessEvents(listener_sp.get());
 
     Error error = PrivateResume();
-
-    StateType state = WaitForProcessToStop (NULL, NULL, true, listener_sp.get(), stream);
+    if (error.Success())
+    {
+        StateType state = WaitForProcessToStop (NULL, NULL, true, listener_sp.get(), stream);
+        const bool must_be_alive = false; // eStateExited is ok, so this must be false
+        if (!StateIsStoppedState(state, must_be_alive))
+            error.SetErrorStringWithFormat("process not in stopped state after synchronous resume: %s", StateAsCString(state));
+    }
 
     // Undo the hijacking of process events...
     RestoreProcessEvents();
 
-    if (error.Success() && !StateIsStoppedState(state, false))
-        error.SetErrorStringWithFormat("process not in stopped state after synchronous resume: %s", StateAsCString(state));
-
     return error;
 }
 





More information about the lldb-commits mailing list