Skip to content
Snippets Groups Projects
Commit 81786c24 authored by agl@chromium.org's avatar agl@chromium.org
Browse files

Update dump_symbols to match new file_id code.

The way that breakpad calculates module ids has changed so we need to change
our tools to match.

(Note. The original change accidently landed with another change in r43662 so
this is just the review changes.)

http://codereview.chromium.org/1508019

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@43672 0039d316-1c4b-4281-b951-d872f2087c98
parent 53574b2f
No related merge requests found
#!/usr/bin/python
#
# Copyright (c) 2009 The Chromium Authors. All rights reserved.
# Copyright (c) 2010 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/src/common/linux/file_id.cc@461
import sys
import struct
import sys
import subprocess
if len(sys.argv) != 2:
......@@ -22,12 +22,17 @@ 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]
text_section = [x for x in sections.splitlines() 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)
try:
file_offset = int(text_section.split()[5], 16)
except ValueError:
sys.stderr.write("Failed to parse objdump output. Here is the failing line:\n");
sys.stderr.write(text_section)
sys.exit(1)
bin = open(sys.argv[1])
bin.seek(file_offset)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment