[Lldb-commits] [lldb] r157036 - /lldb/trunk/source/Commands/CommandObjectProcess.cpp

Johnny Chen johnny.chen at apple.com
Thu May 17 17:51:36 PDT 2012


Author: johnny
Date: Thu May 17 19:51:36 2012
New Revision: 157036

URL: http://llvm.org/viewvc/llvm-project?rev=157036&view=rev
Log:
rdar://problem/11140741

For "process attach", make the success criterion as the inferior changes its state to eStateStopped.
Otherwise, mark it as a failure and say so.

Modified:
    lldb/trunk/source/Commands/CommandObjectProcess.cpp

Modified: lldb/trunk/source/Commands/CommandObjectProcess.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectProcess.cpp?rev=157036&r1=157035&r2=157036&view=diff
==============================================================================
--- lldb/trunk/source/Commands/CommandObjectProcess.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectProcess.cpp Thu May 17 19:51:36 2012
@@ -541,8 +541,18 @@
                     StateType state = process->WaitForProcessToStop (NULL);
                     
                     result.SetDidChangeProcessState (true);
-                    result.AppendMessageWithFormat ("Process %llu %s\n", process->GetID(), StateAsCString (state));
-                    result.SetStatus (eReturnStatusSuccessFinishNoResult);
+
+                    if (state == eStateStopped)
+                    {
+                        result.AppendMessageWithFormat ("Process %llu %s\n", process->GetID(), StateAsCString (state));
+                        result.SetStatus (eReturnStatusSuccessFinishNoResult);
+                    }
+                    else
+                    {
+                        result.AppendError ("attach failed: process did not stop (no such process or permission problem?)");
+                        result.SetStatus (eReturnStatusFailed);
+                        return false;                
+                    }
                 }
             }
         }





More information about the lldb-commits mailing list