Search in sources :

Example 1 with XsltDebugProcess

use of org.intellij.plugins.xsltDebugger.impl.XsltDebugProcess in project intellij-community by JetBrains.

the class DebuggerConnector method run.

public void run() {
    final Debugger client = connect();
    if (client == null) {
        // client will be null if the process terminated prematurely for some reason. no need for an error message
        if (!myProcess.isProcessTerminated()) {
            myProcess.notifyTextAvailable("Failed to connect to debugged process. Terminating.\n", ProcessOutputTypes.SYSTEM);
            myProcess.destroyProcess();
        }
        return;
    }
    final XsltDebuggerSession session = XsltDebuggerSession.create(myProject, myProcess, client);
    final XsltDebugProcess dbgp = XsltDebugProcess.getInstance(myProcess);
    assert dbgp != null;
    dbgp.init(client);
    session.addListener(new XsltDebuggerSession.Listener() {

        @Override
        public void debuggerSuspended() {
            final OutputEventQueue queue = client.getEventQueue();
            StructureTabComponent.getInstance(myProcess).getEventModel().update(queue.getEvents());
        }

        @Override
        public void debuggerResumed() {
        }

        @Override
        public void debuggerStopped() {
            try {
                final OutputEventQueue queue = client.getEventQueue();
                StructureTabComponent.getInstance(myProcess).getEventModel().finalUpdate(queue.getEvents());
            } catch (Exception e) {
            // can fail when debugger is manually terminated
            }
        }
    });
    session.start();
}
Also used : Debugger(org.intellij.plugins.xsltDebugger.rt.engine.Debugger) XsltDebugProcess(org.intellij.plugins.xsltDebugger.impl.XsltDebugProcess) IOException(java.io.IOException) NotBoundException(java.rmi.NotBoundException) ConnectException(java.rmi.ConnectException) OutputEventQueue(org.intellij.plugins.xsltDebugger.rt.engine.OutputEventQueue)

Aggregations

IOException (java.io.IOException)1 ConnectException (java.rmi.ConnectException)1 NotBoundException (java.rmi.NotBoundException)1 XsltDebugProcess (org.intellij.plugins.xsltDebugger.impl.XsltDebugProcess)1 Debugger (org.intellij.plugins.xsltDebugger.rt.engine.Debugger)1 OutputEventQueue (org.intellij.plugins.xsltDebugger.rt.engine.OutputEventQueue)1