diff options
Diffstat (limited to 'lldb/source/Commands/CommandObjectProcess.cpp')
-rw-r--r-- | lldb/source/Commands/CommandObjectProcess.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/lldb/source/Commands/CommandObjectProcess.cpp b/lldb/source/Commands/CommandObjectProcess.cpp index 0dbf54f0f51..3958af587ba 100644 --- a/lldb/source/Commands/CommandObjectProcess.cpp +++ b/lldb/source/Commands/CommandObjectProcess.cpp @@ -541,8 +541,18 @@ public: 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; + } } } } |