debugger: overhaul "state machine"

This mainly allows for more precise shutdown and tightens the set
of allowed transitions.
This commit is contained in:
hjk
2010-07-09 17:07:59 +02:00
parent 6089bc1b9e
commit e760700f0f
41 changed files with 1414 additions and 834 deletions

View File

@@ -68,7 +68,7 @@ AbstractGdbAdapter::DumperHandling LocalPlainGdbAdapter::dumperHandling() const
void LocalPlainGdbAdapter::startAdapter()
{
QTC_ASSERT(state() == EngineSettingUp, qDebug() << state());
QTC_ASSERT(state() == EngineSetupRequested, qDebug() << state());
showMessage(_("TRYING TO START ADAPTER"));
QStringList gdbArgs;
@@ -94,6 +94,28 @@ void LocalPlainGdbAdapter::startAdapter()
m_engine->handleAdapterStarted();
}
void LocalPlainGdbAdapter::setupInferior()
{
AbstractPlainGdbAdapter::setupInferior();
}
void LocalPlainGdbAdapter::runEngine()
{
AbstractPlainGdbAdapter::runEngine();
}
void LocalPlainGdbAdapter::shutdownInferior()
{
m_engine->defaultInferiorShutdown("kill");
}
void LocalPlainGdbAdapter::shutdownAdapter()
{
showMessage(_("PLAIN ADAPTER SHUTDOWN %1").arg(state()));
m_outputCollector.shutdown();
m_engine->notifyAdapterShutdownOk();
}
void LocalPlainGdbAdapter::checkForReleaseBuild()
{
// Quick check for a "release" build
@@ -128,14 +150,10 @@ void LocalPlainGdbAdapter::interruptInferior()
return;
}
if (!interruptProcess(attachedPID))
if (!interruptProcess(attachedPID)) {
showMessage(_("CANNOT INTERRUPT %1").arg(attachedPID));
}
void LocalPlainGdbAdapter::shutdown()
{
showMessage(_("PLAIN ADAPTER SHUTDOWN %1").arg(state()));
m_outputCollector.shutdown();
m_engine->notifyInferiorStopFailed();
}
}
QByteArray LocalPlainGdbAdapter::execFilePath() const