Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions cross-project-tests/debuginfo-tests/llgdb-tests/llgdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@
# Auto-detect lldb python module.
import subprocess, platform, os, sys

# Set the path to look first for the built lldb (in case it exists).
llvm_libs_dir = os.environ["LLVM_LIBS_DIR"]
built_lldb_path = os.path.join(
llvm_libs_dir,
f"python{sys.version_info.major}.{sys.version_info.minor}",
"site-packages",
)
sys.path.insert(0, built_lldb_path)
try:
# Just try for LLDB in case PYTHONPATH is already correctly setup.
import lldb
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
if (!$my_debugger) {
if ($use_lldb) {
my $path = dirname(Cwd::abs_path($0));
$my_debugger = "/usr/bin/xcrun python3 $path/llgdb.py";
$my_debugger = "LLVM_LIBS_DIR=$ENV{'LLVM_LIBS_DIR'} /usr/bin/xcrun python3 $path/llgdb.py";
} else {
$my_debugger = "gdb";
}
Expand Down
5 changes: 4 additions & 1 deletion cross-project-tests/lit.cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@
tools = [
ToolSubst(
"%test_debuginfo",
command=os.path.join(
command="LLVM_LIBS_DIR="
+ config.llvm_libs_dir
+ " "
+ os.path.join(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why don't we pass in the right python executable and the full path to the LLDB python packages here, then there doesn't need to be any guesswork in the other two files.

config.cross_project_tests_src_root,
"debuginfo-tests",
"llgdb-tests",
Expand Down