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

Unified Diff: build/linux/dump_signature.py

Issue 126015: Extract breakpad symbol files for Linux official builds. (Closed)
Patch Set: shell out to helper script Created 11 years, 6 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
Index: build/linux/dump_signature.py
diff --git a/build/linux/dump_signature.py b/build/linux/dump_signature.py
new file mode 100755
index 0000000000000000000000000000000000000000..779bf85b8e49a5d21f86ba9ddd8d12e8a6446043
--- /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");
Mark Mentovai 2009/06/12 17:30:10 Don't we want sys.exit(1) here too?
+bin.close()
+
+signature = [0] * 16
+for i in range(0, 4096):
+ signature[i % 16] ^= ord(data[i])
+
+out = ''
Mark Mentovai 2009/06/12 17:30:10 I have a better recipe for this, and it's endian-n
+# 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'
Mark Mentovai 2009/06/12 17:30:10 I know what the 0 means, but will others? Put a c
+sys.stdout.write(out)
« build/linux/dump_app_syms ('K') | « build/linux/dump_app_syms ('k') | chrome/chrome.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698