llvm-project/lldb
Pavel Labath 193a7bfb69 minidump: Create memory regions from the sections of loaded modules
Summary:
Not all minidumps contain information about memory permissions. However,
it is still important to know which regions of memory contain
potentially executable code. This is particularly important for
unwinding on win32, as the default unwind method there relies on
scanning the stack for things which "look like" code pointers.

This patch enables ProcessMinidump to reconstruct the likely permissions
of memory regions using the sections of loaded object files. It only
does this if we don't have a better source (memory info list stream, or
linux /proc/maps) for this information, and only if the information in
the object files does not conflict with the information in the minidump.

Theoretically that last bit could be improved, since the permissions
obtained from the MemoryList streams is also only a very rough guess,
but it did not seem worthwhile to complicate the implementation because
of that because there will generally be no overlap in practice as the
MemoryList will contain the stack contents and not any module data.

The patch adds a test checking that the module section permissions are
entered into the memory region list, and also a test which demonstrate
that now the unwinder is able to correctly find return addresses even in
minidumps without memory info list streams.

There's one TODO left in this patch, which is that the "memory region"
output does not give any indication about the "don't know" values of
memory region permissions (it just prints them as if they permission bit
was set). I address this in a follow up.

Reviewers: amccarth, clayborg

Subscribers: mgrang, lldb-commits

Differential Revision: https://reviews.llvm.org/D69105
2019-10-31 11:24:55 +01:00
..
cmake [CMake] Move test dependency tracking into test/CMakeLists.txt 2019-10-24 14:47:07 -07:00
docs [Docs] Repurpose 'sources' page as 'contributing'. 2019-10-28 15:03:05 -07:00
examples Revert [heap.py] Add missing declaration for malloc_get_all_zones 2019-08-22 21:01:45 +00:00
include/lldb [LLDB][breakpoints] ArgInfo::count -> ArgInfo::max_positional_args 2019-10-29 15:03:02 -07:00
packages/Python/lldbsuite [lldb] Fix offset intersection bug between MPX and AVX registers 2019-10-31 10:58:17 +01:00
resources [CMake] Revised LLDB.framework builds 2019-01-04 12:46:50 +00:00
scripts [LLDB][breakpoints] ArgInfo::count -> ArgInfo::max_positional_args 2019-10-29 15:03:02 -07:00
source minidump: Create memory regions from the sections of loaded modules 2019-10-31 11:24:55 +01:00
test minidump: Create memory regions from the sections of loaded modules 2019-10-31 11:24:55 +01:00
third_party/Python/module Increase timeout in pexpect to lower chances of tests failing under ASAN. 2019-10-10 16:16:49 +00:00
tools DebugServer: be more lenient about the target triple 2019-10-30 12:08:29 -07:00
unittests [LLDB][Python] warning fix for LLDBSwigPythonBreakpointCallbackFunction 2019-10-30 09:47:27 -07:00
utils [LLDB] Fix inline variable only used in assertion. (NFC) 2019-10-25 15:47:17 -07:00
.arcconfig
.clang-format
.gitignore Add .noindex to the gitignore 2019-04-05 17:57:42 +00:00
CMakeLists.txt build: make standalone builds work again 2019-10-29 08:24:10 -07:00
CODE_OWNERS.txt [lldb][NFC] Cleanup mentions and code related to lldb-mi 2019-07-19 15:55:23 +00:00
LICENSE.TXT Fix typos throughout the license files that somehow I and my reviewers 2019-01-21 09:52:34 +00:00
use_lldb_suite_root.py