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

Unified Diff: breakpad/linux/file_id.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 | « no previous file | breakpad/linux/minidump_writer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: breakpad/linux/file_id.cc
===================================================================
--- breakpad/linux/file_id.cc (revision 17070)
+++ breakpad/linux/file_id.cc (working copy)
@@ -34,6 +34,7 @@
#include "breakpad/linux/file_id.h"
+#include <arpa/inet.h>
#include <elf.h>
#include <fcntl.h>
#include <link.h>
@@ -82,12 +83,23 @@
// static
void FileID::ConvertIdentifierToString(const uint8_t identifier[kMDGUIDSize],
char* buffer, int buffer_length) {
+ uint8_t identifier_swapped[kMDGUIDSize];
+
+ // Endian-ness swap to match dump processor expectation.
+ memcpy(identifier_swapped, identifier, kMDGUIDSize);
+ uint32_t* data1 = reinterpret_cast<uint32_t*>(identifier_swapped);
+ *data1 = htonl(*data1);
+ uint16_t* data2 = reinterpret_cast<uint16_t*>(identifier_swapped + 4);
+ *data2 = htons(*data2);
+ uint16_t* data3 = reinterpret_cast<uint16_t*>(identifier_swapped + 6);
+ *data3 = htons(*data3);
+
int buffer_idx = 0;
for (int idx = 0;
(buffer_idx < buffer_length) && (idx < kMDGUIDSize);
++idx) {
- int hi = (identifier[idx] >> 4) & 0x0F;
- int lo = (identifier[idx]) & 0x0F;
+ int hi = (identifier_swapped[idx] >> 4) & 0x0F;
+ int lo = (identifier_swapped[idx]) & 0x0F;
if (idx == 4 || idx == 6 || idx == 8 || idx == 10)
buffer[buffer_idx++] = '-';
« no previous file with comments | « no previous file | breakpad/linux/minidump_writer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698