DAP: Fix python debug stoping

Change-Id: I49ac6d9d7164a7f74fe683840734d903643b3561
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Artem Sokolovskii
2023-09-06 11:23:59 +02:00
parent 1b67da6558
commit 68d12f0724
2 changed files with 18 additions and 0 deletions

View File

@@ -177,6 +177,22 @@ void PyDapEngine::handleDapInitialize()
qCDebug(dapEngineLog) << "handleDapAttach";
}
void PyDapEngine::quitDebugger()
{
showMessage(QString("QUIT DEBUGGER REQUESTED IN STATE %1").arg(state()));
startDying();
// Temporary workaround for Python debugging instability, particularly
// in conjunction with PySide6, due to unreliable pause functionality.
if (state() == InferiorRunOk) {
setState(InferiorStopRequested);
notifyInferiorStopOk();
return;
}
DebuggerEngine::quitDebugger();
}
void installDebugpyPackage(const FilePath &pythonPath)
{
CommandLine cmd{pythonPath, {"-m", "pip", "install", "debugpy"}};

View File

@@ -14,6 +14,8 @@ public:
private:
void handleDapInitialize() override;
void quitDebugger() override;
void setupEngine() override;
Utils::Process m_proc;
};