[Lldb-commits] [lldb] r179738 - Fixed a few m_private_run_lock issues when attaching and also fixed the process to not try to restart the process if the process is exited, crashed or detached. Partial patch from Carlo Kok.

Greg Clayton gclayton at apple.com
Wed Apr 17 17:42:25 PDT 2013


Author: gclayton
Date: Wed Apr 17 19:42:25 2013
New Revision: 179738

URL: http://llvm.org/viewvc/llvm-project?rev=179738&view=rev
Log:
Fixed a few m_private_run_lock issues when attaching and also fixed the process to not try to restart the process if the process is exited, crashed or detached. Partial patch from Carlo Kok.

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=179738&r1=179737&r2=179738&view=diff
==============================================================================
--- lldb/trunk/source/Target/Process.cpp (original)
+++ lldb/trunk/source/Target/Process.cpp Wed Apr 17 19:42:25 2013
@@ -2955,6 +2955,7 @@ Process::Attach (ProcessAttachInfo &atta
                 {
                     if (m_public_run_lock.WriteTryLock())
                     {
+                        m_private_run_lock.WriteLock();
                         m_should_detach = true;
                         SetPublicState (eStateAttaching);
                         // Now attach using these arguments.
@@ -3032,6 +3033,7 @@ Process::Attach (ProcessAttachInfo &atta
 
             if (m_public_run_lock.WriteTryLock())
             {
+                m_private_run_lock.WriteLock();
                 // Now attach using these arguments.
                 m_should_detach = true;
                 SetPublicState (eStateAttaching);
@@ -4086,8 +4088,11 @@ Process::ProcessEventData::DoOnRemoval (
             }
         }
 
-        
-        if (m_process_sp->GetPrivateState() != eStateRunning)
+        const lldb::StateType state = m_process_sp->GetPrivateState();
+        if (state != eStateRunning &&
+            state != eStateCrashed &&
+            state != eStateDetached &&
+            state != eStateExited)
         {
             if (!still_should_stop)
             {





More information about the lldb-commits mailing list