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

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

Issue 556853003: Hard-code the symbolizer path in asan_symbolize.py (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comment Created 6 years, 2 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 14 matching lines...) Expand all
25 25
26 def disable_buffering(): 26 def disable_buffering():
27 """Makes this process and child processes stdout unbuffered.""" 27 """Makes this process and child processes stdout unbuffered."""
28 if not os.environ.get('PYTHONUNBUFFERED'): 28 if not os.environ.get('PYTHONUNBUFFERED'):
29 # Since sys.stdout is a C++ object, it's impossible to do 29 # Since sys.stdout is a C++ object, it's impossible to do
30 # sys.stdout.write = lambda... 30 # sys.stdout.write = lambda...
31 sys.stdout = LineBuffered(sys.stdout) 31 sys.stdout = LineBuffered(sys.stdout)
32 os.environ['PYTHONUNBUFFERED'] = 'x' 32 os.environ['PYTHONUNBUFFERED'] = 'x'
33 33
34 34
35 def set_symbolizer_path():
36 """Set the path to the llvm-symbolize binary in the Chromium source tree."""
37 if not os.environ.get('LLVM_SYMBOLIZER_PATH'):
38 script_dir = os.path.dirname(os.path.abspath(__file__))
39 # Assume this script resides three levels below src/ (i.e.
40 # src/tools/valgrind/asan/).
41 src_root = os.path.join(script_dir, "..", "..", "..")
42 symbolizer_path = os.path.join(src_root, 'third_party',
43 'llvm-build', 'Release+Asserts', 'bin', 'llvm-symbolizer')
44 assert(os.path.isfile(symbolizer_path))
45 os.environ['LLVM_SYMBOLIZER_PATH'] = os.path.abspath(symbolizer_path)
46
47
35 def main(): 48 def main():
36 disable_buffering() 49 disable_buffering()
50 set_symbolizer_path()
37 asan_symbolize.demangle = True 51 asan_symbolize.demangle = True
38 asan_symbolize.fix_filename_patterns = sys.argv[1:] 52 asan_symbolize.fix_filename_patterns = sys.argv[1:]
39 asan_symbolize.logfile = sys.stdin 53 asan_symbolize.logfile = sys.stdin
40 loop = asan_symbolize.SymbolizationLoop() 54 loop = asan_symbolize.SymbolizationLoop()
41 loop.process_logfile() 55 loop.process_logfile()
42 56
43 if __name__ == '__main__': 57 if __name__ == '__main__':
44 main() 58 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