<div dir="ltr"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span style="color:rgb(0,0,0);font-family:"Segoe UI","Segoe UI Emoji","Segoe UI Symbol",Lato,"Helvetica Neue",Helvetica,Arial,sans-serif;text-align:left;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">The problem is that shared libraries differ on these machines and<span> </span></span><br style="color:rgb(0,0,0);font-family:"Segoe UI","Segoe UI Emoji","Segoe UI Symbol",Lato,"Helvetica Neue",Helvetica,Arial,sans-serif;text-align:left;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><span style="color:rgb(0,0,0);font-family:"Segoe UI","Segoe UI Emoji","Segoe UI Symbol",Lato,"Helvetica Neue",Helvetica,Arial,sans-serif;text-align:left;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">LLDB either fails to load some libraries <b>or loads wrong ones</b>.</span><br></blockquote><div> </div><div>Not finding the modules is not surprising but the latter (loading the wrong modules) is a bit concerning. Do you know why the module build-id is not used when searching for the local binary?</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jul 24, 2018 at 7:19 AM, Greg Clayton via Phabricator via lldb-commits <span dir="ltr"><<a href="mailto:lldb-commits@lists.llvm.org" target="_blank">lldb-commits@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">clayborg requested changes to this revision.<br>
clayborg added a comment.<br>
This revision now requires changes to proceed.<br>
<br>
I think doing this in the module list is not the right place. Why? Some platforms might have multiple sysroot to check. iOS for instance has a directory for each device that Xcode has connected to which can be checked. I am fine with adding this ability to lldb_private::Platform, but I would just do it in there. Try GetRemoteSharedModule with the spec, if it fails, try again after modifying the spec to prepend the sysroot path. Possible even just check the sysroot path + path first if m_sdk_sysroot is filled in. I don't see the need to change ModuleList itself.<br>
<br>
<br>
<br>
================<br>
Comment at: include/lldb/Core/ModuleList.<wbr>h:544-545<br>
                                 bool *did_create_ptr,<br>
-                                bool always_create = false);<br>
<span class="">+                                bool always_create = false,<br>
+                                const char* sysroot = nullptr);<br>
   static bool RemoveSharedModule(lldb::<wbr>ModuleSP &module_sp);<br>
----------------<br>
</span>Revert this? See my main comment<br>
<br>
<br>
================<br>
Comment at: source/Core/ModuleList.cpp:<wbr>710-714<br>
+                                   bool *did_create_ptr, bool always_create,<br>
+                                   const char* sysroot) {<br>
+  // Make sure no one else can try and get or create a module while this<br>
+  // function is actively working on it by doing an extra lock on the<br>
+  // global mutex list.<br>
----------------<br>
Revert<br>
<br>
<br>
================<br>
Comment at: source/Core/ModuleList.cpp:<wbr>766-770<br>
+  if (sysroot != nullptr)<br>
+    resolved_module_spec.<wbr>GetFileSpec().<wbr>PrependPathComponent(sysroot);<br>
+<br>
+  module_sp.reset(new Module(resolved_module_spec));<br>
   // Make sure there are a module and an object file since we can specify<br>
----------------<br>
Revert<br>
<br>
<br>
================<br>
Comment at: source/Target/Platform.cpp:228<br>
         module_spec, module_sp, module_search_paths_ptr, old_module_sp_ptr,<br>
-        did_create_ptr, false);<br>
+        did_create_ptr, false, m_sdk_sysroot.AsCString());<br>
   return GetRemoteSharedModule(module_<wbr>spec, process, module_sp,<br>
----------------<br>
Revert<br>
<br>
<br>
================<br>
Comment at: source/Target/Platform.cpp:230<br>
   return GetRemoteSharedModule(module_<wbr>spec, process, module_sp,<br>
                                [&](const ModuleSpec &spec) {<br>
                                  Status error = ModuleList::GetSharedModule(<br>
----------------<br>
Here just make a module spec that has m_sdk_sysroot prepended if m_sdk_sysroot is set, and check for that file first. If that succeeds, return that, else do the same code as before.<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
Repository:<br>
  rL LLVM<br>
<br>
<a href="https://reviews.llvm.org/D49685" rel="noreferrer" target="_blank">https://reviews.llvm.org/<wbr>D49685</a><br>
<br>
<br>
<br>
______________________________<wbr>_________________<br>
lldb-commits mailing list<br>
<a href="mailto:lldb-commits@lists.llvm.org">lldb-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/lldb-commits</a><br>
</div></div></blockquote></div><br></div>