[Lldb-commits] [lldb] r283295 - Change Platform::GetRemoteSharedModule so if it's given a ModuleSpec

Jason Molenda via lldb-commits lldb-commits at lists.llvm.org
Tue Oct 4 19:29:13 PDT 2016


Author: jmolenda
Date: Tue Oct  4 21:29:13 2016
New Revision: 283295

URL: http://llvm.org/viewvc/llvm-project?rev=283295&view=rev
Log:
Change Platform::GetRemoteSharedModule so if it's given a ModuleSpec
which specifies a file path and UUID but not an architecture, open
the file at that path and try every one of the architectures in the
file to see if there is a UUID match.  Currently we'll pick the
first slice of a multi-architecture file and return that as the
match, and when the UUID doesn't match because it's the wrong
architecture, we'll end up ignoring the file.

<rdar://problem/28487804> 

Modified:
    lldb/trunk/source/Target/Platform.cpp

Modified: lldb/trunk/source/Target/Platform.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Platform.cpp?rev=283295&r1=283294&r2=283295&view=diff
==============================================================================
--- lldb/trunk/source/Target/Platform.cpp (original)
+++ lldb/trunk/source/Target/Platform.cpp Tue Oct  4 21:29:13 2016
@@ -1557,6 +1557,25 @@ Error Platform::GetRemoteSharedModule(co
     }
   }
 
+  if (module_spec.GetArchitecture().IsValid() == false) {
+    Error error;
+    // No valid architecture was specified, ask the platform for
+    // the architectures that we should be using (in the correct order)
+    // and see if we can find a match that way
+    ModuleSpec arch_module_spec(module_spec);
+    for (uint32_t idx = 0; GetSupportedArchitectureAtIndex(
+             idx, arch_module_spec.GetArchitecture());
+         ++idx) {
+      error = ModuleList::GetSharedModule(arch_module_spec, module_sp, nullptr,
+                                          nullptr, nullptr);
+      // Did we find an executable using one of the
+      if (error.Success() && module_sp)
+        break;
+    }
+    if (module_sp)
+      got_module_spec = true;
+  }
+
   if (!got_module_spec) {
     // Get module information from a target.
     if (!GetModuleSpec(module_spec.GetFileSpec(), module_spec.GetArchitecture(),




More information about the lldb-commits mailing list