Search in sources :

Example 11 with Command

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

the class StepOver 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.StepOver(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 12 with Command

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

the class StackGet 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 Sequence.EMPTY_SEQUENCE;
        Command command = new org.exist.debuggee.dbgp.packets.StackGet(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)

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