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();
}
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);
}
}
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());
}
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);
}
}
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);
}
Aggregations