summaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authormmoss@chromium.org <mmoss@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-12 17:19:16 +0000
committermmoss@chromium.org <mmoss@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-12 17:19:16 +0000
commita6a53d07d4533a2773807a8c64e0ae53e5b415cd (patch)
tree9aa8f5a5e6032b2fb088a4f8fa3bb2c2ebfd9e43 /build
parent01f166a4c2dbedb4f369d09b9d96f66cfeef7fdd (diff)
downloadchromium_src-a6a53d07d4533a2773807a8c64e0ae53e5b415cd.zip
chromium_src-a6a53d07d4533a2773807a8c64e0ae53e5b415cd.tar.gz
chromium_src-a6a53d07d4533a2773807a8c64e0ae53e5b415cd.tar.bz2
Extract breakpad symbol files for Linux official builds.
These are archived and submitted to the crash server by the official builder (coming in a separate buildbot CL). Review URL: http://codereview.chromium.org/126015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18286 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'build')
-rwxr-xr-xbuild/linux/dump_app_syms44
-rwxr-xr-xbuild/linux/dump_signature.py31
2 files changed, 75 insertions, 0 deletions
diff --git a/build/linux/dump_app_syms b/build/linux/dump_app_syms
new file mode 100755
index 0000000..85544be
--- /dev/null
+++ b/build/linux/dump_app_syms
@@ -0,0 +1,44 @@
+#!/bin/sh
+
+# 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.
+#
+# Helper script to run dump_syms on Chrome Linux executables and "fixup" the
+# generated sigs (due to changes to the binary from stripping).
+
+set -e
+
+usage() {
+ echo "$0 <dump_syms_exe> <binary_with_symbols> <symbols_output>"
+}
+
+
+if [ $# -ne 3 ]; then
+ usage
+ exit 1
+fi
+
+SCRIPTDIR="$(readlink -f "$(dirname "$0")")"
+DUMPSYMS="$1"
+INFILE="$2"
+OUTFILE="$3"
+
+STRIPPED=$(mktemp -q -t stripped-XXXXX)
+if [ $? -ne 0 ]; then
+ echo "ERROR: Could not create temp stripped '$INFILE'"
+ exit 1
+fi
+
+# Dump the symbols from the given binary.
+"$DUMPSYMS" "$INFILE" > "$OUTFILE"
+
+# Strip the binary and calculate the signature of that, since that's what ships.
+strip "$INFILE" -o "$STRIPPED"
+NEWSIG=$("$SCRIPTDIR/dump_signature.py" "$STRIPPED")
+rm "$STRIPPED"
+
+# Replace the old signature with the stripped signature in the symbols file.
+INFILE_BASE=$(basename "$INFILE")
+sed -i "1s/[0-9A-F]* $INFILE_BASE/$NEWSIG $INFILE_BASE/" "$OUTFILE"
+
diff --git a/build/linux/dump_signature.py b/build/linux/dump_signature.py
new file mode 100755
index 0000000..779bf85
--- /dev/null
+++ b/build/linux/dump_signature.py
@@ -0,0 +1,31 @@
+#!/usr/bin/python2.4
+#
+# 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
+
+import sys
+
+if len(sys.argv) != 2:
+ sys.stderr.write("Error, no filename specified.\n")
+ sys.exit(1)
+
+bin = open(sys.argv[1])
+data = bin.read(4096)
+if len(data) != 4096:
+ sys.stderr.write("Error, did not read first page of data.\n");
+bin.close()
+
+signature = [0] * 16
+for i in range(0, 4096):
+ signature[i % 16] ^= ord(data[i])
+
+out = ''
+# Assume we're running on little endian
+for i in [3, 2, 1, 0, 5, 4, 7, 6, 8, 9, 10, 11, 12, 13, 14, 15]:
+ out += '%02X' % signature[i]
+out += '0'
+sys.stdout.write(out)