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

Side by Side Diff: tools/valgrind/asan/asan_symbolize.py

Issue 819403003: Fix assertion condition in asan_symbolize.py. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 12 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 | « no previous file | no next file » | 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/env python 1 #!/usr/bin/env python
2 2
3 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 3 # Copyright (c) 2012 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 from third_party import asan_symbolize 7 from third_party import asan_symbolize
8 8
9 import os 9 import os
10 import sys 10 import sys
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 framework_positions.append(index) 70 framework_positions.append(index)
71 bundle_positions = app_positions + framework_positions 71 bundle_positions = app_positions + framework_positions
72 bundle_positions.sort() 72 bundle_positions.sort()
73 assert len(bundle_positions) <= 2, \ 73 assert len(bundle_positions) <= 2, \
74 "The path contains more than two nested bundles: %s" % binary 74 "The path contains more than two nested bundles: %s" % binary
75 if len(bundle_positions) == 0: 75 if len(bundle_positions) == 0:
76 # Case 1: this is a standalone executable or dylib. 76 # Case 1: this is a standalone executable or dylib.
77 return [] 77 return []
78 assert (not (len(app_positions) == 1 and 78 assert (not (len(app_positions) == 1 and
79 len(framework_positions) == 1 and 79 len(framework_positions) == 1 and
80 app_positions[0] < framework_positions[0])), \ 80 app_positions[0] > framework_positions[0])), \
81 "The path contains an app bundle inside a framework: %s" % binary 81 "The path contains an app bundle inside a framework: %s" % binary
82 # Cases 2 and 3. The outermost bundle (which is the only bundle in the case 2) 82 # Cases 2 and 3. The outermost bundle (which is the only bundle in the case 2)
83 # is located in the product dir. 83 # is located in the product dir.
84 outermost_bundle = bundle_positions[0] 84 outermost_bundle = bundle_positions[0]
85 product_dir = path_parts[:outermost_bundle] 85 product_dir = path_parts[:outermost_bundle]
86 # In case 2 this is the same as |outermost_bundle|. 86 # In case 2 this is the same as |outermost_bundle|.
87 innermost_bundle = bundle_positions[-1] 87 innermost_bundle = bundle_positions[-1]
88 dsym_path = product_dir + [path_parts[innermost_bundle]] 88 dsym_path = product_dir + [path_parts[innermost_bundle]]
89 result = '%s.dSYM' % os.path.sep.join(dsym_path) 89 result = '%s.dSYM' % os.path.sep.join(dsym_path)
90 return [result] 90 return [result]
91 91
92 92
93 def main(): 93 def main():
94 disable_buffering() 94 disable_buffering()
95 set_symbolizer_path() 95 set_symbolizer_path()
96 asan_symbolize.demangle = True 96 asan_symbolize.demangle = True
97 asan_symbolize.fix_filename_patterns = sys.argv[1:] 97 asan_symbolize.fix_filename_patterns = sys.argv[1:]
98 asan_symbolize.logfile = sys.stdin 98 asan_symbolize.logfile = sys.stdin
99 loop = asan_symbolize.SymbolizationLoop(dsym_hint_producer=chrome_dsym_hints) 99 loop = asan_symbolize.SymbolizationLoop(dsym_hint_producer=chrome_dsym_hints)
100 loop.process_logfile() 100 loop.process_logfile()
101 101
102 if __name__ == '__main__': 102 if __name__ == '__main__':
103 main() 103 main()
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698