Search in sources :

Example 16 with BreakpointImpl

use of org.eclipse.che.api.debug.shared.model.impl.BreakpointImpl 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\"");
}
Also used : Breakpoint(org.eclipse.che.api.debug.shared.model.Breakpoint) VariableImpl(org.eclipse.che.api.debug.shared.model.impl.VariableImpl) BreakpointImpl(org.eclipse.che.api.debug.shared.model.impl.BreakpointImpl) Variable(org.eclipse.che.api.debug.shared.model.Variable) VariablePathImpl(org.eclipse.che.api.debug.shared.model.impl.VariablePathImpl) ArrayList(java.util.ArrayList) StackFrameDump(org.eclipse.che.api.debug.shared.model.StackFrameDump) Breakpoint(org.eclipse.che.api.debug.shared.model.Breakpoint) Test(org.testng.annotations.Test)

Example 17 with BreakpointImpl

use of org.eclipse.che.api.debug.shared.model.impl.BreakpointImpl in project che by eclipse.

the class GdbContinue method parse.

/**
     * Factory method.
     */
public static GdbContinue parse(GdbOutput gdbOutput) throws GdbParseException {
    String output = gdbOutput.getOutput();
    for (String line : output.split("\n")) {
        Matcher matcher = GDB_BREAKPOINT.matcher(line);
        if (matcher.find()) {
            String file = matcher.group(1);
            String lineNumber = matcher.group(2);
            Location location = new LocationImpl(file, Integer.parseInt(lineNumber));
            return new GdbContinue(new BreakpointImpl(location));
        }
    }
    return new GdbContinue(null);
}
Also used : BreakpointImpl(org.eclipse.che.api.debug.shared.model.impl.BreakpointImpl) Matcher(java.util.regex.Matcher) LocationImpl(org.eclipse.che.api.debug.shared.model.impl.LocationImpl) Location(org.eclipse.che.api.debug.shared.model.Location)

Aggregations

BreakpointImpl (org.eclipse.che.api.debug.shared.model.impl.BreakpointImpl)17 Breakpoint (org.eclipse.che.api.debug.shared.model.Breakpoint)13 LocationImpl (org.eclipse.che.api.debug.shared.model.impl.LocationImpl)11 Test (org.testng.annotations.Test)10 Location (org.eclipse.che.api.debug.shared.model.Location)9 ArrayList (java.util.ArrayList)7 BreakpointActivatedEvent (org.eclipse.che.api.debug.shared.model.event.BreakpointActivatedEvent)6 DebuggerEvent (org.eclipse.che.api.debug.shared.model.event.DebuggerEvent)5 Matcher (java.util.regex.Matcher)3 ResumeActionImpl (org.eclipse.che.api.debug.shared.model.impl.action.ResumeActionImpl)3 StackFrameDump (org.eclipse.che.api.debug.shared.model.StackFrameDump)2 SuspendEvent (org.eclipse.che.api.debug.shared.model.event.SuspendEvent)2 VariablePathImpl (org.eclipse.che.api.debug.shared.model.impl.VariablePathImpl)2 JsonElement (com.google.gson.JsonElement)1 JsonObject (com.google.gson.JsonObject)1 JsonParser (com.google.gson.JsonParser)1 AbsentInformationException (com.sun.jdi.AbsentInformationException)1 ClassNotPreparedException (com.sun.jdi.ClassNotPreparedException)1 NativeMethodException (com.sun.jdi.NativeMethodException)1 ReferenceType (com.sun.jdi.ReferenceType)1