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.

llvm-svn: 179738
This commit is contained in:
Greg Clayton
2013-04-18 00:42:25 +00:00
parent d0bd642464
commit 10c6943ac5

View File

@@ -2955,6 +2955,7 @@ Process::Attach (ProcessAttachInfo &attach_info)
{
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 &attach_info)
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 (Event *event_ptr)
}
}
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)
{