Ejemplo n.º 1
0
void GdbTermEngine::setupEngine()
{
    QTC_ASSERT(state() == EngineSetupRequested, qDebug() << state());
    showMessage(_("TRYING TO START ADAPTER"));

// Currently, adapters are not re-used
//    // We leave the console open, so recycle it now.
//    m_stubProc.blockSignals(true);
//    m_stubProc.stop();
//    m_stubProc.blockSignals(false);

    if (!prepareCommand())
        return;

    m_stubProc.setWorkingDirectory(runParameters().workingDirectory);
    // Set environment + dumper preload.
    m_stubProc.setEnvironment(runParameters().stubEnvironment);

    connect(&m_stubProc, &ConsoleProcess::processError,
            this, &GdbTermEngine::stubError);
    connect(&m_stubProc, &ConsoleProcess::processStarted,
            this, &GdbTermEngine::stubStarted);
    connect(&m_stubProc, &ConsoleProcess::stubStopped,
            this, &GdbTermEngine::stubExited);
    // FIXME: Starting the stub implies starting the inferior. This is
    // fairly unclean as far as the state machine and error reporting go.

    if (!m_stubProc.start(runParameters().executable,
                         runParameters().processArgs)) {
        // Error message for user is delivered via a signal.
        handleAdapterStartFailed(QString());
        return;
    }
}
Ejemplo n.º 2
0
void GdbPlainEngine::setupEngine()
{
    QTC_ASSERT(state() == EngineSetupRequested, qDebug() << state());
    showMessage(_("TRYING TO START ADAPTER"));

    if (!prepareCommand())
        return;

    QStringList gdbArgs;

    if (!m_outputCollector.listen()) {
        handleAdapterStartFailed(tr("Cannot set up communication with child process: %1")
                .arg(m_outputCollector.errorString()));
        return;
    }
    gdbArgs.append(_("--tty=") + m_outputCollector.serverName());

    if (!runParameters().inferior.workingDirectory.isEmpty())
        m_gdbProc.setWorkingDirectory(runParameters().inferior.workingDirectory);

    startGdb(gdbArgs);
}
void GdbRemotePlainEngine::notifyEngineRemoteSetupFailed(const QString &reason)
{
    QTC_ASSERT(state() == EngineSetupRequested, qDebug() << state());
    handleAdapterStartFailed(reason);
}
void GdbRemotePlainEngine::handleGdbStartFailed1()
{
    handleAdapterStartFailed(m_gdbProc.errorString());
}