diff options
Diffstat (limited to 'lldb/tools/debugserver/source/MacOSX')
-rw-r--r-- | lldb/tools/debugserver/source/MacOSX/MachProcess.cpp | 9 | ||||
-rw-r--r-- | lldb/tools/debugserver/source/MacOSX/MachProcess.h | 2 |
2 files changed, 7 insertions, 4 deletions
diff --git a/lldb/tools/debugserver/source/MacOSX/MachProcess.cpp b/lldb/tools/debugserver/source/MacOSX/MachProcess.cpp index c69b32eab04..c077f9be002 100644 --- a/lldb/tools/debugserver/source/MacOSX/MachProcess.cpp +++ b/lldb/tools/debugserver/source/MacOSX/MachProcess.cpp @@ -307,14 +307,16 @@ MachProcess::SetState(nub_state_t new_state) } void -MachProcess::Clear() +MachProcess::Clear(bool detaching) { // Clear any cached thread list while the pid and task are still valid m_task.Clear(); // Now clear out all member variables m_pid = INVALID_NUB_PROCESS; - CloseChildFileDescriptors(); + if (!detaching) + CloseChildFileDescriptors(); + m_path.clear(); m_args.clear(); SetState(eStateUnloaded); @@ -554,7 +556,8 @@ MachProcess::Detach() m_task.Clear(); // Clear out any notion of the process we once were - Clear(); + const bool detaching = true; + Clear(detaching); SetState(eStateDetached); diff --git a/lldb/tools/debugserver/source/MacOSX/MachProcess.h b/lldb/tools/debugserver/source/MacOSX/MachProcess.h index 7a52eaa54ae..5fa5dbdcfc7 100644 --- a/lldb/tools/debugserver/source/MacOSX/MachProcess.h +++ b/lldb/tools/debugserver/source/MacOSX/MachProcess.h @@ -258,7 +258,7 @@ private: eMachProcessFlagsAttached = (1 << 0), eMachProcessFlagsUsingSBS = (1 << 1) }; - void Clear (); + void Clear (bool detaching = false); void ReplyToAllExceptions (); void PrivateResume (); |