use of org.eclipse.che.api.debug.shared.model.impl.VariablePathImpl in project che by eclipse.
the class DebuggerService method getValue.
@GET
@Path("{id}/value")
@Produces(MediaType.APPLICATION_JSON)
public SimpleValueDto getValue(@PathParam("id") String sessionId, @Context UriInfo uriInfo) throws DebuggerException {
List<String> path = new ArrayList<>();
MultivaluedMap<String, String> parameters = uriInfo.getQueryParameters();
int i = 0;
String item;
while ((item = parameters.getFirst("path" + (i++))) != null) {
path.add(item);
}
VariablePath variablePath = new VariablePathImpl(path);
return asDto(debuggerManager.getDebugger(sessionId).getValue(variablePath));
}
use of org.eclipse.che.api.debug.shared.model.impl.VariablePathImpl in project che by eclipse.
the class ZendDebugger method sendGetVariables.
private void sendGetVariables() {
ZendDbgVariables zendVariablesExpression = new ZendDbgVariables(debugExpressionEvaluator);
zendVariablesExpression.evaluate();
List<IDbgVariable> variables = new ArrayList<>();
int variableId = 0;
for (IDbgExpression zendVariableExpression : zendVariablesExpression.getChildren()) {
if (VariablesStorage.GLOBALS_VARIABLE.equalsIgnoreCase(zendVariableExpression.getExpression()))
continue;
IDbgVariable variable = new ZendDbgVariable(new VariablePathImpl(String.valueOf(variableId++)), zendVariableExpression);
if (ZendDbgVariableUtils.isThis(zendVariableExpression.getExpression())) {
// $this always on top
variables.add(0, variable);
} else {
variables.add(variable);
}
}
debugVariableStorage = new VariablesStorage(variables);
}
use of org.eclipse.che.api.debug.shared.model.impl.VariablePathImpl in project che by eclipse.
the class ZendDbgSessionTest method testSetValue.
@Test(groups = { "zendDbg" }, dependsOnGroups = { "checkPHP" })
public void testSetValue() throws Exception {
List<Breakpoint> breakpoints = new ArrayList<>();
Breakpoint bp1 = new BreakpointImpl(ZendDbgLocationHandler.createDBG(dbgHelloFile, 5));
breakpoints.add(bp1);
triggerSession(dbgHelloFile, getDbgSettings(false, false), breakpoints);
awaitBreakpointActivated(bp1);
awaitSuspend(dbgHelloFile, 5);
StackFrameDump stackFrameDump = debugger.dumpStackFrame();
int lastVar = stackFrameDump.getVariables().size() - 1;
Variable variableToFind = new VariableImpl(null, null, "123", false, new VariablePathImpl(String.valueOf(lastVar)), Collections.emptyList(), false);
debugger.setValue(variableToFind);
assertEquals(stackFrameDump.getVariables().get(lastVar).getValue(), "123");
variableToFind = new VariableImpl(null, null, "\"ABC\"", false, new VariablePathImpl(String.valueOf(lastVar)), Collections.emptyList(), false);
debugger.setValue(variableToFind);
assertEquals(stackFrameDump.getVariables().get(lastVar).getValue(), "\"ABC\"");
}
Aggregations