Ejemplo n.º 1
0
void NodeInstanceView::modelAttached(Model *model)
{
    AbstractView::modelAttached(model);
    m_nodeInstanceServer = new NodeInstanceServerProxy(this, m_runModus, m_currentKit);
    m_lastCrashTime.start();
    connect(m_nodeInstanceServer.data(), SIGNAL(processCrashed()), this, SLOT(handleChrash()));

    if (!isSkippedRootNode(rootModelNode()))
        nodeInstanceServer()->createScene(createCreateSceneCommand());

    ModelNode stateNode = currentStateNode();
    if (stateNode.isValid() && stateNode.metaInfo().isSubclassOf("QtQuick.State", 1, 0)) {
        NodeInstance newStateInstance = instanceForModelNode(stateNode);
        activateState(newStateInstance);
    }

}
Ejemplo n.º 2
0
void DGLRunAppProject::startDebugging() {
    // randomize connection port
    int port = rand() % (0xffff - 1024) + 1024;

    m_process = new DGLDebugeeQTProcess(port, m_EglMode);

    m_process->setParent(this);

    CONNASSERT(m_process, SIGNAL(processReady()), this,
               SLOT(processReadyHandler()));
    CONNASSERT(m_process, SIGNAL(processError(std::string)), this,
               SLOT(processErrorHandler(std::string)));
    CONNASSERT(m_process, SIGNAL(processFinished(int)), this,
               SLOT(processExitHandler(int)));
    CONNASSERT(m_process, SIGNAL(processCrashed()), this,
               SLOT(processCrashHandler()));

    m_process->run(getExecutable(), getPath(), getCommandLineArgVector(), getSkipProcessesCount());
}
Ejemplo n.º 3
0
void NodeInstanceView::restartProcess()
{
    if (m_restartProcessTimerId)
        killTimer(m_restartProcessTimerId);

    if (model()) {
        delete nodeInstanceServer();

        m_nodeInstanceServer = new NodeInstanceServerProxy(this, m_runModus, m_currentKit);
        connect(m_nodeInstanceServer.data(), SIGNAL(processCrashed()), this, SLOT(handleChrash()));

        if (!isSkippedRootNode(rootModelNode()))
            nodeInstanceServer()->createScene(createCreateSceneCommand());

        ModelNode stateNode = currentStateNode();
        if (stateNode.isValid() && stateNode.metaInfo().isSubclassOf("QtQuick.State", 1, 0)) {
            NodeInstance newStateInstance = instanceForModelNode(stateNode);
            activateState(newStateInstance);
        }
    }

    m_restartProcessTimerId = 0;
}
Ejemplo n.º 4
0
void DGLDebugeeQTProcess::handleProcessFinished(int code,
                                                QProcess::ExitStatus status) {

    m_PollTimer->stop();

    if (status == QProcess::CrashExit) {
        // this is loader process that crashed!
        emit processCrashed();
    } else {
        // check in IPC if loader was successful
        if (m_Loaded || m_SemLoader.try_wait()) {
            IPCMessage* ipcMessage = (IPCMessage*)m_MappedRegion.get_address();

            if (ipcMessage) {
                static_assert(sizeof(char) == sizeof(ipcMessage->m_message[0]),
                              "Wrong IPC message element size");
                if (!ipcMessage->m_ok) {
                    emit processError((char*)ipcMessage->m_message);
                }
            }
        }
        emit processFinished(code);
    }
}