[Lldb-commits] [lldb] r358929 - Fix a bug in my change to ModulesDidLoad in r357955.

Jason Molenda via lldb-commits lldb-commits at lists.llvm.org
Mon Apr 22 15:42:30 PDT 2019


Author: jmolenda
Date: Mon Apr 22 15:42:29 2019
New Revision: 358929

URL: http://llvm.org/viewvc/llvm-project?rev=358929&view=rev
Log:
Fix a bug in my change to ModulesDidLoad in r357955.
In the process of hoisting the LoadScriptingResourceForModule
out of Target::ModuleAdded and into Target::ModulesDidLoad,
I had ModulesDidLoad fetching the Target's entire image list
and look for scripting resources in those -- instead of only
looking for scripting resources in the modules that had
been added to the target's image list.

<rdar://problem/50065315> 


Modified:
    lldb/trunk/source/Target/Target.cpp

Modified: lldb/trunk/source/Target/Target.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Target.cpp?rev=358929&r1=358928&r2=358929&view=diff
==============================================================================
--- lldb/trunk/source/Target/Target.cpp (original)
+++ lldb/trunk/source/Target/Target.cpp Mon Apr 22 15:42:29 2019
@@ -1651,12 +1651,10 @@ void Target::NotifyModulesRemoved(lldb_p
 
 
 void Target::ModulesDidLoad(ModuleList &module_list) {
-  if (m_valid && module_list.GetSize()) {
-
-    const ModuleList &modules = GetImages();
-    const size_t num_images = modules.GetSize();
+  const size_t num_images = module_list.GetSize();
+  if (m_valid && num_images) {
     for (size_t idx = 0; idx < num_images; ++idx) {
-      ModuleSP module_sp(modules.GetModuleAtIndex(idx));
+      ModuleSP module_sp(module_list.GetModuleAtIndex(idx));
       LoadScriptingResourceForModule(module_sp, this);
     }
     m_breakpoint_list.UpdateBreakpoints(module_list, true, false);




More information about the lldb-commits mailing list