From a98f5de6c1f475d8069ee464fad890d4894aab5e Mon Sep 17 00:00:00 2001 From: hjk Date: Fri, 5 Nov 2021 13:07:45 +0100 Subject: [PATCH] Debugger: Fix LLDB/Python startup for Android Uses the right python version and connects. but the device side keeps saying "Waiting for Debugger". Change-Id: I0bc9dadfa9e12831006cd486984bc29e197d7fbd Reviewed-by: Christian Stenger --- src/plugins/debugger/lldb/lldbengine.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/plugins/debugger/lldb/lldbengine.cpp b/src/plugins/debugger/lldb/lldbengine.cpp index 200579b6dd5..a5440edb7fd 100644 --- a/src/plugins/debugger/lldb/lldbengine.cpp +++ b/src/plugins/debugger/lldb/lldbengine.cpp @@ -213,7 +213,15 @@ void LldbEngine::setupEngine() showMessage("STARTING LLDB: " + lldbCmd.toUserOutput()); Environment environment = runParameters().debugger.environment; environment.appendOrSet("PYTHONUNBUFFERED", "1"); // avoid flushing problem on macOS + if (lldbCmd.path().contains("/ndk-bundle/")) { + FilePath androidPythonDir = lldbCmd.parentDir().parentDir().pathAppended("python3"); + if (HostOsInfo::isAnyUnixHost()) + androidPythonDir = androidPythonDir.pathAppended("bin"); + if (androidPythonDir.exists()) + environment.prependOrSetPath(androidPythonDir.path()); + } m_lldbProc.setEnvironment(environment); + if (runParameters().debugger.workingDirectory.isDir()) m_lldbProc.setWorkingDirectory(runParameters().debugger.workingDirectory);