[ASan] make asan_symbolize script work if there is no llvm-symbolizer available

llvm-svn: 164214
This commit is contained in:
Alexey Samsonov 2012-09-19 11:43:41 +00:00
parent ff9b5a8465
commit ea2fb08545
1 changed files with 4 additions and 0 deletions

View File

@ -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)