Commit e2d46831 authored by Oswald Buddenhagen's avatar Oswald Buddenhagen

flush queued commands on non-fatal continuation failures

Reviewed-By: hjk
parent bf280e21
......@@ -746,6 +746,17 @@ void GdbEngine::postCommandHelper(const GdbCommand &cmd)
}
}
void GdbEngine::flushQueuedCommands()
{
showStatusMessage(tr("Processing queued commands."), 1000);
while (!m_commandsToRunOnTemporaryBreak.isEmpty()) {
GdbCommand cmd = m_commandsToRunOnTemporaryBreak.takeFirst();
debugMessage(_("RUNNING QUEUED COMMAND %1 %2")
.arg(cmd.command).arg(_(cmd.callbackName)));
flushCommand(cmd);
}
}
void GdbEngine::flushCommand(const GdbCommand &cmd0)
{
GdbCommand cmd = cmd0;
......@@ -1066,13 +1077,7 @@ void GdbEngine::handleStopResponse(const GdbMi &data)
if (!m_commandsToRunOnTemporaryBreak.isEmpty()) {
QTC_ASSERT(state() == InferiorStopping, qDebug() << state())
setState(InferiorStopped);
showStatusMessage(tr("Processing queued commands."), 1000);
while (!m_commandsToRunOnTemporaryBreak.isEmpty()) {
GdbCommand cmd = m_commandsToRunOnTemporaryBreak.takeFirst();
debugMessage(_("RUNNING QUEUED COMMAND %1 %2")
.arg(cmd.command).arg(_(cmd.callbackName)));
flushCommand(cmd);
}
flushQueuedCommands();
QTC_ASSERT(m_commandsDoneCallback == 0, /**/);
m_commandsDoneCallback = &GdbEngine::autoContinueInferior;
return;
......@@ -1319,6 +1324,8 @@ void GdbEngine::handleExecContinue(const GdbResponse &response)
setState(InferiorStopped);
QByteArray msg = response.data.findChild("msg").data();
if (msg.startsWith("Cannot find bounds of current function")) {
if (!m_commandsToRunOnTemporaryBreak.isEmpty())
flushQueuedCommands();
showStatusMessage(tr("Stopped."), 5000);
//showStatusMessage(tr("No debug information available. "
// "Leaving function..."));
......@@ -1326,6 +1333,7 @@ void GdbEngine::handleExecContinue(const GdbResponse &response)
} else {
showMessageBox(QMessageBox::Critical, tr("Execution Error"),
tr("Cannot continue debugged process:\n") + QString::fromLocal8Bit(msg));
m_commandsToRunOnTemporaryBreak.clear();
shutdown();
}
}
......
......@@ -226,6 +226,7 @@ private: ////////// Gdb Command Management //////////
const char *callbackName,
const QVariant &cookie = QVariant());
void postCommandHelper(const GdbCommand &cmd);
void flushQueuedCommands();
void setTokenBarrier();
QHash<int, GdbCommand> m_cookieForToken;
......
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