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
This commit is contained in:
Johnny Chen 2012-05-18 00:51:36 +00:00
parent cd492b0a98
commit aa739093df
1 changed files with 12 additions and 2 deletions

View File

@ -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;
}
}
}
}