Search in sources :

Example 6 with Debuggee

use of org.exist.debuggee.Debuggee 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 7 with Debuggee

use of org.exist.debuggee.Debuggee 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 8 with Debuggee

use of org.exist.debuggee.Debuggee 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 9 with Debuggee

use of org.exist.debuggee.Debuggee 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)

Example 10 with Debuggee

use of org.exist.debuggee.Debuggee 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)

Aggregations

Debuggee (org.exist.debuggee.Debuggee)11 IoSession (org.apache.mina.core.session.IoSession)10 Command (org.exist.debuggee.dbgp.packets.Command)10 XPathException (org.exist.xquery.XPathException)10 NumberFormat (java.text.NumberFormat)1 EffectiveSubject (org.exist.security.EffectiveSubject)1 Permission (org.exist.security.Permission)1 Subject (org.exist.security.Subject)1 DBSource (org.exist.source.DBSource)1 FileSource (org.exist.source.FileSource)1 Source (org.exist.source.Source)1 StringSource (org.exist.source.StringSource)1 Sequence (org.exist.xquery.value.Sequence)1