forked from qt-creator/qt-creator
PdbEngine: Don't call blocking waitForStarted()
Connect to started() signal instead and continue setup in its handler. Handle failed to start case inside done() signal handler. Change-Id: I9878490e8d30cf189c63800db658afae50141ce0 Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -121,7 +121,8 @@ void PdbEngine::setupEngine()
|
||||
m_interpreter = runParameters().interpreter;
|
||||
QString bridge = ICore::resourcePath("debugger/pdbbridge.py").toString();
|
||||
|
||||
connect(&m_proc, &QtcProcess::finished, this, &PdbEngine::handlePdbDone);
|
||||
connect(&m_proc, &QtcProcess::started, this, &PdbEngine::handlePdbStarted);
|
||||
connect(&m_proc, &QtcProcess::done, this, &PdbEngine::handlePdbDone);
|
||||
connect(&m_proc, &QtcProcess::readyReadStandardOutput, this, &PdbEngine::readPdbStandardOutput);
|
||||
connect(&m_proc, &QtcProcess::readyReadStandardError, this, &PdbEngine::readPdbStandardError);
|
||||
|
||||
@@ -138,15 +139,10 @@ void PdbEngine::setupEngine()
|
||||
m_proc.setEnvironment(runParameters().debugger.environment);
|
||||
m_proc.setCommand(cmd);
|
||||
m_proc.start();
|
||||
}
|
||||
|
||||
if (!m_proc.waitForStarted()) {
|
||||
notifyEngineSetupFailed();
|
||||
showMessage("ADAPTER START FAILED");
|
||||
ICore::showWarningWithOptions(tr("Adapter start failed"), m_proc.exitMessage());
|
||||
notifyEngineSetupFailed();
|
||||
return;
|
||||
}
|
||||
|
||||
void PdbEngine::handlePdbStarted()
|
||||
{
|
||||
notifyEngineSetupOk();
|
||||
QTC_ASSERT(state() == EngineRunRequested, qDebug() << state());
|
||||
|
||||
@@ -416,6 +412,13 @@ QString PdbEngine::errorMessage(QProcess::ProcessError error) const
|
||||
|
||||
void PdbEngine::handlePdbDone()
|
||||
{
|
||||
if (m_proc.result() == ProcessResult::StartFailed) {
|
||||
notifyEngineSetupFailed();
|
||||
showMessage("ADAPTER START FAILED");
|
||||
ICore::showWarningWithOptions(tr("Adapter start failed"), m_proc.exitMessage());
|
||||
return;
|
||||
}
|
||||
|
||||
const QProcess::ProcessError error = m_proc.error();
|
||||
if (error != QProcess::UnknownError) {
|
||||
showMessage("HANDLE PDB ERROR");
|
||||
|
@@ -100,6 +100,7 @@ private:
|
||||
QString errorMessage(QProcess::ProcessError error) const;
|
||||
bool hasCapability(unsigned cap) const override;
|
||||
|
||||
void handlePdbStarted();
|
||||
void handlePdbDone();
|
||||
void readPdbStandardOutput();
|
||||
void readPdbStandardError();
|
||||
|
Reference in New Issue
Block a user