Search in sources :

Example 1 with Breakpoint

use of org.develnext.jphp.debug.impl.breakpoint.Breakpoint in project jphp by jphp-compiler.

the class DebugTickHandler method onTick.

@Override
public void onTick(Environment env, TraceInfo trace, ArrayMemory locals) {
    waitDebugger();
    if (!init) {
        init = true;
        debugger.registerBreak(null, env, trace, locals);
        return;
    }
    DebugTick oldTick = debugger.getRegisteredTick();
    Debugger.Step waitStep = debugger.getWaitStep();
    Breakpoint breakpoint = debugger.breakpointManager.findFor(env, trace);
    switch(waitStep) {
        case OVER:
            if (oldTick.getCallStack().getTop() >= env.getCallStackTop()) {
                debugger.registerBreak(breakpoint, env, trace, locals);
            }
            break;
        case OUT:
            if (oldTick.getCallStack().getTop() > env.getCallStackTop()) {
                debugger.registerBreak(breakpoint, env, trace, locals);
            }
            break;
        case INTO:
            debugger.registerBreak(breakpoint, env, trace, locals);
            break;
        case RUN:
            if (breakpoint != null) {
                debugger.registerBreak(breakpoint, env, trace, locals);
            }
    }
    waitDebugger();
}
Also used : Debugger(org.develnext.jphp.debug.impl.Debugger) DebugTick(org.develnext.jphp.debug.impl.DebugTick) Breakpoint(org.develnext.jphp.debug.impl.breakpoint.Breakpoint)

Example 2 with Breakpoint

use of org.develnext.jphp.debug.impl.breakpoint.Breakpoint in project jphp by jphp-compiler.

the class BreakpointListCommand method run.

@Override
public void run(Debugger context, CommandArguments args, Document result) {
    Element response = createResponse(args, result);
    for (Breakpoint breakpoint : context.breakpointManager.all()) {
        Element breakpointEl = result.createElement("breakpoint");
        breakpoint.output(breakpointEl);
        response.appendChild(breakpointEl);
    }
}
Also used : Breakpoint(org.develnext.jphp.debug.impl.breakpoint.Breakpoint) Element(org.w3c.dom.Element)

Example 3 with Breakpoint

use of org.develnext.jphp.debug.impl.breakpoint.Breakpoint in project jphp by jphp-compiler.

the class BreakpointSetCommand method run.

@Override
public void run(Debugger context, CommandArguments args, Document result) {
    Breakpoint breakpoint = Breakpoint.build(args);
    context.breakpointManager.set(breakpoint);
    Element response = createResponse(args, result);
    response.setAttribute("id", String.valueOf(breakpoint.getId()));
    response.setAttribute("state", breakpoint.getState());
}
Also used : Breakpoint(org.develnext.jphp.debug.impl.breakpoint.Breakpoint) Element(org.w3c.dom.Element)

Example 4 with Breakpoint

use of org.develnext.jphp.debug.impl.breakpoint.Breakpoint in project jphp by jphp-compiler.

the class BreakpointGetCommand method run.

@Override
public void run(Debugger context, CommandArguments args, Document result) {
    Breakpoint breakpoint = context.breakpointManager.get(args.get("d"));
    Element response = createResponse(args, result);
    if (breakpoint != null) {
        Element breakpointEl = result.createElement("breakpoint");
        breakpoint.output(breakpointEl);
        response.appendChild(breakpointEl);
    }
}
Also used : Breakpoint(org.develnext.jphp.debug.impl.breakpoint.Breakpoint) Element(org.w3c.dom.Element)

Example 5 with Breakpoint

use of org.develnext.jphp.debug.impl.breakpoint.Breakpoint in project jphp by jphp-compiler.

the class BreakpointRemoveCommand method run.

@Override
public void run(Debugger context, CommandArguments args, Document result) {
    Breakpoint breakpoint = context.breakpointManager.remove(args.get("d"));
    createResponse(args, result);
}
Also used : Breakpoint(org.develnext.jphp.debug.impl.breakpoint.Breakpoint)

Aggregations

Breakpoint (org.develnext.jphp.debug.impl.breakpoint.Breakpoint)5 Element (org.w3c.dom.Element)3 DebugTick (org.develnext.jphp.debug.impl.DebugTick)1 Debugger (org.develnext.jphp.debug.impl.Debugger)1