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

Side by Side Diff: build/linux/dump_signature.py

Issue 126062: Cleanups from post-submit suggestions. (Closed)
Patch Set: more cleanups 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 unified diff | Download patch
« no previous file with comments | « build/linux/dump_app_syms ('k') | chrome/chrome.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/python2.4 1 #!/usr/bin/python2.4
2 # 2 #
3 # Copyright (c) 2009 The Chromium Authors. All rights reserved. 3 # Copyright (c) 2009 The Chromium Authors. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be 4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file. 5 # found in the LICENSE file.
6 # 6 #
7 # This generates symbol signatures with the same algorithm as 7 # This generates symbol signatures with the same algorithm as
8 # src/breakpad/linux/minidump_writer.cc@17081 8 # src/breakpad/linux/minidump_writer.cc@17081
9 9
10 import sys 10 import sys
11 import struct
11 12
12 if len(sys.argv) != 2: 13 if len(sys.argv) != 2:
13 sys.stderr.write("Error, no filename specified.\n") 14 sys.stderr.write("Error, no filename specified.\n")
14 sys.exit(1) 15 sys.exit(1)
15 16
16 bin = open(sys.argv[1]) 17 bin = open(sys.argv[1])
17 data = bin.read(4096) 18 data = bin.read(4096)
18 if len(data) != 4096: 19 if len(data) != 4096:
19 sys.stderr.write("Error, did not read first page of data.\n"); 20 sys.stderr.write("Error, did not read first page of data.\n");
21 sys.exit(1)
20 bin.close() 22 bin.close()
21 23
22 signature = [0] * 16 24 signature = [0] * 16
23 for i in range(0, 4096): 25 for i in range(0, 4096):
24 signature[i % 16] ^= ord(data[i]) 26 signature[i % 16] ^= ord(data[i])
25 27
26 out = '' 28 out = ('%08x%04x%04x%02x%02x%02x%02x%02x%02x%02x%02x0' %
27 # Assume we're running on little endian 29 struct.unpack('I2H8B',struct.pack('16B',*signature)))
Mark Mentovai 2009/06/12 19:12:28 Spaces after commas (you copied/pasted my style er
28 for i in [3, 2, 1, 0, 5, 4, 7, 6, 8, 9, 10, 11, 12, 13, 14, 15]:
29 out += '%02X' % signature[i]
30 out += '0'
31 sys.stdout.write(out) 30 sys.stdout.write(out)
OLDNEW
« no previous file with comments | « build/linux/dump_app_syms ('k') | chrome/chrome.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698