File tree Expand file tree Collapse file tree 3 files changed +19
-10
lines changed
debuginfo-tests/llgdb-tests Expand file tree Collapse file tree 3 files changed +19
-10
lines changed Original file line number Diff line number Diff line change 99import subprocess , platform , os , sys
1010
1111# Set the path to look first for the built lldb (in case it exists).
12- llvm_libs_dir = os .environ ["LLVM_LIBS_DIR" ]
13- built_lldb_path = os .path .join (
14- llvm_libs_dir ,
15- f"python{ sys .version_info .major } .{ sys .version_info .minor } " ,
16- "site-packages" ,
17- )
18- sys .path .insert (0 , built_lldb_path )
12+ lldb_python_path = os .environ ["LLDB_PYTHON_PATH" ]
13+ if len (lldb_python_path ) > 0 :
14+ sys .path .insert (0 , lldb_python_path )
15+
1916try :
2017 # Just try for LLDB in case PYTHONPATH is already correctly setup.
2118 import lldb
Original file line number Diff line number Diff line change 5656if (!$my_debugger ) {
5757 if ($use_lldb ) {
5858 my $path = dirname(Cwd::abs_path($0 ));
59- $my_debugger = " LLVM_LIBS_DIR=$ENV {'LLVM_LIBS_DIR'} /usr/bin/xcrun python3 $path /llgdb.py" ;
59+ my $python_exec_path = $ENV {' PYTHON_EXEC_PATH' };
60+ if (!$python_exec_path ) {
61+ $python_exec_path = ' python3' ;
62+ }
63+ $my_debugger = " LLDB_PYTHON_PATH=$ENV {'LLDB_PYTHON_PATH'} /usr/bin/xcrun $python_exec_path $path /llgdb.py" ;
6064 } else {
6165 $my_debugger = " gdb" ;
6266 }
Original file line number Diff line number Diff line change 3434
3535llvm_config .use_default_substitutions ()
3636
37+ lldb_python_path = os .path .join (
38+ config .llvm_libs_dir ,
39+ f"python{ sys .version_info .major } .{ sys .version_info .minor } " ,
40+ "site-packages" ,
41+ )
42+ python_exec_path = sys .executable
3743tools = [
3844 ToolSubst (
3945 "%test_debuginfo" ,
40- command = "LLVM_LIBS_DIR="
41- + config .llvm_libs_dir
46+ command = "PYTHON_EXEC_PATH="
47+ + python_exec_path
48+ + " LLDB_PYTHON_PATH="
49+ + lldb_python_path
4250 + " "
4351 + os .path .join (
4452 config .cross_project_tests_src_root ,
You can’t perform that action at this time.
0 commit comments