summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
diff options
context:
space:
mode:
authorJason Molenda <jmolenda@apple.com>2016-10-21 23:45:07 +0000
committerJason Molenda <jmolenda@apple.com>2016-10-21 23:45:07 +0000
commitbc22c8d8d8f1f3a08f235eee08b63e8bf7524a1a (patch)
tree20278c3ca6303434ee0c83f18a3ff7a2badf20ce /lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
parentc8c9415644fa2cce5b65d8ea005e62ac59a73708 (diff)
downloadbcm5719-llvm-bc22c8d8d8f1f3a08f235eee08b63e8bf7524a1a.tar.gz
bcm5719-llvm-bc22c8d8d8f1f3a08f235eee08b63e8bf7524a1a.zip
Add some additional logging to
DynamicLoaderDarwinKernel::CheckForKernelImageAtAddress to debug corefiles that may not be correctly formed. <rdar://problem/28884846> llvm-svn: 284900
Diffstat (limited to 'lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp')
-rw-r--r--lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp25
1 files changed, 20 insertions, 5 deletions
diff --git a/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp b/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
index db0d0644f09..2773f7fead9 100644
--- a/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
+++ b/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
@@ -415,8 +415,14 @@ DynamicLoaderDarwinKernel::CheckForKernelImageAtAddress(lldb::addr_t addr,
return UUID();
ObjectFile *exe_objfile = memory_module_sp->GetObjectFile();
- if (exe_objfile == NULL)
+ if (exe_objfile == NULL) {
+ if (log)
+ log->Printf("DynamicLoaderDarwinKernel::CheckForKernelImageAtAddress "
+ "found a binary at 0x%" PRIx64
+ " but could not create an object file from memory",
+ addr);
return UUID();
+ }
if (exe_objfile->GetType() == ObjectFile::eTypeExecutable &&
exe_objfile->GetStrata() == ObjectFile::eStrataKernel) {
@@ -425,10 +431,19 @@ DynamicLoaderDarwinKernel::CheckForKernelImageAtAddress(lldb::addr_t addr,
kernel_arch)) {
process->GetTarget().SetArchitecture(kernel_arch);
}
- if (log)
- log->Printf("DynamicLoaderDarwinKernel::CheckForKernelImageAtAddress: "
- "kernel binary image found at 0x%" PRIx64,
- addr);
+ if (log) {
+ std::string uuid_str;
+ if (memory_module_sp->GetUUID().IsValid()) {
+ uuid_str = "with UUID ";
+ uuid_str += memory_module_sp->GetUUID().GetAsString();
+ } else {
+ uuid_str = "and no LC_UUID found in load commands ";
+ }
+ log->Printf(
+ "DynamicLoaderDarwinKernel::CheckForKernelImageAtAddress: "
+ "kernel binary image found at 0x%" PRIx64 " with arch '%s' %s",
+ addr, kernel_arch.GetTriple().str().c_str(), uuid_str.c_str());
+ }
return memory_module_sp->GetUUID();
}
}
OpenPOWER on IntegriCloud