void GdbCoreEngine::continueSetupEngine()
{
    if (m_executable.isEmpty()) {
        // Read executable from core.
        bool isCore = false;
        m_executable = readExecutableNameFromCore(&isCore);

        if (!isCore) {
            showMessageBox(QMessageBox::Warning,
                tr("Error Loading Core File"),
                tr("The specified file does not appear to be a core file."));
            notifyEngineSetupFailed();
            return;
        }

        // Strip off command line arguments. FIXME: make robust.
        int idx = m_executable.indexOf(QLatin1Char(' '));
        if (idx >= 0)
            m_executable.truncate(idx);
        if (m_executable.isEmpty()) {
            showMessageBox(QMessageBox::Warning,
                tr("Error Loading Symbols"),
                tr("No executable to load symbols from specified core."));
            notifyEngineSetupFailed();
            return;
        }
    }
    startGdb();
}
void GdbCoreEngine::continueSetupEngine()
{
    bool isCore = true;
    if (m_coreUnpackProcess) {
        isCore = m_coreUnpackProcess->exitCode() == 0;
        m_coreUnpackProcess->deleteLater();
        m_coreUnpackProcess = 0;
        if (m_tempCoreFile.isOpen())
            m_tempCoreFile.close();
    }
    if (isCore && m_executable.isEmpty()) {
        GdbCoreEngine::CoreInfo cinfo = readExecutableNameFromCore(
                                            startParameters().debuggerCommand,
                                            coreFileName());

        if (cinfo.isCore) {
            m_executable = cinfo.foundExecutableName;
            if (m_executable.isEmpty()) {
                Core::AsynchronousMessageBox::warning(
                    tr("Error Loading Symbols"),
                    tr("No executable to load symbols from specified core."));
                notifyEngineSetupFailed();
                return;
            }
        }
    }
    if (isCore) {
        startGdb();
    } else {
        Core::AsynchronousMessageBox::warning(
            tr("Error Loading Core File"),
            tr("The specified file does not appear to be a core file."));
        notifyEngineSetupFailed();
    }
}
void GdbRemoteServerEngine::uploadProcFinished()
{
    if (m_uploadProc.exitStatus() == QProcess::NormalExit
        && m_uploadProc.exitCode() == 0)
        startGdb();
    else
        notifyEngineRemoteSetupFailed(m_uploadProc.errorString());
}
Esempio n. 4
0
void GdbAttachEngine::setupEngine()
{
    QTC_ASSERT(state() == EngineSetupRequested, qDebug() << state());
    showMessage(_("TRYING TO START ADAPTER"));

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

    startGdb();
}
void GdbRemoteServerEngine::uploadProcFinished()
{
    if (m_uploadProc.exitStatus() == QProcess::NormalExit && m_uploadProc.exitCode() == 0) {
        startGdb();
    } else {
        RemoteSetupResult result;
        result.success = false;
        result.reason = m_uploadProc.errorString();
        notifyEngineRemoteSetupFinished(result);
    }
}
Esempio n. 6
0
void GdbAttachEngine::setupEngine()
{
    QTC_ASSERT(state() == EngineSetupRequested, qDebug() << state());
    showMessage(_("TRYING TO START ADAPTER"));

    if (!startParameters().workingDirectory.isEmpty())
        m_gdbProc->setWorkingDirectory(startParameters().workingDirectory);
    if (startParameters().environment.size())
        m_gdbProc->setEnvironment(startParameters().environment.toStringList());

    startGdb();
}
void GdbRemoteServerEngine::notifyEngineRemoteSetupDone(int gdbServerPort, int qmlPort)
{
    QTC_ASSERT(state() == EngineSetupRequested, qDebug() << state());
    DebuggerEngine::notifyEngineRemoteSetupDone(gdbServerPort, qmlPort);

    if (qmlPort != -1)
        startParameters().qmlServerPort = qmlPort;
    if (gdbServerPort != -1) {
        QString &rc = startParameters().remoteChannel;
        const int sepIndex = rc.lastIndexOf(QLatin1Char(':'));
        if (sepIndex != -1) {
            rc.replace(sepIndex + 1, rc.count() - sepIndex - 1,
                       QString::number(gdbServerPort));
        }
    }
    startGdb();
}
Esempio n. 8
0
bool Visualizator::start(bool preparation)
{
	// If the preparation phase was asked to be done
	if ( preparation )
	{
		// Start GDB
		if ( ! createGdb() ) return false;
		if ( ! createMemoryMapper() ) return false;
		if ( ! startGdb() ) return false;

		// Do the preparation phase
		if ( ! setInferiorAndArguments() ) return false;
		setUserDefinedBreakpoints();
		setFunctionDefinitionBreakpoints();
		if ( ! startInferior() ) return false;
	}
	else
	{
		// In the second phase, user may stop the visualization
		if ( unitPlayingScene->isStopped() ) return false;

		// The preparation phase is done, continue with the starting process
	  #ifdef Q_OS_LINUX
//		setDynamicMemoryBreakpoints();
	  #endif
		// Unnecessary: bn_tell_file() functions are used instead on each execution loop iteration
		// ToDo: remove watch bn_io logic from code and algorithm (example session)
		//watchStandardInputOutput();
		watchGlobalVariables();
		// UnitPlayingScene loads standard input after the prepration phase
		// Animate function call at program's entry point
		Q_ASSERT(entryPointTree);
		int maxDuration = 0;
		if ( unitPlayingScene->isStopped() ) return false;
		processBreakpointHit(*entryPointTree, visExecutionLoop, maxDuration);

		// In maxDuration seconds, the entry point function call will be done and we can enter
		// in the execution loop
		scheduleStepForward(maxDuration);
	}

	// Visualization started
	return true;
}
Esempio n. 9
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);
}
Esempio n. 10
0
void GdbAttachEngine::setupEngine()
{
    QTC_ASSERT(state() == EngineSetupRequested, qDebug() << state());
    showMessage(_("TRYING TO START ADAPTER"));
    startGdb();
}
Esempio n. 11
0
void GdbTermEngine::stubStarted()
{
    startGdb();
}
void GdbRemotePlainEngine::handleGdbStarted()
{
     startGdb();
}