diff options
author | Jason Molenda <jmolenda@apple.com> | 2015-03-10 23:34:52 +0000 |
---|---|---|
committer | Jason Molenda <jmolenda@apple.com> | 2015-03-10 23:34:52 +0000 |
commit | 489758334424ece3a46c6891c03ce5b973580352 (patch) | |
tree | 8bb41824d9aae8fb63ab1cdd373663be057e4a64 /lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp | |
parent | c99b5ce13ac101a3a0773d8f8ef72642e6303e88 (diff) | |
download | bcm5719-llvm-489758334424ece3a46c6891c03ce5b973580352.tar.gz bcm5719-llvm-489758334424ece3a46c6891c03ce5b973580352.zip |
If the user specifies a kernel binary that isn't correct for the current
kernel debug session, instead of issuing a warning (which on one ever
sees), drop the user-specified kernel binary Module from the target and
try to discover the correct one dynamically.
<rdar://problem/19450329>
llvm-svn: 231885
Diffstat (limited to 'lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp')
-rw-r--r-- | lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp b/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp index 34d8414882a..85e69358e4a 100644 --- a/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp +++ b/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp @@ -724,19 +724,20 @@ DynamicLoaderDarwinKernel::KextImageInfo::ReadMemoryModule (Process *process) } if (m_uuid.IsValid()) { - Module* exe_module = process->GetTarget().GetExecutableModulePointer(); - if (exe_module && exe_module->GetUUID().IsValid()) + ModuleSP exe_module_sp = process->GetTarget().GetExecutableModule(); + if (exe_module_sp.get() && exe_module_sp->GetUUID().IsValid()) { - if (m_uuid != exe_module->GetUUID()) + if (m_uuid != exe_module_sp->GetUUID()) { - Stream *s = process->GetTarget().GetDebugger().GetOutputFile().get(); - if (s) - { - s->Printf ("warning: Host-side kernel file has Mach-O UUID of %s but remote kernel has a UUID of %s -- a mismatched kernel file will result in a poor debugger experience.\n", - exe_module->GetUUID().GetAsString().c_str(), - m_uuid.GetAsString().c_str()); - s->Flush (); - } + // The user specified a kernel binary that has a different UUID than + // the kernel actually running in memory. This never ends well; + // clear the user specified kernel binary from the Target. + + m_module_sp.reset(); + + ModuleList user_specified_kernel_list; + user_specified_kernel_list.Append (exe_module_sp); + process->GetTarget().GetImages().Remove (user_specified_kernel_list); } } } |