[lldb-dev] module m_images

Greg Clayton gclayton at apple.com
Thu Jun 13 18:21:20 PDT 2013


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



On Jun 13, 2013, at 5:11 PM, Mike Sartain <mikesart at valvesoftware.com> wrote:

> 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
> lldb-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev




More information about the lldb-dev mailing list