Track whether a process was Launched or Attached to. If Attached, the detach when the debugger is destroyed, rather than killing the process. Also added a Debugger::Clear, which gets called in Debugger::Destroy to deal with all the targets in the Debugger. Also made the Driver's main loop call Destroy on the debugger, rather than just Destroying the currently selected Target's process.
git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@139853 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Target/Process.cpp b/source/Target/Process.cpp
index b36accb..3fdc2a7 100644
--- a/source/Target/Process.cpp
+++ b/source/Target/Process.cpp
@@ -600,6 +600,7 @@
m_stdout_data (),
m_memory_cache (*this),
m_allocated_memory_cache (*this),
+ m_attached_to_process (false),
m_next_event_action_ap()
{
UpdateInstanceName();
@@ -2305,6 +2306,7 @@
{
// Let the process subclass figure out at much as it can about the process
// before we go looking for a dynamic loader plug-in.
+ m_attached_to_process = true;
DidAttach();
// We just attached. If we have a platform, ask it for the process architecture, and if it isn't