summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
diff options
context:
space:
mode:
authorJason Molenda <jmolenda@apple.com>2013-05-02 22:02:57 +0000
committerJason Molenda <jmolenda@apple.com>2013-05-02 22:02:57 +0000
commita4ce2538194a0a0cdacee3fa76bcfd02bff567f4 (patch)
tree6952ce0945930f669f2844298621aac4efd75931 /lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
parent6ad5269558a0ca46d3bad04ae3323f64a8ab8f65 (diff)
downloadbcm5719-llvm-a4ce2538194a0a0cdacee3fa76bcfd02bff567f4.tar.gz
bcm5719-llvm-a4ce2538194a0a0cdacee3fa76bcfd02bff567f4.zip
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
Diffstat (limited to 'lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp')
-rw-r--r--lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp b/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
index 4ef8fb56df3..12ded3c7719 100644
--- a/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
+++ b/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
@@ -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();
}
}
OpenPOWER on IntegriCloud