forked from qt-creator/qt-creator
Debugger: Consolidate search code for python-path
Not just to deduplicate/reuse code but also to make make it clear that different places where lldb is called, the same preparations have to be done. Change-Id: I104aca845fd7b42f63443bda2502574f4d28b411 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -204,18 +204,6 @@ static QString adapterStartFailed()
|
||||
return LldbEngine::tr("Adapter start failed.");
|
||||
}
|
||||
|
||||
static void addAndroidPythonDir(const FilePath &lldbCmd, Environment &env)
|
||||
{
|
||||
if (!lldbCmd.path().contains("/ndk/") && !lldbCmd.path().contains("/ndk-bundle/"))
|
||||
return;
|
||||
|
||||
FilePath androidPythonDir = lldbCmd.parentDir().parentDir().pathAppended("python3");
|
||||
if (HostOsInfo::isAnyUnixHost())
|
||||
androidPythonDir = androidPythonDir.pathAppended("bin");
|
||||
if (androidPythonDir.exists())
|
||||
env.prependOrSetPath(androidPythonDir.path());
|
||||
}
|
||||
|
||||
void LldbEngine::setupEngine()
|
||||
{
|
||||
QTC_ASSERT(state() == EngineSetupRequested, qDebug() << state());
|
||||
@@ -225,7 +213,7 @@ void LldbEngine::setupEngine()
|
||||
showMessage("STARTING LLDB: " + lldbCmd.toUserOutput());
|
||||
Environment environment = runParameters().debugger.environment;
|
||||
environment.appendOrSet("PYTHONUNBUFFERED", "1"); // avoid flushing problem on macOS
|
||||
addAndroidPythonDir(lldbCmd, environment);
|
||||
DebuggerItem::addAndroidLldbPythonEnv(lldbCmd, environment);
|
||||
m_lldbProc.setEnvironment(environment);
|
||||
|
||||
if (runParameters().debugger.workingDirectory.isDir())
|
||||
|
||||
Reference in New Issue
Block a user