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

Side by Side Diff: build/android/asan_symbolize.py

Issue 1660693002: Add --output-dir flag to third_party/android_platform/development/scripts/stack (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix fix fix Created 4 years, 10 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 | build/android/tombstones.py » ('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/env python 1 #!/usr/bin/env python
2 # 2 #
3 # Copyright 2013 The Chromium Authors. All rights reserved. 3 # Copyright 2013 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 7
8 import collections 8 import collections
9 import optparse 9 import optparse
10 import os 10 import os
11 import re 11 import re
12 import sys 12 import sys
13 13
14 from pylib import constants
14 from pylib.constants import host_paths 15 from pylib.constants import host_paths
15 16
16 # Uses symbol.py from third_party/android_platform, not python's. 17 # Uses symbol.py from third_party/android_platform, not python's.
17 with host_paths.SysPath( 18 with host_paths.SysPath(
18 host_paths.ANDROID_PLATFORM_DEVELOPMENT_SCRIPTS_PATH, 19 host_paths.ANDROID_PLATFORM_DEVELOPMENT_SCRIPTS_PATH,
19 position=0): 20 position=0):
20 import symbol 21 import symbol
21 22
22 23
23 _RE_ASAN = re.compile(r'(.*?)(#\S*?) (\S*?) \((.*?)\+(.*?)\)') 24 _RE_ASAN = re.compile(r'(.*?)(#\S*?) (\S*?) \((.*?)\+(.*?)\)')
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 print '%s%s %s %s' % (m['prefix'], m['pos'], s[0], s[1]) 87 print '%s%s %s %s' % (m['prefix'], m['pos'], s[0], s[1])
87 else: 88 else:
88 print asan_log_line['raw_log'] 89 print asan_log_line['raw_log']
89 90
90 91
91 def main(): 92 def main():
92 parser = optparse.OptionParser() 93 parser = optparse.OptionParser()
93 parser.add_option('-l', '--logcat', 94 parser.add_option('-l', '--logcat',
94 help='File containing adb logcat output with ASan stacks. ' 95 help='File containing adb logcat output with ASan stacks. '
95 'Use stdin if not specified.') 96 'Use stdin if not specified.')
97 parser.add_option('--output-directory',
98 help='Path to the root build directory.')
96 options, _ = parser.parse_args() 99 options, _ = parser.parse_args()
100
101 if options.output_directory:
102 constants.SetOutputDirectory(options.output_directory)
103
97 if options.logcat: 104 if options.logcat:
98 asan_input = file(options.logcat, 'r') 105 asan_input = file(options.logcat, 'r')
99 else: 106 else:
100 asan_input = sys.stdin 107 asan_input = sys.stdin
101 _Symbolize(asan_input.readlines()) 108 _Symbolize(asan_input.readlines())
102 109
103 110
104 if __name__ == "__main__": 111 if __name__ == "__main__":
105 sys.exit(main()) 112 sys.exit(main())
OLDNEW
« no previous file with comments | « no previous file | build/android/tombstones.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698