Commit 973f607e authored by Oswald Buddenhagen's avatar Oswald Buddenhagen
Browse files

centralize entering the InferiorStartFailed state

parent 1a27681c
...@@ -111,7 +111,6 @@ void AttachGdbAdapter::handleAttach(const GdbResponse &response) ...@@ -111,7 +111,6 @@ void AttachGdbAdapter::handleAttach(const GdbResponse &response)
m_engine->updateAll(); m_engine->updateAll();
} else { } else {
QString msg = __(response.data.findChild("msg").data()); QString msg = __(response.data.findChild("msg").data());
setState(InferiorStartFailed);
emit inferiorStartFailed(msg); emit inferiorStartFailed(msg);
} }
} }
......
...@@ -121,7 +121,6 @@ void CoreGdbAdapter::handleTargetCore1(const GdbResponse &response) ...@@ -121,7 +121,6 @@ void CoreGdbAdapter::handleTargetCore1(const GdbResponse &response)
int pos1 = console.data().indexOf('`'); int pos1 = console.data().indexOf('`');
int pos2 = console.data().indexOf('\''); int pos2 = console.data().indexOf('\'');
if (pos1 == -1 || pos2 == -1) { if (pos1 == -1 || pos2 == -1) {
setState(InferiorStartFailed);
emit inferiorStartFailed(tr("No binary found.")); emit inferiorStartFailed(tr("No binary found."));
} else { } else {
m_executable = console.data().mid(pos1 + 1, pos2 - pos1 - 1); m_executable = console.data().mid(pos1 + 1, pos2 - pos1 - 1);
...@@ -134,7 +133,6 @@ void CoreGdbAdapter::handleTargetCore1(const GdbResponse &response) ...@@ -134,7 +133,6 @@ void CoreGdbAdapter::handleTargetCore1(const GdbResponse &response)
} }
} else { } else {
const QByteArray msg = response.data.findChild("msg").data(); const QByteArray msg = response.data.findChild("msg").data();
setState(InferiorStartFailed);
emit inferiorStartFailed(msg); emit inferiorStartFailed(msg);
} }
} }
...@@ -149,7 +147,6 @@ void CoreGdbAdapter::handleDetach1(const GdbResponse &response) ...@@ -149,7 +147,6 @@ void CoreGdbAdapter::handleDetach1(const GdbResponse &response)
.arg(fi.absoluteFilePath()), CB(handleFileExecAndSymbols)); .arg(fi.absoluteFilePath()), CB(handleFileExecAndSymbols));
} else { } else {
const QByteArray msg = response.data.findChild("msg").data(); const QByteArray msg = response.data.findChild("msg").data();
setState(InferiorStartFailed);
emit inferiorStartFailed(msg); emit inferiorStartFailed(msg);
} }
} }
...@@ -168,7 +165,6 @@ void CoreGdbAdapter::handleFileExecAndSymbols(const GdbResponse &response) ...@@ -168,7 +165,6 @@ void CoreGdbAdapter::handleFileExecAndSymbols(const GdbResponse &response)
.arg(__(response.data.findChild("msg").data())); .arg(__(response.data.findChild("msg").data()));
setState(InferiorUnrunnable); setState(InferiorUnrunnable);
m_engine->updateAll(); m_engine->updateAll();
//setState(InferiorStartFailed);
// emit inferiorStartFailed(msg); // emit inferiorStartFailed(msg);
} }
} }
...@@ -185,7 +181,6 @@ void CoreGdbAdapter::handleTargetCore2(const GdbResponse &response) ...@@ -185,7 +181,6 @@ void CoreGdbAdapter::handleTargetCore2(const GdbResponse &response)
.arg(__(response.data.findChild("msg").data())); .arg(__(response.data.findChild("msg").data()));
setState(InferiorUnrunnable); setState(InferiorUnrunnable);
m_engine->updateAll(); m_engine->updateAll();
//setState(InferiorStartFailed);
// emit inferiorStartFailed(msg); // emit inferiorStartFailed(msg);
} }
} }
......
...@@ -4218,6 +4218,7 @@ void GdbEngine::handleInferiorStartFailed(const QString &msg) ...@@ -4218,6 +4218,7 @@ void GdbEngine::handleInferiorStartFailed(const QString &msg)
{ {
debugMessage(_("INFERIOR START FAILED")); debugMessage(_("INFERIOR START FAILED"));
showMessageBox(QMessageBox::Critical, tr("Inferior start failed"), msg); showMessageBox(QMessageBox::Critical, tr("Inferior start failed"), msg);
setState(InferiorStartFailed);
shutdown(); shutdown();
} }
......
...@@ -141,7 +141,6 @@ void PlainGdbAdapter::handleExecRun(const GdbResponse &response) ...@@ -141,7 +141,6 @@ void PlainGdbAdapter::handleExecRun(const GdbResponse &response)
const QByteArray &msg = response.data.findChild("msg").data(); const QByteArray &msg = response.data.findChild("msg").data();
//QTC_ASSERT(status() == InferiorRunning, /**/); //QTC_ASSERT(status() == InferiorRunning, /**/);
//interruptInferior(); //interruptInferior();
setState(InferiorStartFailed);
emit inferiorStartFailed(msg); emit inferiorStartFailed(msg);
} }
} }
......
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