Commit e5e86931 authored by hjk's avatar hjk

Debugger: Merge two remote setup communication paths

Success and failure paths are very similar.

Change-Id: Iebf218f64401884c014f1f7745d504183018addd
Reviewed-by: default avatarhjk <hjk121@nokiamail.com>
parent ea6514b2
...@@ -186,7 +186,11 @@ void AndroidDebugSupport::handleRemoteProcessStarted(int gdbServerPort, int qmlP ...@@ -186,7 +186,11 @@ void AndroidDebugSupport::handleRemoteProcessStarted(int gdbServerPort, int qmlP
disconnect(m_runner, &AndroidRunner::remoteProcessStarted, disconnect(m_runner, &AndroidRunner::remoteProcessStarted,
this, &AndroidDebugSupport::handleRemoteProcessStarted); this, &AndroidDebugSupport::handleRemoteProcessStarted);
QTC_ASSERT(m_engine, return); QTC_ASSERT(m_engine, return);
m_engine->notifyEngineRemoteSetupDone(gdbServerPort, qmlPort); RemoteSetupResult result;
result.success = true;
result.gdbServerPort = gdbServerPort;
result.qmlServerPort = qmlPort;
m_engine->notifyEngineRemoteSetupFinished(result);
} }
} // namespace Internal } // namespace Internal
......
...@@ -830,10 +830,8 @@ void DebuggerEngine::notifyEngineRemoteServerRunning(const QByteArray &, int /*p ...@@ -830,10 +830,8 @@ void DebuggerEngine::notifyEngineRemoteServerRunning(const QByteArray &, int /*p
showMessage(_("NOTE: REMOTE SERVER RUNNING IN MULTIMODE")); showMessage(_("NOTE: REMOTE SERVER RUNNING IN MULTIMODE"));
} }
void DebuggerEngine::notifyEngineRemoteSetupDone(int gdbServerPort, int qmlPort) void DebuggerEngine::notifyEngineRemoteSetupFinished(const RemoteSetupResult &result)
{ {
showMessage(_("NOTE: REMOTE SETUP DONE: GDB SERVER PORT: %1 QML PORT %2")
.arg(gdbServerPort).arg(qmlPort));
QTC_ASSERT(state() == EngineSetupRequested QTC_ASSERT(state() == EngineSetupRequested
|| state() == EngineSetupFailed || state() == EngineSetupFailed
|| state() == DebuggerFinished, qDebug() << this << state()); || state() == DebuggerFinished, qDebug() << this << state());
...@@ -842,22 +840,15 @@ void DebuggerEngine::notifyEngineRemoteSetupDone(int gdbServerPort, int qmlPort) ...@@ -842,22 +840,15 @@ void DebuggerEngine::notifyEngineRemoteSetupDone(int gdbServerPort, int qmlPort)
|| d->remoteSetupState() == RemoteSetupCancelled, || d->remoteSetupState() == RemoteSetupCancelled,
qDebug() << this << "remoteSetupState" << d->remoteSetupState()); qDebug() << this << "remoteSetupState" << d->remoteSetupState());
if (d->remoteSetupState() == RemoteSetupCancelled) if (result.success) {
return; showMessage(_("NOTE: REMOTE SETUP DONE: GDB SERVER PORT: %1 QML PORT %2")
.arg(result.gdbServerPort).arg(result.qmlServerPort));
d->setRemoteSetupState(RemoteSetupSucceeded);
}
void DebuggerEngine::notifyEngineRemoteSetupFailed(const QString &message) if (d->remoteSetupState() != RemoteSetupCancelled)
{ d->setRemoteSetupState(RemoteSetupSucceeded);
showMessage(_("NOTE: REMOTE SETUP FAILED: ") + message); } else {
QTC_ASSERT(state() == EngineSetupRequested showMessage(_("NOTE: REMOTE SETUP FAILED: ") + result.reason);
|| state() == EngineSetupFailed }
|| state() == DebuggerFinished, qDebug() << this << state());
QTC_ASSERT(d->remoteSetupState() == RemoteSetupRequested
|| d->remoteSetupState() == RemoteSetupCancelled,
qDebug() << this << "remoteSetupState" << d->remoteSetupState());
} }
void DebuggerEngine::notifyEngineRunOkAndInferiorRunRequested() void DebuggerEngine::notifyEngineRunOkAndInferiorRunRequested()
......
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
#include "debugger_global.h" #include "debugger_global.h"
#include "debuggerconstants.h" #include "debuggerconstants.h"
#include "debuggerstartparameters.h"
#include "breakpoint.h" // For BreakpointModelId. #include "breakpoint.h" // For BreakpointModelId.
#include "threaddata.h" // For ThreadId. #include "threaddata.h" // For ThreadId.
#include "coreplugin/variablemanager.h" #include "coreplugin/variablemanager.h"
...@@ -278,8 +279,8 @@ signals: ...@@ -278,8 +279,8 @@ signals:
/* /*
* For "external" clients of a debugger run control that needs to do * For "external" clients of a debugger run control that needs to do
* further setup before the debugger is started (e.g. RemoteLinux). * further setup before the debugger is started (e.g. RemoteLinux).
* Afterwards, notifyEngineRemoteSetupDone() or notifyEngineRemoteSetupFailed() * Afterwards, notifyEngineRemoteSetupFinished
* must be called to continue or abort debugging, respectively. * must be called to continue or abort debugging.
* This signal is only emitted if the start parameters indicate that * This signal is only emitted if the start parameters indicate that
* a server start script should be used, but none is given. * a server start script should be used, but none is given.
*/ */
...@@ -296,8 +297,7 @@ protected: ...@@ -296,8 +297,7 @@ protected:
virtual void notifyEngineRequestRemoteSetup(); virtual void notifyEngineRequestRemoteSetup();
public: public:
virtual void notifyEngineRemoteServerRunning(const QByteArray &, int pid); virtual void notifyEngineRemoteServerRunning(const QByteArray &, int pid);
virtual void notifyEngineRemoteSetupDone(int gdbServerPort, int qmlPort); virtual void notifyEngineRemoteSetupFinished(const RemoteSetupResult &result);
virtual void notifyEngineRemoteSetupFailed(const QString &message);
protected: protected:
virtual void notifyInferiorSetupOk(); virtual void notifyInferiorSetupOk();
......
...@@ -47,6 +47,26 @@ namespace Debugger { ...@@ -47,6 +47,26 @@ namespace Debugger {
// Note: This is part of the "soft interface" of the debugger plugin. // Note: This is part of the "soft interface" of the debugger plugin.
// Do not add anything that needs implementation in a .cpp file. // Do not add anything that needs implementation in a .cpp file.
const int InvalidPort = -1;
const int InvalidPid = -1;
class DEBUGGER_EXPORT RemoteSetupResult
{
public:
RemoteSetupResult()
: gdbServerPort(InvalidPort),
qmlServerPort(InvalidPort),
inferiorPid(InvalidPid),
success(false)
{}
int gdbServerPort;
int qmlServerPort;
int inferiorPid;
bool success;
QString reason;
};
class DEBUGGER_EXPORT DebuggerStartParameters class DEBUGGER_EXPORT DebuggerStartParameters
{ {
public: public:
...@@ -156,6 +176,7 @@ bool fillParameters(DebuggerStartParameters *sp, const ProjectExplorer::Kit *kit ...@@ -156,6 +176,7 @@ bool fillParameters(DebuggerStartParameters *sp, const ProjectExplorer::Kit *kit
} // namespace Internal } // namespace Internal
} // namespace Debugger } // namespace Debugger
Q_DECLARE_METATYPE(Debugger::RemoteSetupResult)
Q_DECLARE_METATYPE(Debugger::DebuggerStartParameters) Q_DECLARE_METATYPE(Debugger::DebuggerStartParameters)
#endif // DEBUGGER_DEBUGGERSTARTPARAMETERS_H #endif // DEBUGGER_DEBUGGERSTARTPARAMETERS_H
......
...@@ -153,10 +153,14 @@ void GdbRemoteServerEngine::readUploadStandardError() ...@@ -153,10 +153,14 @@ void GdbRemoteServerEngine::readUploadStandardError()
void GdbRemoteServerEngine::uploadProcFinished() void GdbRemoteServerEngine::uploadProcFinished()
{ {
if (m_uploadProc.exitStatus() == QProcess::NormalExit if (m_uploadProc.exitStatus() == QProcess::NormalExit
&& m_uploadProc.exitCode() == 0) && m_uploadProc.exitCode() == 0) {
startGdb(); startGdb();
else } else {
notifyEngineRemoteSetupFailed(m_uploadProc.errorString()); RemoteSetupResult result;
result.success = false;
result.reason = m_uploadProc.errorString();
notifyEngineRemoteSetupFinished(result);
}
} }
void GdbRemoteServerEngine::setupInferior() void GdbRemoteServerEngine::setupInferior()
...@@ -475,24 +479,29 @@ void GdbRemoteServerEngine::notifyEngineRemoteServerRunning ...@@ -475,24 +479,29 @@ void GdbRemoteServerEngine::notifyEngineRemoteServerRunning
startGdb(); startGdb();
} }
void GdbRemoteServerEngine::notifyEngineRemoteSetupDone(int gdbServerPort, int qmlPort) void GdbRemoteServerEngine::notifyEngineRemoteSetupFinished(const RemoteSetupResult &result)
{ {
QTC_ASSERT(state() == EngineSetupRequested, qDebug() << state()); QTC_ASSERT(state() == EngineSetupRequested, qDebug() << state());
DebuggerEngine::notifyEngineRemoteSetupDone(gdbServerPort, qmlPort); DebuggerEngine::notifyEngineRemoteSetupFinished(result);
if (!result.success) {
handleAdapterStartFailed(result.reason);
return;
}
DebuggerStartParameters &params = isMasterEngine() DebuggerStartParameters &params = isMasterEngine()
? startParameters() : masterEngine()->startParameters(); ? startParameters() : masterEngine()->startParameters();
if (gdbServerPort != -1) { if (result.gdbServerPort != -1) {
QString &rc = params.remoteChannel; QString &rc = params.remoteChannel;
const int sepIndex = rc.lastIndexOf(QLatin1Char(':')); const int sepIndex = rc.lastIndexOf(QLatin1Char(':'));
if (sepIndex != -1) { if (sepIndex != -1) {
rc.replace(sepIndex + 1, rc.count() - sepIndex - 1, rc.replace(sepIndex + 1, rc.count() - sepIndex - 1,
QString::number(gdbServerPort)); QString::number(result.gdbServerPort));
} }
} }
if (qmlPort != -1) { if (result.qmlServerPort != -1) {
params.qmlServerPort = qmlPort; params.qmlServerPort = result.qmlServerPort;
params.processArgs.replace(_("%qml_port%"), QString::number(qmlPort)); params.processArgs.replace(_("%qml_port%"), QString::number(result.qmlServerPort));
} }
// TODO: Aren't these redundant? // TODO: Aren't these redundant?
...@@ -503,12 +512,5 @@ void GdbRemoteServerEngine::notifyEngineRemoteSetupDone(int gdbServerPort, int q ...@@ -503,12 +512,5 @@ void GdbRemoteServerEngine::notifyEngineRemoteSetupDone(int gdbServerPort, int q
startGdb(); startGdb();
} }
void GdbRemoteServerEngine::notifyEngineRemoteSetupFailed(const QString &reason)
{
QTC_ASSERT(state() == EngineSetupRequested, qDebug() << state());
DebuggerEngine::notifyEngineRemoteSetupFailed(reason);
handleAdapterStartFailed(reason);
}
} // namespace Internal } // namespace Internal
} // namespace Debugger } // namespace Debugger
...@@ -74,9 +74,8 @@ private: ...@@ -74,9 +74,8 @@ private:
Q_SLOT void uploadProcFinished(); Q_SLOT void uploadProcFinished();
Q_SLOT void callTargetRemote(); Q_SLOT void callTargetRemote();
void notifyEngineRemoteSetupDone(int gdbServerPort, int qmlPort);
void notifyEngineRemoteSetupFailed(const QString &reason);
void notifyEngineRemoteServerRunning(const QByteArray &serverChannel, int inferiorPid); void notifyEngineRemoteServerRunning(const QByteArray &serverChannel, int inferiorPid);
void notifyEngineRemoteSetupFinished(const RemoteSetupResult &result);
void notifyInferiorSetupOk(); void notifyInferiorSetupOk();
void handleSetTargetAsync(const GdbResponse &response); void handleSetTargetAsync(const GdbResponse &response);
......
...@@ -1337,39 +1337,37 @@ DebuggerEngine *createLldbEngine(const DebuggerStartParameters &startParameters) ...@@ -1337,39 +1337,37 @@ DebuggerEngine *createLldbEngine(const DebuggerStartParameters &startParameters)
return new LldbEngine(startParameters); return new LldbEngine(startParameters);
} }
void LldbEngine::notifyEngineRemoteSetupDone(int portOrPid, int qmlPort) void LldbEngine::notifyEngineRemoteSetupFinished(const RemoteSetupResult &result)
{ {
QTC_ASSERT(state() == EngineSetupRequested, qDebug() << state()); QTC_ASSERT(state() == EngineSetupRequested, qDebug() << state());
DebuggerEngine::notifyEngineRemoteSetupDone(portOrPid, qmlPort); DebuggerEngine::notifyEngineRemoteSetupFinished(result);
if (qmlPort != -1) if (!result.success) {
startParameters().qmlServerPort = qmlPort; showMessage(_("ADAPTER START FAILED"));
if (portOrPid != -1) { if (!result.reason.isEmpty()) {
const QString title = tr("Adapter start failed");
Core::ICore::showWarningWithOptions(title, result.reason);
}
notifyEngineSetupFailed();
return;
}
if (result.qmlServerPort != InvalidPort)
startParameters().qmlServerPort = result.qmlServerPort;
if (result.inferiorPid != InvalidPid) {
if (startParameters().startMode == AttachExternal) { if (startParameters().startMode == AttachExternal) {
startParameters().attachPID = portOrPid; startParameters().attachPID = result.inferiorPid;
} else { } else {
QString &rc = startParameters().remoteChannel; QString &rc = startParameters().remoteChannel;
const int sepIndex = rc.lastIndexOf(QLatin1Char(':')); const int sepIndex = rc.lastIndexOf(QLatin1Char(':'));
if (sepIndex != -1) if (sepIndex != -1)
rc.replace(sepIndex + 1, rc.count() - sepIndex - 1, rc.replace(sepIndex + 1, rc.count() - sepIndex - 1,
QString::number(portOrPid)); QString::number(result.inferiorPid));
} }
} }
startLldb(); startLldb();
} }
void LldbEngine::notifyEngineRemoteSetupFailed(const QString &reason)
{
QTC_ASSERT(state() == EngineSetupRequested, qDebug() << state());
DebuggerEngine::notifyEngineRemoteSetupFailed(reason);
showMessage(_("ADAPTER START FAILED"));
if (!reason.isEmpty()) {
const QString title = tr("Adapter start failed");
Core::ICore::showWarningWithOptions(title, reason);
}
notifyEngineSetupFailed();
}
/////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////
// //
// Command // Command
......
...@@ -196,8 +196,7 @@ private: ...@@ -196,8 +196,7 @@ private:
void handleUpdateStack(const QByteArray &response); void handleUpdateStack(const QByteArray &response);
void handleUpdateThreads(const QByteArray &response); void handleUpdateThreads(const QByteArray &response);
void notifyEngineRemoteSetupDone(int portOrPid, int qmlPort); void notifyEngineRemoteSetupFinished(const RemoteSetupResult &result);
void notifyEngineRemoteSetupFailed(const QString &reason);
void handleChildren(const WatchData &data0, const GdbMi &item, void handleChildren(const WatchData &data0, const GdbMi &item,
QList<WatchData> *list); QList<WatchData> *list);
......
...@@ -744,22 +744,13 @@ void QmlCppEngine::slaveEngineStateChanged ...@@ -744,22 +744,13 @@ void QmlCppEngine::slaveEngineStateChanged
} }
} }
void QmlCppEngine::notifyEngineRemoteSetupDone(int gdbServerPort, int qmlPort) void QmlCppEngine::notifyEngineRemoteSetupFinished(const RemoteSetupResult &result)
{ {
EDEBUG("MASTER REMOTE SETUP DONE"); EDEBUG("MASTER REMOTE SETUP FINISHED");
DebuggerEngine::notifyEngineRemoteSetupDone(gdbServerPort, qmlPort); DebuggerEngine::notifyEngineRemoteSetupFinished(result);
cppEngine()->notifyEngineRemoteSetupDone(gdbServerPort, qmlPort); cppEngine()->notifyEngineRemoteSetupFinished(result);
qmlEngine()->notifyEngineRemoteSetupDone(gdbServerPort, qmlPort); qmlEngine()->notifyEngineRemoteSetupFinished(result);
}
void QmlCppEngine::notifyEngineRemoteSetupFailed(const QString &message)
{
EDEBUG("MASTER REMOTE SETUP FAILED");
DebuggerEngine::notifyEngineRemoteSetupFailed(message);
cppEngine()->notifyEngineRemoteSetupFailed(message);
qmlEngine()->notifyEngineRemoteSetupFailed(message);
} }
void QmlCppEngine::showMessage(const QString &msg, int channel, int timeout) const void QmlCppEngine::showMessage(const QString &msg, int channel, int timeout) const
......
...@@ -86,8 +86,7 @@ public: ...@@ -86,8 +86,7 @@ public:
DebuggerEngine *cppEngine() const; DebuggerEngine *cppEngine() const;
DebuggerEngine *qmlEngine() const; DebuggerEngine *qmlEngine() const;
void notifyEngineRemoteSetupDone(int gdbServerPort, int qmlPort); void notifyEngineRemoteSetupFinished(const RemoteSetupResult &result);
void notifyEngineRemoteSetupFailed(const QString &message);
void showMessage(const QString &msg, int channel = LogDebug, void showMessage(const QString &msg, int channel = LogDebug,
int timeout = -1) const; int timeout = -1) const;
......
...@@ -614,29 +614,28 @@ void QmlEngine::stopApplicationLauncher() ...@@ -614,29 +614,28 @@ void QmlEngine::stopApplicationLauncher()
} }
} }
void QmlEngine::notifyEngineRemoteSetupDone(int gdbServerPort, int qmlPort) void QmlEngine::notifyEngineRemoteSetupFinished(const RemoteSetupResult &result)
{ {
if (qmlPort != -1) DebuggerEngine::notifyEngineRemoteSetupFinished(result);
startParameters().qmlServerPort = qmlPort;
DebuggerEngine::notifyEngineRemoteSetupDone(gdbServerPort, qmlPort);
notifyEngineSetupOk();
// The remote setup can take while especialy with mixed debugging. if (result.success) {
// Just waiting for 8 seconds is not enough. Increase the timeout if (result.qmlServerPort != InvalidPort)
// to 60 s startParameters().qmlServerPort = result.qmlServerPort;
// In case we get an output the m_outputParser will start the connection.
m_noDebugOutputTimer.setInterval(60000);
}
void QmlEngine::notifyEngineRemoteSetupFailed(const QString &message) notifyEngineSetupOk();
{
DebuggerEngine::notifyEngineRemoteSetupFailed(message);
if (isMasterEngine())
QMessageBox::critical(0,tr("Failed to start application"),
tr("Application startup failed: %1").arg(message));
notifyEngineSetupFailed(); // The remote setup can take while especialy with mixed debugging.
// Just waiting for 8 seconds is not enough. Increase the timeout
// to 60 s
// In case we get an output the m_outputParser will start the connection.
m_noDebugOutputTimer.setInterval(60000);
}
else {
if (isMasterEngine())
QMessageBox::critical(Core::ICore::dialogParent(), tr("Failed to start application"),
tr("Application startup failed: %1").arg(result.reason));
notifyEngineSetupFailed();
}
} }
void QmlEngine::notifyEngineRemoteServerRunning(const QByteArray &serverChannel, int pid) void QmlEngine::notifyEngineRemoteServerRunning(const QByteArray &serverChannel, int pid)
......
...@@ -60,9 +60,8 @@ public: ...@@ -60,9 +60,8 @@ public:
~QmlEngine(); ~QmlEngine();
void notifyInferiorSetupOk(); void notifyInferiorSetupOk();
void notifyEngineRemoteSetupDone(int gdbServerPort, int qmlPort);
void notifyEngineRemoteSetupFailed(const QString &message);
void notifyEngineRemoteServerRunning(const QByteArray &, int pid); void notifyEngineRemoteServerRunning(const QByteArray &, int pid);
void notifyEngineRemoteSetupFinished(const RemoteSetupResult &result);
bool canDisplayTooltip() const; bool canDisplayTooltip() const;
......
...@@ -205,23 +205,24 @@ IosDebugSupport::~IosDebugSupport() ...@@ -205,23 +205,24 @@ IosDebugSupport::~IosDebugSupport()
void IosDebugSupport::handleServerPorts(int gdbServerPort, int qmlPort) void IosDebugSupport::handleServerPorts(int gdbServerPort, int qmlPort)
{ {
if (gdbServerPort > 0 || (m_runner && !m_runner->cppDebug() && qmlPort > 0)) { RemoteSetupResult result;
m_runControl->engine()->notifyEngineRemoteSetupDone(gdbServerPort, qmlPort); result.gdbServerPort = gdbServerPort;
} else { result.qmlServerPort = qmlPort;
m_runControl->engine()->notifyEngineRemoteSetupFailed( result.success = gdbServerPort > 0 || (m_runner && !m_runner->cppDebug() && qmlPort > 0);
tr("Could not get debug server file descriptor.")); if (!result.success)
} result.reason = tr("Could not get debug server file descriptor.");
m_runControl->engine()->notifyEngineRemoteSetupFinished(result);
} }
void IosDebugSupport::handleGotInferiorPid(Q_PID pid, int qmlPort) void IosDebugSupport::handleGotInferiorPid(Q_PID pid, int qmlPort)
{ {
if (pid > 0) { RemoteSetupResult result;
//m_runControl->engine()->notifyInferiorPid(pid); result.qmlServerPort = qmlPort;
m_runControl->engine()->notifyEngineRemoteSetupDone(int(Utils::qPidToPid(pid)), qmlPort); result.inferiorPid = int(Utils::qPidToPid(pid));
} else { result.success = pid > 0;
m_runControl->engine()->notifyEngineRemoteSetupFailed( if (!result.success)
tr("Got an invalid process id.")); result.reason = tr("Got an invalid process id.");
} m_runControl->engine()->notifyEngineRemoteSetupFinished(result);
} }
void IosDebugSupport::handleRemoteProcessFinished(bool cleanEnd) void IosDebugSupport::handleRemoteProcessFinished(bool cleanEnd)
......
...@@ -71,13 +71,21 @@ void BlackBerryDebugSupport::launchRemoteApplication() ...@@ -71,13 +71,21 @@ void BlackBerryDebugSupport::launchRemoteApplication()
void BlackBerryDebugSupport::handleStarted() void BlackBerryDebugSupport::handleStarted()
{ {
m_engine->startParameters().attachPID = m_runner->pid(); m_engine->startParameters().attachPID = m_runner->pid(); // FIXME: Is that needed?
m_engine->notifyEngineRemoteSetupDone(8000, -1); Debugger::RemoteSetupResult result;
result.success = true;
result.inferiorPid = m_runner->pid();
result.gdbServerPort = 8000;
result.qmlServerPort = Debugger::InvalidPort;
m_engine->notifyEngineRemoteSetupFinished(result);
} }
void BlackBerryDebugSupport::handleStartFailed(const QString &message) void BlackBerryDebugSupport::handleStartFailed(const QString &message)
{ {
m_engine->notifyEngineRemoteSetupFailed(message); Debugger::RemoteSetupResult result;
result.success = false;
result.reason = message;
m_engine->notifyEngineRemoteSetupFinished(result);
} }
void BlackBerryDebugSupport::handleDebuggerStateChanged(Debugger::DebuggerState state) void BlackBerryDebugSupport::handleDebuggerStateChanged(Debugger::DebuggerState state)
......
...@@ -120,8 +120,13 @@ void QnxDebugSupport::startExecution() ...@@ -120,8 +120,13 @@ void QnxDebugSupport::startExecution()
void QnxDebugSupport::handleRemoteProcessStarted() void QnxDebugSupport::handleRemoteProcessStarted()
{ {
QnxAbstractRunSupport::handleRemoteProcessStarted(); QnxAbstractRunSupport::handleRemoteProcessStarted();
if (m_engine) if (m_engine) {
m_engine->notifyEngineRemoteSetupDone(m_pdebugPort, m_qmlPort); Debugger::RemoteSetupResult result;
result.success = true;
result.gdbServerPort = m_pdebugPort;
result.qmlServerPort = m_qmlPort;
m_engine->notifyEngineRemoteSetupFinished(result);
}
} }
void QnxDebugSupport::handleRemoteProcessFinished(bool success) void QnxDebugSupport::handleRemoteProcessFinished(bool success)
...@@ -134,8 +139,10 @@ void QnxDebugSupport::handleRemoteProcessFinished(bool success) ...@@ -134,8 +139,10 @@ void QnxDebugSupport::handleRemoteProcessFinished(bool success)
m_engine->notifyInferiorIll(); m_engine->notifyInferiorIll();
} else { } else {
const QString errorMsg = tr("The %1 process closed unexpectedly.").arg(executable()); Debugger::RemoteSetupResult result;
m_engine->notifyEngineRemoteSetupFailed(errorMsg); result.success = false;
result.reason = tr("The %1 process closed unexpectedly.").arg(executable());
m_engine->notifyEngineRemoteSetupFinished(result);
} }
} }
...@@ -182,8 +189,12 @@ void QnxDebugSupport::handleError(const QString &error) ...@@ -182,8 +189,12 @@ void QnxDebugSupport::handleError(const QString &error)
} }
} else if (state() != Inactive) { } else if (state() != Inactive) {
setFinished(); setFinished();
if (m_engine) if (m_engine) {
m_engine->notifyEngineRemoteSetupFailed(tr("Initial setup failed: %1").arg(error)); Debugger::RemoteSetupResult result;
result.success = false;
result.reason = tr("Initial setup failed: %1").arg(error);
m_engine->notifyEngineRemoteSetupFinished(result);
}
} }
} }
......
...@@ -218,8 +218,11 @@ void LinuxDeviceDebugSupport::handleAppRunnerFinished(bool success) ...@@ -218,8 +218,11 @@ void LinuxDeviceDebugSupport::handleAppRunnerFinished(bool success)
else if (!success) else if (!success)
d->engine->notifyInferiorIll();