summaryrefslogtreecommitdiffstats
path: root/lldb/tools/debugserver/source/MacOSX/MachProcess.cpp
diff options
context:
space:
mode:
authorJim Ingham <jingham@apple.com>2014-02-25 04:53:13 +0000
committerJim Ingham <jingham@apple.com>2014-02-25 04:53:13 +0000
commit5881318c8877e67bb6e3c5f67a249bb8ca54043e (patch)
treee5c65d2b73c5093d9f84af0444665e8c1eb1c477 /lldb/tools/debugserver/source/MacOSX/MachProcess.cpp
parent47ff9ab1be165d83063036f2630df794db008b4b (diff)
downloadbcm5719-llvm-5881318c8877e67bb6e3c5f67a249bb8ca54043e.tar.gz
bcm5719-llvm-5881318c8877e67bb6e3c5f67a249bb8ca54043e.zip
Allow debugserver to detach from the target if the connection is
unexpectedly closed. llvm-svn: 202110
Diffstat (limited to 'lldb/tools/debugserver/source/MacOSX/MachProcess.cpp')
-rw-r--r--lldb/tools/debugserver/source/MacOSX/MachProcess.cpp9
1 files changed, 6 insertions, 3 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);
OpenPOWER on IntegriCloud