module m_images

Is there a reason for the line down below with the “<<<<<<<<< Why?” comment?

Target::GetSharedModule() appends the module to the images list, and this line is adding it again (causing duplicates).

I’m guessing it’s just a bug, but I wanted to make sure before I killed it…
-Mike

ModuleSP
DynamicLoaderPOSIXDYLD::LoadModuleAtAddress(const FileSpec &file, addr_t base_addr)
{
Target &target = m_process->GetTarget();
ModuleList &modules = target.GetImages();
ModuleSP module_sp;

ModuleSpec module_spec (file, target.GetArchitecture());
if ((module_sp = modules.FindFirstModule (module_spec)))
{
UpdateLoadedSections(module_sp, base_addr);
}
else if ((module_sp = target.GetSharedModule(module_spec)))
{
UpdateLoadedSections(module_sp, base_addr);
modules.Append(module_sp); // <<<<<<<<< Why?
}

return module_sp;
}

Yes, this extra append is bad and should be removed.

You don't want to see multiple of the same shared library listed when you do a:

(lldb) image list