When PlatformDarwinKernel::ExamineKextForMatchingUUID is given
authorJason Molenda <jmolenda@apple.com>
Tue, 14 Oct 2014 21:47:45 +0000 (21:47 +0000)
committerJason Molenda <jmolenda@apple.com>
Tue, 14 Oct 2014 21:47:45 +0000 (21:47 +0000)
a FileSpec, UUID, and ArchSpec, and it's opening all the kexts
with the same bundle id to see if they're a match, don't set
the Arch in the ModuleSpec.  If Module::GetObjectFile() sees
that the architecture of the kext is a mismatch for the arch
we're looking for, it'll spew a warning message to the dev (r217251).

Rely on the UUID match to get the correct file if we have
a UUID -- we'll get no warning if it's a mismatch.

<rdar://problem/18641477>

llvm-svn: 219728

lldb/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp

index dc2217b..587d9a6 100644 (file)
@@ -658,12 +658,15 @@ PlatformDarwinKernel::ExamineKextForMatchingUUID (const FileSpec &kext_bundle_pa
     {
         ModuleSpec exe_spec (exe_file);
         exe_spec.GetUUID() = uuid;
-        exe_spec.GetArchitecture() = arch;
+        if (!uuid.IsValid())
+        {
+            exe_spec.GetArchitecture() = arch;
+        }
 
         // First try to create a ModuleSP with the file / arch and see if the UUID matches.
         // If that fails (this exec file doesn't have the correct uuid), don't call GetSharedModule
         // (which may call in to the DebugSymbols framework and therefore can be slow.)
-        ModuleSP module_sp (new Module (exe_file, arch));
+        ModuleSP module_sp (new Module (exe_spec));
         if (module_sp && module_sp->GetObjectFile() && module_sp->MatchesModuleSpec (exe_spec))
         {
             error = ModuleList::GetSharedModule (exe_spec, exe_module_sp, NULL, NULL, NULL);