summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
diff options
context:
space:
mode:
authorJason Molenda <jmolenda@apple.com>2016-08-25 02:33:09 +0000
committerJason Molenda <jmolenda@apple.com>2016-08-25 02:33:09 +0000
commit30c18ecb3d05d4bbfa2cdfceddb07a1b0ffc873f (patch)
treeb973f589c0497c03e763091781b5ac9bcbab53e1 /lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
parentb42e0e7fa3681a8e7314958cafd0a021e149a2f1 (diff)
downloadbcm5719-llvm-30c18ecb3d05d4bbfa2cdfceddb07a1b0ffc873f.tar.gz
bcm5719-llvm-30c18ecb3d05d4bbfa2cdfceddb07a1b0ffc873f.zip
If the user has specified target.memory-module-load-level 'minimal'
and we couldn't find a dyld binary on the debug system, override that setting and read dyld out of memory - we need to put an internal breakpoint on dyld to register binaries being loaded or unloaded; the debugger won't work right without dyld symbols. <rdar://problem/27857025> llvm-svn: 279704
Diffstat (limited to 'lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp')
-rw-r--r--lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
index 789d404dc8f..2f34c19048b 100644
--- a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
+++ b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
@@ -2454,7 +2454,10 @@ ObjectFileMachO::ParseSymtab ()
if (!data_was_read)
{
- if (memory_module_load_level == eMemoryModuleLoadLevelComplete)
+ // Always load dyld - the dynamic linker - from memory if we didn't find a binary anywhere else.
+ // lldb will not register dylib/framework/bundle loads/unloads if we don't have the dyld symbols,
+ // we force dyld to load from memory despite the user's target.memory-module-load-level setting.
+ if (memory_module_load_level == eMemoryModuleLoadLevelComplete || m_header.filetype == llvm::MachO::MH_DYLINKER)
{
DataBufferSP nlist_data_sp (ReadMemory (process_sp, symoff_addr, nlist_data_byte_size));
if (nlist_data_sp)
@@ -2472,8 +2475,7 @@ ObjectFileMachO::ParseSymtab ()
indirect_symbol_index_data.SetData (indirect_syms_data_sp, 0, indirect_syms_data_sp->GetByteSize());
}
}
-
- if (memory_module_load_level >= eMemoryModuleLoadLevelPartial)
+ else if (memory_module_load_level >= eMemoryModuleLoadLevelPartial)
{
if (function_starts_load_command.cmd)
{
OpenPOWER on IntegriCloud