summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
diff options
context:
space:
mode:
authorJason Molenda <jmolenda@apple.com>2012-10-02 22:23:42 +0000
committerJason Molenda <jmolenda@apple.com>2012-10-02 22:23:42 +0000
commit743e439608b8f52c90bac29c6967602bac7f1142 (patch)
treef7f1715738c756def8dcaf0ef85affd6b440c793 /lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
parentc8e25d98c00e62ac55f88516f34d504554e68cde (diff)
downloadbcm5719-llvm-743e439608b8f52c90bac29c6967602bac7f1142.tar.gz
bcm5719-llvm-743e439608b8f52c90bac29c6967602bac7f1142.zip
Change DynamicLoaderDarwinKernel::OSKextLoadedKextSummary to use
the Symbols::LocateExecutableObjectFile method to locate kexts and kernels instead of copying them out of the memory of the remote system. This is the fix for <rdar://problem/12416384>. Fix a variable shadowing problem in Symbols::LocateMacOSXFilesUsingDebugSymbols which caused the symbol rich executable binaries to not be found even if they were listed in the dSYM Info.plist. Change Symbols::DownloadObjectAndSymbolFile to ignore dsymForUUID's negative cache - this is typically being called by the user and we should try even if there's a incorrect entry in the negative cache. llvm-svn: 165061
Diffstat (limited to 'lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp')
-rw-r--r--lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp26
1 files changed, 16 insertions, 10 deletions
diff --git a/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp b/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
index 5a96db844e2..1231e88a8c2 100644
--- a/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
+++ b/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
@@ -289,16 +289,15 @@ DynamicLoaderDarwinKernel::OSKextLoadedKextSummary::LoadImageUsingMemoryModule (
module_sp.reset(); // UUID mismatch
}
- // If this is the kernel, see if we can locate a copy of the binary based on the UUID (and maybe even debug info)
- // FIXME: Symbols::DownloadObjectAndSymbolFile is forcing the download of the binaries via dsymForUUID regardless
- // of the current pref settings; don't want to do this for all the kexts unless the user has enabled it..
- if (!module_sp && memory_module_is_kernel)
+ // Try to locate the kext/kernel binary on the local filesystem, maybe with additional
+ // debug info/symbols still present, before we resort to copying it out of memory.
+ if (!module_sp)
{
ModuleSpec sym_spec;
sym_spec.GetUUID() = memory_module_sp->GetUUID();
- if (Symbols::DownloadObjectAndSymbolFile (sym_spec)
- && sym_spec.GetArchitecture().IsValid()
- && sym_spec.GetSymbolFileSpec().Exists())
+ if (Symbols::LocateExecutableObjectFile (sym_spec)
+ && sym_spec.GetArchitecture().IsValid()
+ && sym_spec.GetFileSpec().Exists())
{
module_sp = target.GetSharedModule (sym_spec);
if (module_sp.get ())
@@ -354,9 +353,16 @@ DynamicLoaderDarwinKernel::OSKextLoadedKextSummary::LoadImageUsingMemoryModule (
char uuidbuf[64];
s->Printf ("Kernel UUID: %s\n", module_sp->GetUUID().GetAsCString(uuidbuf, sizeof (uuidbuf)));
s->Printf ("Load Address: 0x%llx\n", address);
- s->Printf ("Loaded kernel file %s/%s\n",
- module_sp->GetFileSpec().GetDirectory().AsCString(),
- module_sp->GetFileSpec().GetFilename().AsCString());
+ if (module_sp->GetFileSpec().GetDirectory().IsEmpty())
+ {
+ s->Printf ("Loaded kernel file %s\n", module_sp->GetFileSpec().GetFilename().AsCString());
+ }
+ else
+ {
+ s->Printf ("Loaded kernel file %s/%s\n",
+ module_sp->GetFileSpec().GetDirectory().AsCString(),
+ module_sp->GetFileSpec().GetFilename().AsCString());
+ }
s->Flush ();
}
}
OpenPOWER on IntegriCloud