mirror of https://github.com/snare/voltron.git
add a function to get lldb's python exe
This commit is contained in:
parent
581c9c85ec
commit
9121d4b066
23
install.sh
23
install.sh
|
@ -131,6 +131,29 @@ function install_packages {
|
|||
install_yum
|
||||
}
|
||||
|
||||
function get_lldb_python_exe {
|
||||
# Find the Python version used by LLDB
|
||||
local lldb_pyver=$(${LLDB} -Q -x -b --one-line 'script import platform; print(".".join(platform.python_version_tuple()[:2]))'|tail -1)
|
||||
local lldb_python=$(${LLDB} -Q -x -b --one-line 'script import sys; print(sys.executable)'|tail -1)
|
||||
|
||||
lldb_python=$(${LLDB} -Q -x -b --one-line 'script import sys; print(sys.executable)'|tail -1)
|
||||
local lldb_python_basename=$(basename "${lldb_python}")
|
||||
if [ "python" = "$lldb_python_basename" ];
|
||||
then
|
||||
lldb_python="${lldb_python/%$lldb_pyver/}${lldb_pyver}"
|
||||
elif [ "lldb" = "$lldb_python_basename" ];
|
||||
then
|
||||
# newer lldb versions report sys.path as /path/to/lldb instead of python
|
||||
# sys.exec_path still appears to be the parent path of bin/python though
|
||||
local lldb_python_exec_prefix=$(${LLDB} -Q -x -b --one-line 'script import sys; print(sys.exec_prefix)'|tail -1)
|
||||
lldb_python="$lldb_python_exec_prefix/bin/python"
|
||||
lldb_python="${lldb_python/%$lldb_pyver/}${lldb_pyver}"
|
||||
fi
|
||||
|
||||
echo "$lldb_python"
|
||||
|
||||
}
|
||||
|
||||
if [ "${BACKEND_GDB}" -eq 1 ]; then
|
||||
# Find the Python version used by GDB
|
||||
GDB_PYVER=$(${GDB} -batch -q --nx -ex 'pi import platform; print(".".join(platform.python_version_tuple()[:2]))')
|
||||
|
|
Loading…
Reference in New Issue