diff --git a/src/plugins/debugger/gdb/attachgdbadapter.cpp b/src/plugins/debugger/gdb/attachgdbadapter.cpp index 0803d3a5f53cb06078acdedd7edcd79347f9eb5c..4c0968233f2217269e3a4c28d2d0f5ac1bd64195 100644 --- a/src/plugins/debugger/gdb/attachgdbadapter.cpp +++ b/src/plugins/debugger/gdb/attachgdbadapter.cpp @@ -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();