Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(2)

Unified Diff: src/client/linux/minidump_writer/minidump_writer.cc

Issue 571003: Set minidump special module debug name for linux-gate at the minidump_writer level instead of linux…
Patch Set: Addressed nits Created 10 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/client/linux/minidump_writer/minidump_writer.cc
diff --git a/src/client/linux/minidump_writer/minidump_writer.cc b/src/client/linux/minidump_writer/minidump_writer.cc
index cee2497eb5543f462e1b27534425a4739c9a5674..ea671a9ee3c3660a840ef9bad7b7f17429936d80 100644
--- a/src/client/linux/minidump_writer/minidump_writer.cc
+++ b/src/client/linux/minidump_writer/minidump_writer.cc
@@ -91,6 +91,7 @@ using google_breakpad::ProcCpuInfoReader;
using google_breakpad::ThreadInfo;
using google_breakpad::TypedMDRVA;
using google_breakpad::UntypedMDRVA;
+using google_breakpad::kLinuxGateLibraryName;
using google_breakpad::wasteful_vector;
// Minidump defines register structures which are different from the raw
@@ -837,8 +838,12 @@ class MinidumpWriter {
return true;
}
- static bool ShouldIncludeMapping(const MappingInfo& mapping) {
- if (mapping.name[0] == 0 || // only want modules with filenames.
+ bool ShouldIncludeMapping(const MappingInfo& mapping) {
+ // Explicitely include the linux gate.
+ if (mapping.start_addr == dumper_->auxv()[AT_SYSINFO_EHDR])
+ return true;
+
+ if (mapping.name[0] != '/' || // only want modules with filenames.
mapping.offset || // only want to include one mapping per shared lib.
mapping.size < 4096) { // too small to get a signature for.
return false;
@@ -930,16 +935,28 @@ class MinidumpWriter {
mod.size_of_image = mapping.size;
const size_t filepath_len = my_strlen(mapping.name);
- // Figure out file name from path
- const char* filename_ptr = mapping.name + filepath_len - 1;
- while (filename_ptr >= mapping.name) {
- if (*filename_ptr == '/')
- break;
- filename_ptr--;
+ const char* filename_ptr;
+ size_t filename_len;
+ // The linux-gate.so kernel mapping in the process doesn't actually show
+ // up in the maps list as a filename, but it can be found using the
+ // AT_SYSINFO_EHDR aux vector entry, which gives the information necessary
+ // to specia case its entry when creating the list of mappings.
+ // See http://www.trilithium.com/johan/2005/08/linux-gate/ for more
+ // information.
+ if (mapping.start_addr == dumper_->auxv()[AT_SYSINFO_EHDR]) {
+ filename_ptr = kLinuxGateLibraryName;
+ filename_len = sizeof(kLinuxGateLibraryName) - 1;
+ } else {
+ // Figure out file name from path
+ filename_ptr = mapping.name + filepath_len - 1;
+ while (filename_ptr >= mapping.name) {
+ if (*filename_ptr == '/')
+ break;
+ filename_ptr--;
+ }
+ filename_ptr++;
+ filename_len = mapping.name + filepath_len - filename_ptr;
}
- filename_ptr++;
-
- const size_t filename_len = mapping.name + filepath_len - filename_ptr;
uint8_t cv_buf[MDCVInfoPDB70_minsize + NAME_MAX];
uint8_t* cv_ptr = cv_buf;
« no previous file with comments | « src/client/linux/minidump_writer/linux_ptrace_dumper_unittest.cc ('k') | src/client/linux/minidump_writer/minidump_writer.h » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld 1004:630ec63f810e-tainted