summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohnny Chen <johnny.chen@apple.com>2012-05-18 00:51:36 +0000
committerJohnny Chen <johnny.chen@apple.com>2012-05-18 00:51:36 +0000
commitaa739093dfb79fae9fdc44310d69e8bf3ff1cb3e (patch)
treef58f27cf038315d0426705f1e4c935d6e6410f4f
parentcd492b0a989cea8c18f5858c6a91a23e42a808e5 (diff)
downloadbcm5719-llvm-aa739093dfb79fae9fdc44310d69e8bf3ff1cb3e.tar.gz
bcm5719-llvm-aa739093dfb79fae9fdc44310d69e8bf3ff1cb3e.zip
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. llvm-svn: 157036
-rw-r--r--lldb/source/Commands/CommandObjectProcess.cpp14
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;
+ }
}
}
}
OpenPOWER on IntegriCloud