Debugger: Set Python env also for ndk-lldbs outside the SDK

When using an NDK installation which was not installed via an Android
SDK manager, we cannot presume that the included lldb binary has a path
containing "ndk" or "ndk-bundle".

Looking for "/toolchains/llvm/prebuilt/" in the path should detect any
ndk-provided lldb.

Change-Id: Icbaab0915f5877ca37ee44cbca6cc37360363b5c
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
Alessandro Portale
2021-12-05 11:47:06 +01:00
parent 7552c9958f
commit 4aea270790

View File

@@ -267,8 +267,8 @@ void DebuggerItem::reinitializeFromFile(const Environment &sysEnv, QString *erro
bool DebuggerItem::addAndroidLldbPythonEnv(const Utils::FilePath &lldbCmd, Utils::Environment &env) bool DebuggerItem::addAndroidLldbPythonEnv(const Utils::FilePath &lldbCmd, Utils::Environment &env)
{ {
if (lldbCmd.baseName().contains("lldb") && if (lldbCmd.baseName().contains("lldb")
(lldbCmd.path().contains("/ndk/") || lldbCmd.path().contains("/ndk-bundle/"))) { && lldbCmd.path().contains("/toolchains/llvm/prebuilt/")) {
const FilePath pythonDir = lldbCmd.parentDir().parentDir().pathAppended("python3"); const FilePath pythonDir = lldbCmd.parentDir().parentDir().pathAppended("python3");
const FilePath pythonBinDir = const FilePath pythonBinDir =
HostOsInfo::isAnyUnixHost() ? pythonDir.pathAppended("bin") : pythonDir; HostOsInfo::isAnyUnixHost() ? pythonDir.pathAppended("bin") : pythonDir;