fix shutdown paths

this includes:
- move the gdb ownership back to the engine (thus strip down the
  adaptors as far as possible)
- make gdb startup synchronous
- make adapter shutdown synchronous
- fix the state transitions relating to shutdown
This commit is contained in:
Oswald Buddenhagen
2009-10-20 11:02:16 +02:00
parent 4b0060c537
commit b3addf14f1
19 changed files with 302 additions and 649 deletions

View File

@@ -47,35 +47,18 @@ AbstractGdbAdapter::~AbstractGdbAdapter()
disconnect();
}
// This cannot be in the c'tor, as it would not connect the "virtual" slots
void AbstractGdbAdapter::commonInit()
void AbstractGdbAdapter::shutdown()
{
QTC_ASSERT(state() == EngineStarting, qDebug() << state());
connect(&m_gdbProc, SIGNAL(error(QProcess::ProcessError)),
this, SLOT(handleGdbError(QProcess::ProcessError)));
connect(&m_gdbProc, SIGNAL(started()),
this, SLOT(handleGdbStarted()));
connect(&m_gdbProc, SIGNAL(finished(int, QProcess::ExitStatus)),
this, SLOT(handleGdbFinished(int, QProcess::ExitStatus)));
connect(&m_gdbProc, SIGNAL(readyReadStandardOutput()),
this, SIGNAL(readyReadStandardOutput()));
connect(&m_gdbProc, SIGNAL(readyReadStandardError()),
this, SIGNAL(readyReadStandardError()));
}
QByteArray AbstractGdbAdapter::readAllStandardOutput()
const char *AbstractGdbAdapter::inferiorShutdownCommand() const
{
return m_gdbProc.readAllStandardOutput();
}
QByteArray AbstractGdbAdapter::readAllStandardError()
{
return m_gdbProc.readAllStandardError();
return "kill";
}
void AbstractGdbAdapter::write(const QByteArray &data)
{
m_gdbProc.write(data);
m_engine->m_gdbProc.write(data);
}
bool AbstractGdbAdapter::isTrkAdapter() const