Commit be112d85 authored by Daniel Teske's avatar Daniel Teske

ConsoleProcess: Show correct exit code

Task-number: QTCREATORBUG-9740

Change-Id: I41721356b3612b6c98e774168f520ff49426271b
Reviewed-by: default avatarOswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: default avatarDaniel Teske <daniel.teske@digia.com>
parent 87507893
......@@ -99,7 +99,7 @@ signals:
void processError(const QString &error);
// These reflect the state of the actual client process
void processStarted();
void processStopped();
void processStopped(int, QProcess::ExitStatus);
// These reflect the state of the console+stub
void stubStarted();
......
......@@ -295,12 +295,12 @@ void ConsoleProcess::readStubOutput()
d->m_appStatus = QProcess::NormalExit;
d->m_appCode = out.mid(5).toInt();
d->m_appPid = 0;
emit processStopped();
emit processStopped(d->m_appCode, d->m_appStatus);
} else if (out.startsWith("crash ")) {
d->m_appStatus = QProcess::CrashExit;
d->m_appCode = out.mid(6).toInt();
d->m_appPid = 0;
emit processStopped();
emit processStopped(d->m_appCode, d->m_appStatus);
} else {
emit processError(msgUnexpectedOutput(out));
d->m_stubPid = 0;
......@@ -323,7 +323,7 @@ void ConsoleProcess::stubExited()
d->m_appStatus = QProcess::CrashExit;
d->m_appCode = -1;
d->m_appPid = 0;
emit processStopped(); // Maybe it actually did not, but keep state consistent
emit processStopped(d->m_appCode, d->m_appStatus); // Maybe it actually did not, but keep state consistent
}
emit stubStopped();
}
......
......@@ -261,7 +261,7 @@ void ConsoleProcess::inferiorExited()
cleanupInferior();
d->m_appStatus = QProcess::NormalExit;
d->m_appCode = chldStatus;
emit processStopped();
emit processStopped(d->m_appCode, d->m_appStatus);
}
void ConsoleProcess::cleanupStub()
......@@ -288,7 +288,7 @@ void ConsoleProcess::stubExited()
cleanupInferior();
d->m_appStatus = QProcess::CrashExit;
d->m_appCode = -1;
emit processStopped();
emit processStopped(d->m_appCode, d->m_appStatus);
}
emit stubStopped();
}
......
......@@ -113,8 +113,8 @@ ApplicationLauncher::ApplicationLauncher(QObject *parent)
this, SIGNAL(processStarted()));
connect(&d->m_consoleProcess, SIGNAL(processError(QString)),
this, SLOT(consoleProcessError(QString)));
connect(&d->m_consoleProcess, SIGNAL(processStopped()),
this, SLOT(processStopped()));
connect(&d->m_consoleProcess, SIGNAL(processStopped(int,QProcess::ExitStatus)),
this, SLOT(processDone(int,QProcess::ExitStatus)));
#ifdef Q_OS_WIN
connect(WinDebugInterface::instance(), SIGNAL(cannotRetrieveDebugOutput()),
......@@ -181,7 +181,7 @@ void ApplicationLauncher::stop()
}
} else {
d->m_consoleProcess.stop();
processStopped();
processDone(0, QProcess::CrashExit);
}
}
......@@ -270,11 +270,6 @@ void ApplicationLauncher::checkDebugOutput(qint64 pid, const QString &message)
}
#endif
void ApplicationLauncher::processStopped()
{
emit processExited(0);
}
void ApplicationLauncher::processDone(int exitCode, QProcess::ExitStatus)
{
emit processExited(exitCode);
......
......@@ -75,7 +75,6 @@ signals:
void bringToForegroundRequested(qint64 pid);
private slots:
void processStopped();
void guiProcessError();
void consoleProcessError(const QString &error);
void readStandardOutput();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment