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(startParameters().workingDirectory); // Set environment + dumper preload. m_stubProc.setEnvironment(startParameters().environment); connect(&m_stubProc, SIGNAL(processError(QString)), SLOT(stubError(QString))); connect(&m_stubProc, SIGNAL(processStarted()), SLOT(stubStarted())); connect(&m_stubProc, SIGNAL(wrapperStopped()), SLOT(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(startParameters().executable, startParameters().processArgs)) { // Error message for user is delivered via a signal. handleAdapterStartFailed(QString()); return; } }
TermGdbAdapter::TermGdbAdapter(GdbEngine *engine) : AbstractGdbAdapter(engine) { #ifdef Q_OS_WIN // Windows up to xp needs a workaround for attaching to freshly started processes. see proc_stub_win if (QSysInfo::WindowsVersion >= QSysInfo::WV_VISTA) { m_stubProc.setMode(Utils::ConsoleProcess::Suspend); } else { m_stubProc.setMode(Utils::ConsoleProcess::Debug); } #else m_stubProc.setMode(Utils::ConsoleProcess::Debug); m_stubProc.setSettings(Core::ICore::settings()); #endif connect(&m_stubProc, SIGNAL(processError(QString)), SLOT(stubError(QString))); connect(&m_stubProc, SIGNAL(processStarted()), SLOT(handleInferiorSetupOk())); connect(&m_stubProc, SIGNAL(wrapperStopped()), SLOT(stubExited())); }