[lldb] fix -print-script-interpreter-info on windows
authorLawrence D'Anna <larry@elder-gods.org>
Tue, 16 Nov 2021 21:50:18 +0000 (13:50 -0800)
committerLawrence D'Anna <lawrence_danna@apple.com>
Tue, 16 Nov 2021 21:50:20 +0000 (13:50 -0800)
commit4c2cf3a314d9131b1b288e7c8ab0c75ac1b2be1d
tree204b684bb3e3adb769b447893bb130c21e5b5012
parent913d78c40c37c9c3428285d868ce454b058e40f3
[lldb] fix -print-script-interpreter-info on windows

Apparently "{sys.prefix}/bin/python3" isn't where you find the
python interpreter on windows, so the test I wrote for
-print-script-interpreter-info is failing.

We can't rely on sys.executable at runtime, because that will point
to lldb.exe not python.exe.

We can't just record sys.executable from build time, because python
could have been moved to a different location.

But it should be OK to apply relative path from sys.prefix to sys.executable
from build-time to the sys.prefix at runtime.

Reviewed By: JDevlieghere

Differential Revision: https://reviews.llvm.org/D113650
lldb/CMakeLists.txt
lldb/bindings/python/get-python-config.py [new file with mode: 0755]
lldb/source/Plugins/ScriptInterpreter/Python/CMakeLists.txt
lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
lldb/test/API/functionalities/paths/TestPaths.py