in fact, older gdbs don't send *stopped after attaching

This commit is contained in:
Oswald Buddenhagen
2009-10-28 20:05:11 +01:00
parent ad3d1c5887
commit 56053abbe8

View File

@@ -78,7 +78,16 @@ void AttachGdbAdapter::startInferior()
void AttachGdbAdapter::handleAttach(const GdbResponse &response)
{
if (response.resultClass == GdbResultDone) {
QTC_ASSERT(state() == InferiorStopped, qDebug() << state());
// We don't know the exact 6.8.50 build where gdb started emitting
// *stopped here, so allow for some slack.
if (m_engine->m_gdbVersion < 60850) {
QTC_ASSERT(state() == InferiorStarting, qDebug() << state());
setState(InferiorStopped);
} else if (m_engine->m_gdbVersion < 70000 && state() == InferiorStarting) {
setState(InferiorStopped);
} else {
QTC_ASSERT(state() == InferiorStopped, qDebug() << state());
}
debugMessage(_("INFERIOR ATTACHED"));
showStatusMessage(msgAttachedToStoppedInferior());
emit inferiorPrepared();