From fac0e886c8dee6418fcd303c1186518cc51e064d Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Tue, 26 Jun 2018 11:34:13 -0700 Subject: Only do Android-specific adjustments for Android minidumps. Change-Id: I33b1f988766f79b473127c4b56b1c81021b89631 Reviewed-on: https://chromium-review.googlesource.com/1115436 Reviewed-by: Joshua Peraza --- src/processor/minidump.cc | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/processor') diff --git a/src/processor/minidump.cc b/src/processor/minidump.cc index fa21f273..d6309877 100644 --- a/src/processor/minidump.cc +++ b/src/processor/minidump.cc @@ -2725,8 +2725,10 @@ bool MinidumpModuleList::Read(uint32_t expected_size) { return false; } - if (!StoreRange(module, base_address, module_index, module_count)) { - if (base_address >= last_end_address) { + const bool is_android = minidump_->IsAndroid(); + if (!StoreRange(module, base_address, module_index, module_count, + is_android)) { + if (!is_android || base_address >= last_end_address) { BPLOG(ERROR) << "MinidumpModuleList could not store module " << module_index << "/" << module_count << ", " << module.code_file() << ", " << HexString(base_address) @@ -2737,6 +2739,7 @@ bool MinidumpModuleList::Read(uint32_t expected_size) { // If failed due to apparent range overlap the cause may be the client // correction applied for Android packed relocations. If this is the // case, back out the client correction and retry. + assert(is_android); module_size -= last_end_address - base_address; base_address = last_end_address; if (!range_map_->StoreRange(base_address, module_size, module_index)) { @@ -2762,7 +2765,8 @@ bool MinidumpModuleList::Read(uint32_t expected_size) { bool MinidumpModuleList::StoreRange(const MinidumpModule& module, uint64_t base_address, uint32_t module_index, - uint32_t module_count) { + uint32_t module_count, + bool is_android) { if (range_map_->StoreRange(base_address, module.size(), module_index)) return true; @@ -2770,7 +2774,7 @@ bool MinidumpModuleList::StoreRange(const MinidumpModule& module, // entries for JITted code, so ignore these. // TODO(wfh): Remove this code when Android is fixed. // See https://crbug.com/439531 - if (IsDevAshmem(module.code_file())) { + if (is_android && IsDevAshmem(module.code_file())) { BPLOG(INFO) << "MinidumpModuleList ignoring overlapping module " << module_index << "/" << module_count << ", " << module.code_file() << ", " << HexString(base_address) << "+" -- cgit v1.2.1