aboutsummaryrefslogtreecommitdiff
path: root/src/processor/synth_minidump.cc
diff options
context:
space:
mode:
authorJoshua Peraza <jperaza@chromium.org>2016-12-16 12:10:33 -0800
committerJoshua Peraza <jperaza@chromium.org>2016-12-16 20:15:04 +0000
commitc2d969cb1050803961a53cfdbbcff5c69e579ebb (patch)
treed820694a130c38d7ab4898e26db38b13d606434b /src/processor/synth_minidump.cc
parentFix unit tests expecting no output when a microdump is suppressed. (diff)
downloadbreakpad-c2d969cb1050803961a53cfdbbcff5c69e579ebb.tar.xz
Added classes to support reading unloaded module lists in minidumps.
The implementations of Module/UnloadedModule and ModuleList/UnloadedModuleList are very similar. They have been made separate classes because they operate on different structs, complicating factoring code into a base class and have sufficiently different implementation that templates would not be suitable. When unloaded modules have partially overlapping ranges, the module shrink down feature is used to move the start of the higher range to the end of the lower range. If two unloaded modules overlap identically, the second module will not be added to the range map and the failure ignored. Places where MinidumpUnloadedModule differs from MinidumpModule: code_identifier: the android/linux case is deleted since cv_records never exist. debug_file/debug_identifier/version: always return empty strings. Read: an expected size is provided as opposed to MD_MODULE_SIZE. A seek is used if there are extra, unused bytes. Places where MinidumpUnloadedModuleList differs from MinidumpModuleList: Read: entry and header size is provided in the header in addition to count. This changes the checks and handling of padding. Failures from StoreRange are ignored. GetMainModule: always returns NULL. BUG= Change-Id: I52e93d3ccc38483f50a6418fede8b506ec879aaa Reviewed-on: https://chromium-review.googlesource.com/421566 Reviewed-by: Joshua Peraza <jperaza@chromium.org>
Diffstat (limited to 'src/processor/synth_minidump.cc')
-rw-r--r--src/processor/synth_minidump.cc27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/processor/synth_minidump.cc b/src/processor/synth_minidump.cc
index ade150ef..aa86d248 100644
--- a/src/processor/synth_minidump.cc
+++ b/src/processor/synth_minidump.cc
@@ -297,6 +297,26 @@ const MDVSFixedFileInfo Module::stock_version_info = {
0 // file_date_lo
};
+UnloadedModule::UnloadedModule(const Dump &dump,
+ uint64_t base_of_image,
+ uint32_t size_of_image,
+ const String &name,
+ uint32_t checksum,
+ uint32_t time_date_stamp) : Section(dump) {
+ D64(base_of_image);
+ D32(size_of_image);
+ D32(checksum);
+ D32(time_date_stamp);
+ name.CiteStringIn(this);
+}
+
+UnloadedModuleList::UnloadedModuleList(const Dump &dump, uint32_t type)
+ : List<UnloadedModule>(dump, type, false) {
+ D32(sizeof(MDRawUnloadedModuleList));
+ D32(sizeof(MDRawUnloadedModule));
+ D32(count_label_);
+}
+
Exception::Exception(const Dump &dump,
const Context &context,
uint32_t thread_id,
@@ -328,6 +348,7 @@ Dump::Dump(uint64_t flags,
stream_count_(0),
thread_list_(*this, MD_THREAD_LIST_STREAM),
module_list_(*this, MD_MODULE_LIST_STREAM),
+ unloaded_module_list_(*this, MD_UNLOADED_MODULE_LIST_STREAM),
memory_list_(*this, MD_MEMORY_LIST_STREAM)
{
D32(MD_HEADER_SIGNATURE);
@@ -375,9 +396,15 @@ Dump &Dump::Add(Module *module) {
return *this;
}
+Dump &Dump::Add(UnloadedModule *unloaded_module) {
+ unloaded_module_list_.Add(unloaded_module);
+ return *this;
+}
+
void Dump::Finish() {
if (!thread_list_.Empty()) Add(&thread_list_);
if (!module_list_.Empty()) Add(&module_list_);
+ if (!unloaded_module_list_.Empty()) Add(&unloaded_module_list_);
if (!memory_list_.Empty()) Add(&memory_list_);
// Create the stream directory. We don't use