summaryrefslogtreecommitdiffstats
path: root/lldb/source/Host/windows/HostProcessWindows.cpp
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2014-11-05 22:16:28 +0000
committerZachary Turner <zturner@google.com>2014-11-05 22:16:28 +0000
commit742346a22f591938ea8d0f10a9ae6135649d0057 (patch)
tree981d81eca5886f59a75c88f9008db9c3956b7561 /lldb/source/Host/windows/HostProcessWindows.cpp
parent1839abdabe24a8a5211e21c71769253d5cf69d1d (diff)
downloadbcm5719-llvm-742346a22f591938ea8d0f10a9ae6135649d0057.tar.gz
bcm5719-llvm-742346a22f591938ea8d0f10a9ae6135649d0057.zip
Decouple ProcessWindows from the Windows debug driver thread.
In the llgs world, ProcessWindows will eventually go away and we'll implement a different protocol. This patch decouples ProcessWindows from the core debug loop so that this transition will not be more difficult than it needs to be. llvm-svn: 221405
Diffstat (limited to 'lldb/source/Host/windows/HostProcessWindows.cpp')
-rw-r--r--lldb/source/Host/windows/HostProcessWindows.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/lldb/source/Host/windows/HostProcessWindows.cpp b/lldb/source/Host/windows/HostProcessWindows.cpp
index c42bc555906..d8e407c667a 100644
--- a/lldb/source/Host/windows/HostProcessWindows.cpp
+++ b/lldb/source/Host/windows/HostProcessWindows.cpp
@@ -31,11 +31,13 @@ struct MonitorInfo
HostProcessWindows::HostProcessWindows()
: HostNativeProcessBase()
+ , m_owns_handle(true)
{
}
HostProcessWindows::HostProcessWindows(lldb::process_t process)
: HostNativeProcessBase(process)
+ , m_owns_handle(true)
{
}
@@ -44,6 +46,12 @@ HostProcessWindows::~HostProcessWindows()
Close();
}
+void
+HostProcessWindows::SetOwnsHandle(bool owns)
+{
+ m_owns_handle = owns;
+}
+
Error HostProcessWindows::Terminate()
{
Error error;
@@ -123,7 +131,7 @@ HostProcessWindows::MonitorThread(void *thread_arg)
void HostProcessWindows::Close()
{
- if (m_process != LLDB_INVALID_PROCESS)
+ if (m_owns_handle && m_process != LLDB_INVALID_PROCESS)
::CloseHandle(m_process);
m_process = nullptr;
}
OpenPOWER on IntegriCloud