Commit 10fa3b2b authored by hjk's avatar hjk
Browse files

debugger: remove inferiorStarted() signal.

It had unclear semantics and was only used to show a statusmessage.
We do that directly now.
parent f685aa23
......@@ -73,22 +73,22 @@ enum DebuggerState
InferiorPrepared,
InferiorPreparationFailed,
InferiorStarting,
// InferiorStarted, // That's either InferiorRunningRequested or InferiorStopped
// InferiorStarted, // Use InferiorRunningRequested or InferiorStopped
InferiorStartFailed,
InferiorRunningRequested, // Debuggee requested to run
InferiorRunning, // Debuggee running
InferiorStopping, // Debuggee running, stop requested
InferiorStopping, // Debuggee running, stop requested
InferiorStopped, // Debuggee stopped
InferiorStopFailed, // Debuggee stopped
InferiorStopFailed, // Debuggee stopped
InferiorShuttingDown,
InferiorShutDown,
InferiorShutdownFailed,
AdapterShuttingDown,
//AdapterShutDown, // use DebuggerNotReady
//AdapterShutDown, // Use DebuggerNotReady instead
AdapterShutdownFailed,
};
......@@ -106,12 +106,12 @@ enum DebuggerStartMode
enum LogChannel
{
LogInput, // Used for user input
LogInput, // Used for user input
LogOutput,
LogWarning,
LogError,
LogStatus, // Used for status changed messages
LogTime, // Used for time stamp messages
LogStatus, // Used for status changed messages
LogTime, // Used for time stamp messages
LogDebug,
LogMisc
};
......
......@@ -76,7 +76,6 @@ signals:
void inferiorPrepared();
void inferiorPreparationFailed(const QString &msg);
void inferiorStarted();
void inferiorStartFailed(const QString &msg);
void inferiorShutDown();
void inferiorShutdownFailed(const QString &msg);
......@@ -95,6 +94,8 @@ protected:
{ return m_engine->startParameters(); }
void debugMessage(const QString &msg) const
{ m_engine->debugMessage(msg); }
void showStatusMessage(const QString &msg) const
{ m_engine->showStatusMessage(msg); }
GdbEngine * const m_engine;
};
......
......@@ -134,13 +134,14 @@ void AttachGdbAdapter::handleAttach(const GdbResponse &response)
void AttachGdbAdapter::startInferior()
{
QTC_ASSERT(state() == InferiorStarting, qDebug() << state());
#if 0
#if 1
setState(InferiorStopped);
debugMessage(_("INFERIOR STARTED"));
showStatusMessage(tr("Attached to stopped inferior."));
#else
// continue on attach
setState(InferiorRunningRequested);
m_engine->postCommand(_("-exec-continue"), CB(handleContinue));
#else
setState(InferiorStopped);
emit inferiorStarted();
#endif
}
......@@ -149,7 +150,8 @@ void AttachGdbAdapter::handleContinue(const GdbResponse &response)
QTC_ASSERT(state() == InferiorStarting, qDebug() << state());
if (response.resultClass == GdbResultRunning) {
setState(InferiorRunning);
emit inferiorStarted();
debugMessage(_("INFERIOR STARTED"));
showStatusMessage(tr("Inferior running."));
} else {
QTC_ASSERT(response.resultClass == GdbResultError, /**/);
const QByteArray &msg = response.data.findChild("msg").data();
......
......@@ -151,7 +151,8 @@ void CoreGdbAdapter::handleTargetCore(const GdbResponse &response)
QTC_ASSERT(state() == InferiorStarting, qDebug() << state());
if (response.resultClass == GdbResultDone) {
setState(InferiorStopped);
emit inferiorStarted();
debugMessage(_("INFERIOR STARTED"));
showStatusMessage(tr("Attached to core."));
m_engine->updateAll();
} else {
QTC_ASSERT(response.resultClass == GdbResultError, /**/);
......
......@@ -268,8 +268,6 @@ void GdbEngine::connectAdapter()
connect(m_gdbAdapter, SIGNAL(inferiorPreparationFailed(QString)),
this, SLOT(handleInferiorPreparationFailed(QString)));
connect(m_gdbAdapter, SIGNAL(inferiorStarted()),
this, SLOT(handleInferiorStarted()));
connect(m_gdbAdapter, SIGNAL(inferiorStartFailed(QString)),
this, SLOT(handleInferiorStartFailed(QString)));
connect(m_gdbAdapter, SIGNAL(inferiorShutDown()),
......@@ -4163,17 +4161,6 @@ void GdbEngine::handleInferiorStartFailed(const QString &msg)
shutdown();
}
void GdbEngine::handleInferiorStarted()
{
QTC_ASSERT(state() == InferiorRunning
|| state() == InferiorStopped, qDebug() << state());
debugMessage(_("INFERIOR STARTED"));
if (state() == InferiorStopped)
showStatusMessage(tr("Inferior stopped."));
else
showStatusMessage(tr("Inferior started."));
}
void GdbEngine::handleInferiorShutDown()
{
debugMessage(_("INFERIOR SUCCESSFULLY SHUT DOWN"));
......
......@@ -239,7 +239,6 @@ private slots:
void handleInferiorPrepared();
void handleInferiorPreparationFailed(const QString &msg);
void handleInferiorStarted();
void handleInferiorStartFailed(const QString &msg);
void handleInferiorShutDown();
void handleInferiorShutdownFailed(const QString &msg);
......
......@@ -211,7 +211,8 @@ void PlainGdbAdapter::handleExecRun(const GdbResponse &response)
{
if (response.resultClass == GdbResultRunning) {
QTC_ASSERT(state() == InferiorRunning, qDebug() << state());
emit inferiorStarted();
debugMessage(_("INFERIOR STARTED"));
showStatusMessage(tr("Inferior started."));
} else {
QTC_ASSERT(state() == InferiorRunningRequested, qDebug() << state());
QTC_ASSERT(response.resultClass == GdbResultError, /**/);
......
......@@ -251,7 +251,8 @@ void RemoteGdbAdapter::handleFirstContinue(const GdbResponse &record)
QTC_ASSERT(state() == InferiorRunningRequested, qDebug() << state());
if (record.resultClass == GdbResultDone) {
setState(InferiorStopped);
emit inferiorStarted();
debugMessage(_("INFERIOR STARTED"));
showStatusMessage(tr("Attached to stopped inferior."));
} else if (record.resultClass == GdbResultError) {
//QString msg = __(record.data.findChild("msg").data());
QString msg1 = tr("Connecting to remote server failed:\n");
......
......@@ -1463,15 +1463,14 @@ void TrkGdbAdapter::startInferior()
QTC_ASSERT(state() == InferiorStarting, qDebug() << state());
setState(InferiorRunningRequested);
m_engine->postCommand(_("-exec-continue"), CB(handleFirstContinue));
// FIXME: Is there a way to properly recognize a successful start?
emit inferiorStarted();
}
void TrkGdbAdapter::handleFirstContinue(const GdbResponse &record)
{
QTC_ASSERT(state() == InferiorRunningRequested, qDebug() << state());
if (record.resultClass == GdbResultDone) {
// inferiorStarted already emitted above, see FIXME
debugMessage(_("INFERIOR STARTED"));
showStatusMessage(tr("Inferior running."));
} else if (record.resultClass == GdbResultError) {
//QString msg = __(record.data.findChild("msg").data());
QString msg1 = tr("Connecting to remote server failed:");
......
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