diff options
| author | Jason Molenda <jmolenda@apple.com> | 2016-07-28 22:43:10 +0000 |
|---|---|---|
| committer | Jason Molenda <jmolenda@apple.com> | 2016-07-28 22:43:10 +0000 |
| commit | 4fa5041225ed56569f9db60d4399f867dff5085e (patch) | |
| tree | 11ddad7a91dd1cbb1162efeb55091975d64638d8 | |
| parent | 102c182bca33e1342c8ee32181e6a9b80b840b4f (diff) | |
| download | bcm5719-llvm-4fa5041225ed56569f9db60d4399f867dff5085e.tar.gz bcm5719-llvm-4fa5041225ed56569f9db60d4399f867dff5085e.zip | |
Small refinement on the memory segment support in core files that
Greg added in r272276 -- when working with a non-user-process mach-o
core file, force the permissions to readable + executable, else the
unwinder can stop backtracing early if it gets a pc value in a segment
that it thinks is non-executable.
<rdar://problem/27138456>
<rdar://problem/27462904>
llvm-svn: 277065
| -rw-r--r-- | lldb/source/Plugins/Process/mach-core/ProcessMachCore.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/lldb/source/Plugins/Process/mach-core/ProcessMachCore.cpp b/lldb/source/Plugins/Process/mach-core/ProcessMachCore.cpp index 6bf198ca2f3..d2f50ba6c54 100644 --- a/lldb/source/Plugins/Process/mach-core/ProcessMachCore.cpp +++ b/lldb/source/Plugins/Process/mach-core/ProcessMachCore.cpp @@ -418,6 +418,23 @@ ProcessMachCore::DoLoadCore () } } + if (m_dyld_plugin_name != DynamicLoaderMacOSXDYLD::GetPluginNameStatic()) + { + // For non-user process core files, the permissions on the core file segments are usually + // meaningless, they may be just "read", because we're dealing with kernel coredumps or + // early startup coredumps and the dumper is grabbing pages of memory without knowing + // what they are. If they aren't marked as "exeuctable", that can break the unwinder + // which will check a pc value to see if it is in an executable segment and stop the + // backtrace early if it is not ("executable" and "unknown" would both be fine, but + // "not executable" will break the unwinder). + size_t core_range_infos_size = m_core_range_infos.GetSize(); + for (size_t i = 0; i < core_range_infos_size; i++) + { + VMRangeToPermissions::Entry *ent = m_core_range_infos.GetMutableEntryAtIndex (i); + ent->data = lldb::ePermissionsReadable | lldb::ePermissionsExecutable; + } + } + // Even if the architecture is set in the target, we need to override // it to match the core file which is always single arch. ArchSpec arch (m_core_module_sp->GetArchitecture()); |

