use of org.develnext.jphp.debug.impl.command.support.ContextValueProvider in project jphp by jphp-compiler.
the class ContextGetCommand method run.
@Override
public void run(Debugger context, CommandArguments args, Document result) {
Element response = createResponse(args, result);
String contextId = args.get("c");
response.setAttribute("context", contextId);
ContextValueProvider contextValueProvider = new ContextValueProvider(context, result);
switch(contextId) {
case "0":
DebugTick tick = context.getRegisteredTick();
ForeachIterator iterator = tick.getLocals().foreachIterator(true, false);
while (iterator.next()) {
Memory value = iterator.getValue().toValue();
if (value.isUndefined()) {
continue;
}
response.appendChild(contextValueProvider.getProperty(iterator.getKey().toString(), value));
}
break;
}
}
use of org.develnext.jphp.debug.impl.command.support.ContextValueProvider in project jphp by jphp-compiler.
the class EvalCommand method run.
@Override
public void run(Debugger context, CommandArguments args, Document result) {
String content = args.getContent();
Element response = createResponse(args, result);
response.setAttribute("success", "1");
ContextValueProvider valueProvider = new ContextValueProvider(context, result);
valueProvider.setMaxData(0);
Memory value = getValue(context, content);
if (value == null) {
response.setAttribute("success", "0");
} else {
response.appendChild(valueProvider.getProperty(null, value));
}
}
use of org.develnext.jphp.debug.impl.command.support.ContextValueProvider 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.command.support.ContextValueProvider in project jphp by jphp-compiler.
the class PropertyValueCommand method getContextValueProvider.
@Override
protected ContextValueProvider getContextValueProvider(Debugger debugger, Document document) {
ContextValueProvider valueProvider = new ContextValueProvider(debugger, document);
valueProvider.setMaxData(0);
return valueProvider;
}
Aggregations