From ea2fb0854556cce9f67790ec3be1828e286e6c14 Mon Sep 17 00:00:00 2001 From: Alexey Samsonov Date: Wed, 19 Sep 2012 11:43:41 +0000 Subject: [PATCH] [ASan] make asan_symbolize script work if there is no llvm-symbolizer available llvm-svn: 164214 --- compiler-rt/lib/asan/scripts/asan_symbolize.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/compiler-rt/lib/asan/scripts/asan_symbolize.py b/compiler-rt/lib/asan/scripts/asan_symbolize.py index 5084b836a5b8..7b79c19f6d5a 100755 --- a/compiler-rt/lib/asan/scripts/asan_symbolize.py +++ b/compiler-rt/lib/asan/scripts/asan_symbolize.py @@ -52,6 +52,8 @@ class LLVMSymbolizer(Symbolizer): self.symbolizer_path = symbolizer_path self.pipe = self.open_llvm_symbolizer() def open_llvm_symbolizer(self): + if not os.path.exists(self.symbolizer_path): + return None cmd = [self.symbolizer_path, "--use-symbol-table=false", # FIXME: Remove this when libObject is # fixed. @@ -65,6 +67,8 @@ class LLVMSymbolizer(Symbolizer): def symbolize(self, addr, binary, offset): """Overrides Symbolizer.symbolize""" + if not self.pipe: + return None result = [] try: symbolizer_input = "%s %s" % (binary, offset)