diff options
author | agl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-05 22:19:33 +0000 |
---|---|---|
committer | agl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-05 22:19:33 +0000 |
commit | 3e96bbfa971e55710be27dfc35ab66568ea054cd (patch) | |
tree | 74476259c1e832c5264278b31958e7ac6781c73c /build/linux | |
parent | 0f648dfa81b65e9fedf3b612a4d8e3a1ae024f2e (diff) | |
download | chromium_src-3e96bbfa971e55710be27dfc35ab66568ea054cd.zip chromium_src-3e96bbfa971e55710be27dfc35ab66568ea054cd.tar.gz chromium_src-3e96bbfa971e55710be27dfc35ab66568ea054cd.tar.bz2 |
Fix breakpad (again)
I had left over .o files in my out/ directory so the last change didn't catch
everything.
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@43662 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'build/linux')
-rwxr-xr-x | build/linux/dump_signature.py | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/build/linux/dump_signature.py b/build/linux/dump_signature.py index 9ba865a..63180d0 100755 --- a/build/linux/dump_signature.py +++ b/build/linux/dump_signature.py @@ -1,20 +1,40 @@ -#!/usr/bin/python2.4 +#!/usr/bin/python # # Copyright (c) 2009 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. # # This generates symbol signatures with the same algorithm as -# src/breakpad/linux/minidump_writer.cc@17081 +# src/breakpad/src/common/linux/file_id.cc@461 import sys import struct +import subprocess if len(sys.argv) != 2: sys.stderr.write("Error, no filename specified.\n") sys.exit(1) +# Shell out to objdump to get the offset of the .text section +objdump = subprocess.Popen(['objdump', '-h', sys.argv[1]], stdout = subprocess.PIPE) +(sections, _) = objdump.communicate() +if objdump.returncode != 0: + sys.stderr.write('Failed to run objdump to find .text section.\n') + sys.exit(1) + +text_section = [x for x in sections.split('\n') if '.text' in x] +if len(text_section) == 0: + sys.stderr.write('objdump failed to find a .text section.\n') + sys.exit(1) +text_section = text_section[0] +file_offset = int(text_section.split()[5], 16) + bin = open(sys.argv[1]) +bin.seek(file_offset) +if bin.tell() != file_offset: + sys.stderr.write("Failed to seek to the .text segment. Truncated file?\n"); + sys.exit(1) + data = bin.read(4096) if len(data) != 4096: sys.stderr.write("Error, did not read first page of data.\n"); |