diff options
author | thestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-28 17:57:52 +0000 |
---|---|---|
committer | thestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-28 17:57:52 +0000 |
commit | a8f756f4116b9ffe2dea03c5af97e847704e51a4 (patch) | |
tree | fec2068cd9000975649820056978f0f6f3a09a24 /breakpad/linux/file_id.cc | |
parent | 9941f620af64aafe096b2c6ba5fcebd03d50031d (diff) | |
download | chromium_src-a8f756f4116b9ffe2dea03c5af97e847704e51a4.zip chromium_src-a8f756f4116b9ffe2dea03c5af97e847704e51a4.tar.gz chromium_src-a8f756f4116b9ffe2dea03c5af97e847704e51a4.tar.bz2 |
Linux Breakpad tweaking to get symbols working.
Do endian swapping for the identifier in dump_syms.
Fill in the pdb_file_name (debug_file) field for modules.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/113943
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17081 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'breakpad/linux/file_id.cc')
-rw-r--r-- | breakpad/linux/file_id.cc | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/breakpad/linux/file_id.cc b/breakpad/linux/file_id.cc index 5ba955b..ee0c0c2 100644 --- a/breakpad/linux/file_id.cc +++ b/breakpad/linux/file_id.cc @@ -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 @@ bool FileID::ElfFileIdentifier(uint8_t identifier[kMDGUIDSize]) { // 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++] = '-'; |