summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Process/minidump/ProcessMinidump.h
diff options
context:
space:
mode:
authorPavel Labath <labath@google.com>2019-10-25 22:18:51 +0000
committerPavel Labath <labath@google.com>2019-10-25 22:33:32 +0000
commit7c603a41e20f461cf38ec7359a9eaa118fc0db5d (patch)
tree8a52586354599f34a64b37d5f6ee1ae008fcc634 /lldb/source/Plugins/Process/minidump/ProcessMinidump.h
parent27fdf8a29d1e0740c342d428fa48eda7b088ac8e (diff)
downloadbcm5719-llvm-7c603a41e20f461cf38ec7359a9eaa118fc0db5d.tar.gz
bcm5719-llvm-7c603a41e20f461cf38ec7359a9eaa118fc0db5d.zip
lldb/minidump: Refactor memory region computation code
The goal of this refactor is to enable ProcessMinidump to take into account the loaded modules and their sections when computing the permissions of various ranges of memory, as discussed in D66638. This patch moves some of the responsibility for computing the ranges from MinidumpParser into ProcessMinidump. MinidumpParser still does the parsing, but ProcessMinidump becomes responsible for answering the actual queries about memory ranges. This will enable it (in a follow-up patch) to augment the information obtained from the parser with data obtained from actual object files. The changes in the actual code are fairly straight-forward and just involve moving code around. MinidumpParser::GetMemoryRegions is renamed to BuildMemoryRegions to emphasize that it does no caching. The only new thing is the additional bool flag returned from this function. This indicates whether the returned regions describe all memory mapped into the target process. Data obtained from /proc/maps and the MemoryInfoList stream is considered to be exhaustive. Data obtained from Memory(64)List is not. This will be used to determine whether we need to augment the data or not. This reshuffle means that it is no longer possible/easy to test some of this code via unit tests, as constructing a ProcessMinidump instance is hard. Instead, I update the unit tests to only test the parsing of the actual data, and test the answering of queries through a lit test using the "memory region" command. The patch also includes some tweaks to the MemoryRegion class to make the unit tests easier to write. Reviewers: amccarth, clayborg Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D69035
Diffstat (limited to 'lldb/source/Plugins/Process/minidump/ProcessMinidump.h')
-rw-r--r--lldb/source/Plugins/Process/minidump/ProcessMinidump.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/lldb/source/Plugins/Process/minidump/ProcessMinidump.h b/lldb/source/Plugins/Process/minidump/ProcessMinidump.h
index 22dc24af7c0..750164cf8aa 100644
--- a/lldb/source/Plugins/Process/minidump/ProcessMinidump.h
+++ b/lldb/source/Plugins/Process/minidump/ProcessMinidump.h
@@ -111,6 +111,9 @@ private:
const minidump::ExceptionStream *m_active_exception;
lldb::CommandObjectSP m_command_sp;
bool m_is_wow64;
+ llvm::Optional<MemoryRegionInfos> m_memory_regions;
+
+ void BuildMemoryRegions();
};
} // namespace minidump
OpenPOWER on IntegriCloud