Search in sources :

Example 6 with Command

use of org.exist.debuggee.dbgp.packets.Command in project exist by eXist-db.

the class StepOut method eval.

@Override
public Sequence eval(Sequence[] args, Sequence contextSequence) throws XPathException {
    try {
        Debuggee dbgr = BrokerPool.getInstance().getDebuggee();
        IoSession session = (IoSession) dbgr.getSession(args[0].getStringValue());
        if (session == null)
            return BooleanValue.FALSE;
        Command command = new org.exist.debuggee.dbgp.packets.StepOut(session, "");
        command.exec();
        return BooleanValue.TRUE;
    } catch (Throwable e) {
        throw new XPathException(this, Module.DEBUG001, e);
    }
}
Also used : Debuggee(org.exist.debuggee.Debuggee) Command(org.exist.debuggee.dbgp.packets.Command) XPathException(org.exist.xquery.XPathException) IoSession(org.apache.mina.core.session.IoSession)

Example 7 with Command

use of org.exist.debuggee.dbgp.packets.Command in project exist by eXist-db.

the class BreakpointSet method eval.

@Override
public Sequence eval(Sequence[] args, Sequence contextSequence) throws XPathException {
    try {
        Debuggee dbgr = BrokerPool.getInstance().getDebuggee();
        IoSession session = (IoSession) dbgr.getSession(args[0].getStringValue());
        if (session == null)
            return BooleanValue.FALSE;
        StringBuilder sb = new StringBuilder();
        sb.append(" -t ");
        sb.append(args[1].getStringValue());
        sb.append(" -f ");
        sb.append(args[2].getStringValue());
        sb.append(" -n ");
        sb.append(args[3].getStringValue());
        Command command = new org.exist.debuggee.dbgp.packets.BreakpointSet(session, sb.toString());
        command.exec();
        return BooleanValue.TRUE;
    } catch (Throwable e) {
        throw new XPathException(this, Module.DEBUG001, e);
    }
}
Also used : Debuggee(org.exist.debuggee.Debuggee) Command(org.exist.debuggee.dbgp.packets.Command) XPathException(org.exist.xquery.XPathException) IoSession(org.apache.mina.core.session.IoSession)

Example 8 with Command

use of org.exist.debuggee.dbgp.packets.Command in project exist by eXist-db.

the class BreakpointList method eval.

@Override
public Sequence eval(Sequence[] args, Sequence contextSequence) throws XPathException {
    try {
        Debuggee dbgr = BrokerPool.getInstance().getDebuggee();
        IoSession session = (IoSession) dbgr.getSession(args[0].getStringValue());
        if (session == null)
            return BooleanValue.FALSE;
        Command command = new org.exist.debuggee.dbgp.packets.BreakpointList(session, "");
        command.exec();
        return Utils.nodeFromString(getContext(), new String(command.responseBytes()));
    } catch (Throwable e) {
        throw new XPathException(this, Module.DEBUG001, e);
    }
}
Also used : Debuggee(org.exist.debuggee.Debuggee) Command(org.exist.debuggee.dbgp.packets.Command) XPathException(org.exist.xquery.XPathException) IoSession(org.apache.mina.core.session.IoSession)

Example 9 with Command

use of org.exist.debuggee.dbgp.packets.Command in project exist by eXist-db.

the class Source method eval.

@Override
public Sequence eval(Sequence[] args, Sequence contextSequence) throws XPathException {
    try {
        Debuggee dbgr = BrokerPool.getInstance().getDebuggee();
        IoSession session = (IoSession) dbgr.getSession(args[0].getStringValue());
        if (session == null)
            return StringValue.EMPTY_STRING;
        Command command = new org.exist.debuggee.dbgp.packets.Source(session, "f " + args[1].getStringValue());
        command.exec();
        return Utils.nodeFromString(getContext(), new String(command.responseBytes()));
    } catch (Throwable e) {
        throw new XPathException(this, Module.DEBUG001, e);
    }
}
Also used : Debuggee(org.exist.debuggee.Debuggee) Command(org.exist.debuggee.dbgp.packets.Command) XPathException(org.exist.xquery.XPathException) IoSession(org.apache.mina.core.session.IoSession)

Example 10 with Command

use of org.exist.debuggee.dbgp.packets.Command in project exist by eXist-db.

the class StepInto method eval.

@Override
public Sequence eval(Sequence[] args, Sequence contextSequence) throws XPathException {
    try {
        Debuggee dbgr = BrokerPool.getInstance().getDebuggee();
        IoSession session = (IoSession) dbgr.getSession(args[0].getStringValue());
        if (session == null)
            return BooleanValue.FALSE;
        Command command = new org.exist.debuggee.dbgp.packets.StepInto(session, "");
        command.exec();
        return BooleanValue.TRUE;
    } catch (Throwable e) {
        throw new XPathException(this, Module.DEBUG001, e);
    }
}
Also used : Debuggee(org.exist.debuggee.Debuggee) Command(org.exist.debuggee.dbgp.packets.Command) XPathException(org.exist.xquery.XPathException) IoSession(org.apache.mina.core.session.IoSession)

Aggregations

Command (org.exist.debuggee.dbgp.packets.Command)12 IoSession (org.apache.mina.core.session.IoSession)10 Debuggee (org.exist.debuggee.Debuggee)10 XPathException (org.exist.xquery.XPathException)10 CommandContinuation (org.exist.debuggee.CommandContinuation)1