Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1146)

Unified Diff: breakpad/linux/minidump_writer.cc

Issue 113943: Linux Breakpad tweaking to get symbols working.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « breakpad/linux/file_id.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: breakpad/linux/minidump_writer.cc
===================================================================
--- breakpad/linux/minidump_writer.cc (revision 17070)
+++ breakpad/linux/minidump_writer.cc (working copy)
@@ -512,21 +512,36 @@
my_memset(&mod, 0, sizeof(mod));
mod.base_of_image = mapping.start_addr;
mod.size_of_image = mapping.size;
- UntypedMDRVA memory(&minidump_writer_);
- const size_t filename_len = my_strlen(mapping.name);
+ const size_t filepath_len = my_strlen(mapping.name);
- TypedMDRVA<MDCVInfoPDB70> cv(&minidump_writer_);
- if (!cv.Allocate())
+ // 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--;
+ }
+ 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;
+ UntypedMDRVA cv(&minidump_writer_);
+ if (!cv.Allocate(MDCVInfoPDB70_minsize + filename_len + 1))
return false;
- my_memset(cv.get(), 0, sizeof(MDCVInfoPDB70));
- cv.get()->cv_signature = MD_CVINFOPDB70_SIGNATURE;
+ const uint32_t cv_signature = MD_CVINFOPDB70_SIGNATURE;
+ memcpy(cv_ptr, &cv_signature, sizeof(cv_signature));
+ cv_ptr += sizeof(cv_signature);
+
{
// We XOR the first page of the file to get a signature for it.
uint8_t xor_buf[sizeof(MDGUID)];
size_t done = 0;
- uint8_t* const signature = (uint8_t*) &cv.get()->signature;
+ uint8_t* signature = cv_ptr;
+ cv_ptr += sizeof(xor_buf);
+ my_memset(signature, 0, sizeof(xor_buf));
while (done < 4096) {
dumper_.CopyFromProcess(xor_buf, crashing_tid_,
(void *) (mod.base_of_image + done),
@@ -535,16 +550,19 @@
signature[i] ^= xor_buf[i];
done += sizeof(xor_buf);
}
+ cv_ptr += sizeof(uint32_t); // Skip age field
}
+ // Write pdb_file_name
+ memcpy(cv_ptr, filename_ptr, filename_len + 1);
+ cv.Copy(cv_buf, MDCVInfoPDB70_minsize + filename_len + 1);
+
mod.cv_record = cv.location();
- if (filename_len) {
- MDLocationDescriptor ld;
- if (!minidump_writer_.WriteString(mapping.name, filename_len, &ld))
- return false;
- mod.module_name_rva = ld.rva;
- }
+ MDLocationDescriptor ld;
+ if (!minidump_writer_.WriteString(mapping.name, filepath_len, &ld))
+ return false;
+ mod.module_name_rva = ld.rva;
list.CopyIndexAfterObject(j++, &mod, sizeof(mod));
}
« no previous file with comments | « breakpad/linux/file_id.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698