summaryrefslogtreecommitdiffstats
path: root/lldb/source
diff options
context:
space:
mode:
authorJason Molenda <jmolenda@apple.com>2016-02-13 04:15:02 +0000
committerJason Molenda <jmolenda@apple.com>2016-02-13 04:15:02 +0000
commit5f826bbc516a596a9168174013a0f2d536a3433c (patch)
tree8594981aacc5b49bc254e4b7a8dc871057d9975b /lldb/source
parent93e0200e23a3e4c085836a6b49ad947eab6352f4 (diff)
downloadbcm5719-llvm-5f826bbc516a596a9168174013a0f2d536a3433c.tar.gz
bcm5719-llvm-5f826bbc516a596a9168174013a0f2d536a3433c.zip
Additional fix to my change in r259983 to handle the
case where a core file has a kernel binary and a user process dyld in the same one. Without this, we were always picking the dyld and trying to process it as a kernel. <rdar://problem/24446112> llvm-svn: 260803
Diffstat (limited to 'lldb/source')
-rw-r--r--lldb/source/Plugins/Process/mach-core/ProcessMachCore.cpp16
1 files changed, 11 insertions, 5 deletions
diff --git a/lldb/source/Plugins/Process/mach-core/ProcessMachCore.cpp b/lldb/source/Plugins/Process/mach-core/ProcessMachCore.cpp
index f11aeb22874..43b7418b992 100644
--- a/lldb/source/Plugins/Process/mach-core/ProcessMachCore.cpp
+++ b/lldb/source/Plugins/Process/mach-core/ProcessMachCore.cpp
@@ -343,21 +343,27 @@ ProcessMachCore::DoLoadCore ()
// search heuristics might identify the correct one.
// Most of the time, I expect the address from SearchForDarwinKernel() will be the
// same as the address we found via exhaustive search.
- //
- // NB SearchForDarwinKernel will end up calling back into this this class in the GetImageInfoAddress
- // method which will give it the m_mach_kernel_addr address it already has. Save that aside
- // and set m_mach_kernel_addr to an invalid address temporarily so DynamicLoaderDarwinKernel does
- // a real search for the kernel using its own heuristics.
if (GetTarget().GetArchitecture().IsValid() == false && m_core_module_sp.get())
{
GetTarget().SetArchitecture (m_core_module_sp->GetArchitecture());
}
+ // SearchForDarwinKernel will end up calling back into this this class in the GetImageInfoAddress
+ // method which will give it the m_mach_kernel_addr/m_dyld_addr it already has. Save that aside
+ // and set m_mach_kernel_addr/m_dyld_addr to an invalid address temporarily so
+ // DynamicLoaderDarwinKernel does a real search for the kernel using its own heuristics.
+
addr_t saved_mach_kernel_addr = m_mach_kernel_addr;
+ addr_t saved_user_dyld_addr = m_dyld_addr;
m_mach_kernel_addr = LLDB_INVALID_ADDRESS;
+ m_dyld_addr = LLDB_INVALID_ADDRESS;
+
addr_t better_kernel_address = DynamicLoaderDarwinKernel::SearchForDarwinKernel (this);
+
m_mach_kernel_addr = saved_mach_kernel_addr;
+ m_dyld_addr = saved_user_dyld_addr;
+
if (better_kernel_address != LLDB_INVALID_ADDRESS)
{
if (log)
OpenPOWER on IntegriCloud