[lldb-dev] module m_images

Mike Sartain mikesart at valvesoftware.com
Thu Jun 13 17:11:52 PDT 2013

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...

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;

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-dev/attachments/20130614/722acfa5/attachment.html>

More information about the lldb-dev mailing list