If the Target's current architecture is incompatible with the kernel

DynamicLoaderDarwinKernel finds in memory, have DynamicLoaderDarwinKernel
re-set the Target's arch based on the kernel's cpu type / cpu subtype.

llvm-svn: 180962
This commit is contained in:
Jason Molenda
2013-05-02 22:02:57 +00:00
parent 6ad5269558
commit a4ce253819

View File

@@ -434,6 +434,11 @@ DynamicLoaderDarwinKernel::CheckForKernelImageAtAddress (lldb::addr_t addr, Proc
if (exe_objfile->GetType() == ObjectFile::eTypeExecutable && exe_objfile->GetStrata() == ObjectFile::eStrataKernel)
{
ArchSpec kernel_arch (eArchTypeMachO, header.cputype, header.cpusubtype);
if (!process->GetTarget().GetArchitecture().IsCompatibleMatch(kernel_arch))
{
process->GetTarget().SetArchitecture (kernel_arch);
}
return memory_module_sp->GetUUID();
}
}