diff options
-rw-r--r-- | lldb/source/Target/Process.cpp | 35 | ||||
-rw-r--r-- | lldb/tools/lldb-mi/MICmdCmdMiscellanous.cpp | 2 |
2 files changed, 10 insertions, 27 deletions
diff --git a/lldb/source/Target/Process.cpp b/lldb/source/Target/Process.cpp index 579f9ae8388..6137b7f1b89 100644 --- a/lldb/source/Target/Process.cpp +++ b/lldb/source/Target/Process.cpp @@ -822,32 +822,8 @@ Process::GetGlobalProperties() void Process::Finalize() { - switch (GetPrivateState()) - { - case eStateConnected: - case eStateAttaching: - case eStateLaunching: - case eStateStopped: - case eStateRunning: - case eStateStepping: - case eStateCrashed: - case eStateSuspended: - if (GetShouldDetach()) - { - // FIXME: This will have to be a process setting: - bool keep_stopped = false; - Detach(keep_stopped); - } - else - Destroy(); - break; - - case eStateInvalid: - case eStateUnloaded: - case eStateDetached: - case eStateExited: - break; - } + // Destroy this process + Destroy(); // Clear our broadcaster before we proceed with destroying Broadcaster::Clear(); @@ -3952,6 +3928,13 @@ Process::Destroy () // that might hinder the destruction. Remember to set this back to false when we are done. That way if the attempt // failed and the process stays around for some reason it won't be in a confused state. + if (GetShouldDetach()) + { + // FIXME: This will have to be a process setting: + bool keep_stopped = false; + Detach(keep_stopped); + } + m_destroy_in_process = true; Error error (WillDestroy()); diff --git a/lldb/tools/lldb-mi/MICmdCmdMiscellanous.cpp b/lldb/tools/lldb-mi/MICmdCmdMiscellanous.cpp index 1493daa9a85..8d341447238 100644 --- a/lldb/tools/lldb-mi/MICmdCmdMiscellanous.cpp +++ b/lldb/tools/lldb-mi/MICmdCmdMiscellanous.cpp @@ -74,7 +74,7 @@ bool CMICmdCmdGdbExit::Execute(void) { CMICmnLLDBDebugger::Instance().GetDriver().SetExitApplicationFlag(true); - const lldb::SBError sbErr = m_rLLDBDebugSessionInfo.GetProcess().Detach(); + const lldb::SBError sbErr = m_rLLDBDebugSessionInfo.GetProcess().Destroy(); // Do not check for sbErr.Fail() here, m_lldbProcess is likely !IsValid() return MIstatus::success; |