[PATCH] Set symbolizer path in the test environment

Evgeniy Stepanov eugenis at google.com
Tue Mar 12 01:10:44 PDT 2013


Hi ddunbar, samsonov,

This is needed to get symbolized stack traces when running LLVM tests under (A|M)San.

I don't like code duplication, but this seems commonplace in lit.cfg's. I also have an identical patch to Clang (test/ and test/Unit/), if this is deemed acceptable.


http://llvm-reviews.chandlerc.com/D529

Files:
  test/Unit/lit.cfg
  test/lit.cfg

Index: test/Unit/lit.cfg
===================================================================
--- test/Unit/lit.cfg
+++ test/Unit/lit.cfg
@@ -81,3 +81,8 @@
         shlibpath = os.pathsep + shlibpath
     shlibpath = config.shlibdir + shlibpath
     config.environment[config.shlibpath_var] = shlibpath
+
+# Setup paths to llvm-symbolizer for Sanitizer tools.
+llvm_tools_dir = getattr(config, 'llvm_tools_dir', None)
+config.environment['ASAN_SYMBOLIZER_PATH'] = llvm_tools_dir + '/llvm-symbolizer'
+config.environment['MSAN_SYMBOLIZER_PATH'] = llvm_tools_dir + '/llvm-symbolizer'
Index: test/lit.cfg
===================================================================
--- test/lit.cfg
+++ test/lit.cfg
@@ -90,6 +90,11 @@
 config.environment['PYTHON_EXECUTABLE'] = getattr(config, 'python_executable',
                                                   '')
 
+# Setup paths to llvm-symbolizer for Sanitizer tools.
+llvm_tools_dir = getattr(config, 'llvm_tools_dir', None)
+config.environment['ASAN_SYMBOLIZER_PATH'] = llvm_tools_dir + '/llvm-symbolizer'
+config.environment['MSAN_SYMBOLIZER_PATH'] = llvm_tools_dir + '/llvm-symbolizer'
+
 ###
 
 import os
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D529.1.patch
Type: text/x-patch
Size: 1156 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130312/ba805443/attachment.bin>


More information about the llvm-commits mailing list