From 6a1a9067734ce1bb29451fc9f03772180c441437 Mon Sep 17 00:00:00 2001 From: "Liu.andrew.x@gmail.com" Date: Tue, 11 Aug 2015 16:05:48 +0000 Subject: [PATCH] Change Print method of MinidumpLinuxMaps and MinidumpLinuxMapsList to print contents of /proc//maps instead of just the files mapped to memory. Review URL: https://codereview.chromium.org/1273123002 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1481 4c0a9323-5329-0410-9bdc-e9ce6186880e --- src/google_breakpad/processor/proc_maps_linux.h | 3 +++ src/processor/minidump.cc | 2 +- src/processor/proc_maps_linux.cc | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/google_breakpad/processor/proc_maps_linux.h b/src/google_breakpad/processor/proc_maps_linux.h index 6ddeb038..22f9f6a4 100644 --- a/src/google_breakpad/processor/proc_maps_linux.h +++ b/src/google_breakpad/processor/proc_maps_linux.h @@ -45,6 +45,9 @@ struct MappedMemoryRegion { // "[heap]" and "[stack]" are used to represent the location of the process' // heap and stack, respectively. string path; + + // The line from /proc//maps that this struct represents. + string line; }; // Parses /proc//maps input data and stores in |regions|. Returns true diff --git a/src/processor/minidump.cc b/src/processor/minidump.cc index 8042f014..02aa16b6 100644 --- a/src/processor/minidump.cc +++ b/src/processor/minidump.cc @@ -4004,7 +4004,7 @@ void MinidumpLinuxMaps::Print() { BPLOG(ERROR) << "MinidumpLinuxMaps cannot print invalid data"; return; } - std::cout << GetPathname() << std::endl; + std::cout << region_.line << std::endl; } // diff --git a/src/processor/proc_maps_linux.cc b/src/processor/proc_maps_linux.cc index 72947286..3730acc3 100644 --- a/src/processor/proc_maps_linux.cc +++ b/src/processor/proc_maps_linux.cc @@ -94,6 +94,7 @@ bool ParseProcMaps(const std::string& input, // Pushing then assigning saves us a string copy. regions.push_back(region); regions.back().path.assign(line + path_index); + regions.back().line.assign(line); } regions_out->swap(regions);