use of org.develnext.jphp.debug.impl.DebugTick in project jphp by jphp-compiler.
the class EvalCommand method getValue.
public static Memory getValue(Debugger context, String value) {
DebugTick tick = context.getRegisteredTick();
Environment environment = new Environment(new CompileScope(tick.getEnvironment().getScope()));
try {
return EvalFunctions.eval(environment, tick.getTrace(), tick.getLocals(), "return " + value + ";");
} catch (Throwable throwable) {
return null;
}
}
use of org.develnext.jphp.debug.impl.DebugTick in project jphp by jphp-compiler.
the class PropertyGetCommand method run.
@Override
public void run(Debugger context, CommandArguments args, Document result) {
DebugTick tick = context.getRegisteredTick();
Element response = createResponse(args, result);
response.setAttribute("encoding", "base64");
String varName = args.get("n");
if (varName.startsWith("$")) {
varName = varName.substring(1);
}
ArrayMemory locals = tick.getLocals();
if (!locals.containsKey(varName)) {
return;
}
ContextValueProvider provider = getContextValueProvider(context, result);
if (provider.getMaxData() != 0 && args.containsKey("m")) {
try {
provider.setMaxData(Integer.parseInt(args.get("m")));
} catch (NumberFormatException e) {
return;
}
}
Element property = provider.getProperty(null, locals.valueOfIndex(varName));
response.setAttribute("size", property.getAttribute("size"));
response.appendChild(property.getFirstChild());
}
use of org.develnext.jphp.debug.impl.DebugTick in project jphp by jphp-compiler.
the class RunCommand method run.
@Override
public void run(Debugger context, CommandArguments args, Document result) {
DebugTick tick = context.runTicks();
Element response = createResponse(args, result);
response.setAttribute("reason", "ok");
if (tick.getBreakpoint() != null) {
response.setAttribute("status", "break");
} else {
response.setAttribute("status", "stopping");
}
if (tick.getTrace() != null) {
Element message = result.createElement("xdebug:message");
message.setAttribute("filename", context.getFileName(tick.getTrace().getFileName()));
message.setAttribute("lineno", String.valueOf(tick.getTrace().getStartLine() + 1));
response.appendChild(message);
}
}
use of org.develnext.jphp.debug.impl.DebugTick in project jphp by jphp-compiler.
the class StepIntoCommand method run.
@Override
public void run(Debugger context, CommandArguments args, Document result) {
DebugTick tick = context.waitTick(Debugger.Step.INTO);
Element response = createResponse(args, result);
response.setAttribute("reason", "ok");
response.setAttribute("status", "break");
if (tick.getTrace() != null) {
Element message = result.createElement("xdebug:message");
message.setAttribute("filename", context.getFileName(tick.getTrace().getFileName()));
message.setAttribute("lineno", String.valueOf(tick.getTrace().getStartLine() + 1));
response.appendChild(message);
}
}
use of org.develnext.jphp.debug.impl.DebugTick in project jphp by jphp-compiler.
the class StepOverCommand method run.
@Override
public void run(Debugger context, CommandArguments args, Document result) {
DebugTick tick = context.waitTick(Debugger.Step.OVER);
Element response = createResponse(args, result);
response.setAttribute("reason", "ok");
response.setAttribute("status", "break");
if (tick.getTrace() != null) {
Element message = result.createElement("xdebug:message");
message.setAttribute("filename", context.getFileName(tick.getTrace().getFileName()));
message.setAttribute("lineno", String.valueOf(tick.getTrace().getStartLine() + 1));
response.appendChild(message);
}
}
Aggregations