From 88eb6d5725e2b460773704ffe1b226c393d9e30e Mon Sep 17 00:00:00 2001 From: Stephen Wilson Date: Wed, 19 Jan 2011 01:28:39 +0000 Subject: [PATCH] Load dependent modules in the Linux dynamic loader. This fixes a bug where the dynamic loader rendezvous was not updating its internal state when first initialized. llvm-svn: 123794 --- .../Plugins/DynamicLoader/Linux-DYLD/DYLDRendezvous.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lldb/source/Plugins/DynamicLoader/Linux-DYLD/DYLDRendezvous.cpp b/lldb/source/Plugins/DynamicLoader/Linux-DYLD/DYLDRendezvous.cpp index 8b4795d4c49c..f10aedb63de0 100644 --- a/lldb/source/Plugins/DynamicLoader/Linux-DYLD/DYLDRendezvous.cpp +++ b/lldb/source/Plugins/DynamicLoader/Linux-DYLD/DYLDRendezvous.cpp @@ -117,6 +117,12 @@ DYLDRendezvous::UpdateSOEntries() if (m_current.map_addr == 0) return false; + // When the previous and current states are consistent this is the first + // time we have been asked to update. Just take a snapshot of the currently + // loaded modules. + if (m_previous.state == eConsistent && m_current.state == eConsistent) + return TakeSnapshot(m_soentries); + // If we are about to add or remove a shared object clear out the current // state and take a snapshot of the currently loaded images. if (m_current.state == eAdd || m_current.state == eDelete) @@ -127,6 +133,7 @@ DYLDRendezvous::UpdateSOEntries() m_removed_soentries.clear(); return TakeSnapshot(m_soentries); } + assert(m_current.state == eConsistent); // Otherwise check the previous state to determine what to expect and update // accordingly.