aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTao Bai <michaelbai@chromium.org>2016-05-03 18:14:28 -0400
committerMark Mentovai <mark@chromium.org>2016-05-03 18:14:28 -0400
commit4f417c8c0ffceb6c2516c6ef00cd91ca5746d852 (patch)
tree974f7d18f7e85b3730052a5e01a2aa3b4150265a /src
parentAdd parentheses to silence clang warning (diff)
downloadbreakpad-4f417c8c0ffceb6c2516c6ef00cd91ca5746d852.tar.xz
Write adjusted range back to module
In Android, the mmap could be overlapped by /dev/ashmem, we adjusted the range in https://breakpad.appspot.com/9744002/, but adjusted range isn't written back to module, this caused the corresponding module be dropped in BasicCodeModules copy constructor. This also fix a lot of 'unable to store module' warnings when dumping Android's minidump. BUG=606972 R=mark@chromium.org, wfh@chromium.org Review URL: https://codereview.chromium.org/1939333002 . Patch from Tao Bai <michaelbai@chromium.org>.
Diffstat (limited to 'src')
-rw-r--r--src/google_breakpad/processor/minidump.h5
-rw-r--r--src/processor/minidump.cc8
2 files changed, 13 insertions, 0 deletions
diff --git a/src/google_breakpad/processor/minidump.h b/src/google_breakpad/processor/minidump.h
index 2b5025e4..5ec2d148 100644
--- a/src/google_breakpad/processor/minidump.h
+++ b/src/google_breakpad/processor/minidump.h
@@ -382,6 +382,11 @@ class MinidumpModule : public MinidumpObject,
const MDRawModule* module() const { return valid_ ? &module_ : NULL; }
+ // This method is intented to handle the case on Android where the module
+ // could overlap with ashmem, and is not supposed to be used in anywhere
+ // else.
+ void set_base_address_and_size(uint64_t base_address, uint64_t size);
+
// CodeModule implementation
virtual uint64_t base_address() const {
return valid_ ? module_.base_of_image : static_cast<uint64_t>(-1);
diff --git a/src/processor/minidump.cc b/src/processor/minidump.cc
index 84f013d0..c026559b 100644
--- a/src/processor/minidump.cc
+++ b/src/processor/minidump.cc
@@ -2327,6 +2327,13 @@ const MDImageDebugMisc* MinidumpModule::GetMiscRecord(uint32_t* size) {
return reinterpret_cast<MDImageDebugMisc*>(&(*misc_record_)[0]);
}
+void MinidumpModule::set_base_address_and_size(uint64_t base_address,
+ uint64_t size) {
+ if (valid_) {
+ module_.base_of_image = base_address;
+ module_.size_of_image = size;
+ }
+}
void MinidumpModule::Print() {
if (!valid_) {
@@ -2635,6 +2642,7 @@ bool MinidumpModuleList::Read(uint32_t expected_size) {
HexString(module_size) << ", after adjusting";
return false;
}
+ module->set_base_address_and_size(base_address, module_size);
} else {
BPLOG(ERROR) << "MinidumpModuleList could not store module " <<
module_index << "/" << module_count << ", " <<