Search in sources :

Example 1 with IDbgExpression

use of org.eclipse.che.plugin.zdb.server.expressions.IDbgExpression in project che by eclipse.

the class ZendDbgVariable method makeComplete.

@Override
public void makeComplete() {
    if (!isComplete) {
        // Evaluate wrapped expression to fetch all child variables
        zendDbgExpression.evaluate();
        variables = new ArrayList<>();
        int childId = 0;
        for (IDbgExpression child : zendDbgExpression.getChildren()) {
            List<String> childPath = new ArrayList<>(variablePath.getPath());
            childPath.add(String.valueOf(childId++));
            variables.add(new ZendDbgVariable(new VariablePathImpl(childPath), child));
        }
        isComplete = true;
    }
}
Also used : VariablePathImpl(org.eclipse.che.api.debug.shared.model.impl.VariablePathImpl) IDbgExpression(org.eclipse.che.plugin.zdb.server.expressions.IDbgExpression) ArrayList(java.util.ArrayList)

Example 2 with IDbgExpression

use of org.eclipse.che.plugin.zdb.server.expressions.IDbgExpression 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);
}
Also used : IDbgVariable(org.eclipse.che.plugin.zdb.server.variables.IDbgVariable) VariablePathImpl(org.eclipse.che.api.debug.shared.model.impl.VariablePathImpl) IDbgExpression(org.eclipse.che.plugin.zdb.server.expressions.IDbgExpression) ArrayList(java.util.ArrayList) ZendDbgVariables(org.eclipse.che.plugin.zdb.server.variables.ZendDbgVariables) ZendDbgVariable(org.eclipse.che.plugin.zdb.server.variables.ZendDbgVariable) Breakpoint(org.eclipse.che.api.debug.shared.model.Breakpoint)

Aggregations

ArrayList (java.util.ArrayList)2 VariablePathImpl (org.eclipse.che.api.debug.shared.model.impl.VariablePathImpl)2 IDbgExpression (org.eclipse.che.plugin.zdb.server.expressions.IDbgExpression)2 Breakpoint (org.eclipse.che.api.debug.shared.model.Breakpoint)1 IDbgVariable (org.eclipse.che.plugin.zdb.server.variables.IDbgVariable)1 ZendDbgVariable (org.eclipse.che.plugin.zdb.server.variables.ZendDbgVariable)1 ZendDbgVariables (org.eclipse.che.plugin.zdb.server.variables.ZendDbgVariables)1