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

Unified 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: Created 6 years, 3 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/valgrind/asan/asan_symbolize.py
diff --git a/tools/valgrind/asan/asan_symbolize.py b/tools/valgrind/asan/asan_symbolize.py
index 92849ad3d532330454705a68343e7ade8ad78c65..a99563ec9c6997bcccbbd7ac1a240284db040272 100755
--- a/tools/valgrind/asan/asan_symbolize.py
+++ b/tools/valgrind/asan/asan_symbolize.py
@@ -17,6 +17,7 @@ def fix_filename(file_name):
file_name = re.sub(".*crtstuff.c:0", "???:0", file_name)
return file_name
+
class LineBuffered(object):
"""Disable buffering on a file object."""
def __init__(self, stream):
@@ -40,8 +41,20 @@ def disable_buffering():
os.environ['PYTHONUNBUFFERED'] = 'x'
+def set_symbolizer_path():
+ """Set the path to the llvm-symbolize binary in the Chromium source tree."""
+ if not os.environ.get('LLVM_SYMBOLIZER_PATH'):
+ script_dir = os.path.dirname(os.path.abspath(__file__))
+ # Assuming this script resides in src/tools/valgrind/asan.
Alexander Potapenko 2014/09/19 13:08:06 Can you please assert this and/or check that symbo
+ src_root = os.path.join(script_dir, "..", "..", "..")
+ symbolizer_path = os.path.join(src_root, 'third_party',
+ 'llvm-build', 'Release+Asserts', 'bin', 'llvm-symbolizer')
+ os.environ['LLVM_SYMBOLIZER_PATH'] = os.path.abspath(symbolizer_path)
+
+
def main():
disable_buffering()
+ set_symbolizer_path()
asan_symbolize.demangle = True
loop = asan_symbolize.SymbolizationLoop(binary_name_filter=fix_filename)
loop.process_stdin()
« 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