void RemoteGdbAdapter::handleTargetRemote(const GdbResponse &record)
{
    QTC_ASSERT(state() == InferiorStarting, qDebug() << state());
    if (record.resultClass == GdbResultDone) {
        setState(InferiorStopped);
        // gdb server will stop the remote application itself.
        debugMessage(_("INFERIOR STARTED"));
        showStatusMessage(msgAttachedToStoppedInferior());
        emit inferiorPrepared();
    } else {
        // 16^error,msg="hd:5555: Connection timed out."
        QString msg = msgConnectRemoteServerFailed(
                          QString::fromLocal8Bit(record.data.findChild("msg").data()));
        emit inferiorStartFailed(msg);
    }
}
void PlainGdbAdapter::handleFileExecAndSymbols(const GdbResponse &response)
{
    QTC_ASSERT(state() == InferiorStarting, qDebug() << state());
    if (response.resultClass == GdbResultDone) {
#ifdef Q_OS_LINUX
        // Old gdbs do not announce the PID for programs without pthreads.
        // Note that successfully preloading the debugging helpers will
        // automatically load pthreads, so this will be unnecessary.
        if (m_engine->m_gdbVersion < 70000)
            m_engine->postCommand(_("info target"), CB(handleInfoTarget));
#endif
        emit inferiorPrepared();
    } else {
        QString msg = tr("Starting executable failed:\n") +
            QString::fromLocal8Bit(response.data.findChild("msg").data());
        emit inferiorStartFailed(msg);
    }
}