summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/DynamicLoader
diff options
context:
space:
mode:
authorJason Molenda <jmolenda@apple.com>2016-02-05 01:38:56 +0000
committerJason Molenda <jmolenda@apple.com>2016-02-05 01:38:56 +0000
commitec504238e453b3ad14a2a42e6b5c3abcd3e0999d (patch)
tree7a6904fec9e5cf12881c2f10fab7cc584130356b /lldb/source/Plugins/DynamicLoader
parent3ab12b144ac900a4d7486316405125072ed54f59 (diff)
downloadbcm5719-llvm-ec504238e453b3ad14a2a42e6b5c3abcd3e0999d.tar.gz
bcm5719-llvm-ec504238e453b3ad14a2a42e6b5c3abcd3e0999d.zip
Add two more addresses to check for the address of the kernel in debug mode;
also add some logging about where lldb is lookin for a kernel as it connects. <rdar://problem/24454582> llvm-svn: 259865
Diffstat (limited to 'lldb/source/Plugins/DynamicLoader')
-rw-r--r--lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp b/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
index 218b0b7a1ee..6ac210acf6d 100644
--- a/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
+++ b/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
@@ -266,6 +266,16 @@ DynamicLoaderDarwinKernel::SearchForKernelWithDebugHints (Process *process)
{
return addr;
}
+ addr = process->ReadUnsignedIntegerFromMemory (0xfffffff000002010ULL, 8, LLDB_INVALID_ADDRESS, read_err);
+ if (CheckForKernelImageAtAddress (addr, process).IsValid())
+ {
+ return addr;
+ }
+ addr = process->ReadUnsignedIntegerFromMemory (0xfffffff000004010ULL, 8, LLDB_INVALID_ADDRESS, read_err);
+ if (CheckForKernelImageAtAddress (addr, process).IsValid())
+ {
+ return addr;
+ }
}
else
{
@@ -397,9 +407,13 @@ DynamicLoaderDarwinKernel::SearchForKernelViaExhaustiveSearch (Process *process)
lldb_private::UUID
DynamicLoaderDarwinKernel::CheckForKernelImageAtAddress (lldb::addr_t addr, Process *process)
{
+ Log *log(lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_DYNAMIC_LOADER));
if (addr == LLDB_INVALID_ADDRESS)
return UUID();
+ if (log)
+ log->Printf ("DynamicLoaderDarwinKernel::CheckForKernelImageAtAddress: looking for kernel binary at 0x%" PRIx64, addr);
+
// First try a quick test -- read the first 4 bytes and see if there is a valid Mach-O magic field there
// (the first field of the mach_header/mach_header_64 struct).
@@ -450,6 +464,8 @@ DynamicLoaderDarwinKernel::CheckForKernelImageAtAddress (lldb::addr_t addr, Proc
{
process->GetTarget().SetArchitecture (kernel_arch);
}
+ if (log)
+ log->Printf ("DynamicLoaderDarwinKernel::CheckForKernelImageAtAddress: kernel binary image found at 0x%" PRIx64, addr);
return memory_module_sp->GetUUID();
}
}
OpenPOWER on IntegriCloud