[Lldb-commits] [PATCH] D69105: minidump: Create memory regions from the sections of loaded modules

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu Oct 17 05:26:12 PDT 2019


labath created this revision.
labath added reviewers: amccarth, clayborg.
Herald added a subscriber: mgrang.
labath added parent revisions: D69102: COFF: Set section permissions, D69035: minidump: Refactor memory region computation code.

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.


https://reviews.llvm.org/D69105

Files:
  source/Plugins/Process/minidump/ProcessMinidump.cpp
  test/Shell/Minidump/Inputs/basic-elf.yaml
  test/Shell/Minidump/memory-region-from-module.yaml
  test/Shell/SymbolFile/Breakpad/unwind-via-stack-win-no-memory-info.yaml

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D69105.225409.patch
Type: text/x-patch
Size: 18304 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20191017/781c475a/attachment-0001.bin>


More information about the lldb-commits mailing list