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;
}

_______________________________________________
lldb-dev mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev

Reply via email to