From a38b8c8abce0233e7ffc8d9d8de2436505877d59 Mon Sep 17 00:00:00 2001 From: Jason Molenda Date: Mon, 22 Apr 2019 22:42:29 +0000 Subject: [PATCH] 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. llvm-svn: 358929 --- lldb/source/Target/Target.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/lldb/source/Target/Target.cpp b/lldb/source/Target/Target.cpp index c05102a119e4..af88e47f589b 100644 --- a/lldb/source/Target/Target.cpp +++ b/lldb/source/Target/Target.cpp @@ -1651,12 +1651,10 @@ void Target::NotifyModulesRemoved(lldb_private::ModuleList &module_list) { 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); -- 2.34.1