summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJim Ingham <jingham@apple.com>2011-02-16 17:54:55 +0000
committerJim Ingham <jingham@apple.com>2011-02-16 17:54:55 +0000
commitd0a3e12b05f7653d95245c6a0d528da8653a5524 (patch)
tree5869d02d96010e08924037ce03c6135afe054560
parent81c4306005b4dcb6130517cf91fedbe46c986e7d (diff)
downloadbcm5719-llvm-d0a3e12b05f7653d95245c6a0d528da8653a5524.tar.gz
bcm5719-llvm-d0a3e12b05f7653d95245c6a0d528da8653a5524.zip
Destroy the dynamic loader plugin in Process::Finalize. If you wait till the auto_ptr gets deleted in the normal course of things the real process class will have been destroyed already, and it's hard to shut down the dynamic loader without accessing some process pure virtual method.
llvm-svn: 125668
-rw-r--r--lldb/source/Target/Process.cpp5
-rw-r--r--lldb/source/Target/Target.cpp4
2 files changed, 7 insertions, 2 deletions
diff --git a/lldb/source/Target/Process.cpp b/lldb/source/Target/Process.cpp
index fb6614d3f67..8968c755bc4 100644
--- a/lldb/source/Target/Process.cpp
+++ b/lldb/source/Target/Process.cpp
@@ -279,6 +279,11 @@ Process::Finalize()
{
// Do any cleanup needed prior to being destructed... Subclasses
// that override this method should call this superclass method as well.
+
+ // We need to destroy the loader before the derived Process class gets destroyed
+ // since it is very likely that undoing the loader will require access to the real process.
+ if (m_dyld_ap.get() != NULL)
+ m_dyld_ap.reset();
}
void
diff --git a/lldb/source/Target/Target.cpp b/lldb/source/Target/Target.cpp
index b76f9f6d573..175aa7dfaab 100644
--- a/lldb/source/Target/Target.cpp
+++ b/lldb/source/Target/Target.cpp
@@ -98,8 +98,8 @@ Target::DeleteCurrentProcess ()
m_section_load_list.Clear();
if (m_process_sp->IsAlive())
m_process_sp->Destroy();
- else
- m_process_sp->Finalize();
+
+ m_process_sp->Finalize();
// Do any cleanup of the target we need to do between process instances.
// NB It is better to do this before destroying the process in case the
OpenPOWER on IntegriCloud