[Lldb-commits] [lldb] r219728 - When PlatformDarwinKernel::ExamineKextForMatchingUUID is given

Jason Molenda jmolenda at apple.com
Tue Oct 14 14:47:45 PDT 2014

Author: jmolenda
Date: Tue Oct 14 16:47:45 2014
New Revision: 219728

URL: http://llvm.org/viewvc/llvm-project?rev=219728&view=rev
When PlatformDarwinKernel::ExamineKextForMatchingUUID is given
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.



Modified: lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp?rev=219728&r1=219727&r2=219728&view=diff
--- lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp (original)
+++ lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp Tue Oct 14 16:47:45 2014
@@ -658,12 +658,15 @@ PlatformDarwinKernel::ExamineKextForMatc
         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);

More information about the lldb-commits mailing list