use of org.eclipse.che.api.debug.shared.model.Breakpoint in project che by eclipse.
the class ZendDebugger method start.
@Override
public void start(StartAction action) throws DebuggerException {
// Initialize connection daemon thread
debugConnection.connect();
for (Breakpoint breakpoint : action.getBreakpoints()) {
breakpoints.put(breakpoint, ZendDbgBreakpoint.create(breakpoint, debugLocationHandler));
}
LOG.debug("Connect {}:{}", debugSettings.getClientHostIP(), debugSettings.getDebugPort());
}
use of org.eclipse.che.api.debug.shared.model.Breakpoint in project che by eclipse.
the class ZendDebugger method deleteBreakpoint.
@Override
public void deleteBreakpoint(Location location) throws DebuggerException {
Breakpoint matchingBreakpoint = null;
for (Breakpoint breakpoint : breakpoints.keySet()) {
if (breakpoint.getLocation().equals(location)) {
matchingBreakpoint = breakpoint;
break;
}
}
if (matchingBreakpoint == null) {
return;
}
ZendDbgBreakpoint dbgBreakpoint = breakpoints.remove(matchingBreakpoint);
// Unregister breakpoint if it was registered in active session
if (breakpointIds.containsKey(dbgBreakpoint)) {
int breakpointId = breakpointIds.remove(dbgBreakpoint);
sendDeleteBreakpoint(breakpointId);
}
}
use of org.eclipse.che.api.debug.shared.model.Breakpoint in project che by eclipse.
the class BreakpointActivatedEventImpl method hashCode.
@Override
public int hashCode() {
int result = super.hashCode();
result = 31 * result + (breakpoint != null ? breakpoint.hashCode() : 0);
return result;
}
use of org.eclipse.che.api.debug.shared.model.Breakpoint in project che by eclipse.
the class ZendDbgSessionTest method testBreakpoints.
@Test(groups = { "zendDbg" }, dependsOnGroups = { "checkPHP" })
public void testBreakpoints() throws Exception {
List<Breakpoint> breakpoints = new ArrayList<>();
Breakpoint bp1 = new BreakpointImpl(ZendDbgLocationHandler.createDBG(dbgHelloFile, 4));
Breakpoint bp2 = new BreakpointImpl(ZendDbgLocationHandler.createDBG(dbgHelloFile, 8));
breakpoints.add(bp1);
breakpoints.add(bp2);
triggerSession(dbgHelloFile, getDbgSettings(true, false), breakpoints);
awaitBreakpointActivated(bp1);
awaitBreakpointActivated(bp2);
awaitSuspend(dbgHelloFile, 2);
Breakpoint bp3 = new BreakpointImpl(ZendDbgLocationHandler.createDBG(dbgClassesFile, 10));
debugger.addBreakpoint(bp3);
awaitBreakpointActivated(bp3);
Breakpoint bp4 = new BreakpointImpl(ZendDbgLocationHandler.createDBG(dbgClassesFile, 16));
debugger.addBreakpoint(bp4);
awaitBreakpointActivated(bp4);
debugger.deleteBreakpoint(ZendDbgLocationHandler.createDBG(dbgHelloFile, 8));
debugger.deleteBreakpoint(ZendDbgLocationHandler.createDBG(dbgClassesFile, 16));
assertEquals(debugger.getAllBreakpoints().size(), 2);
debugger.deleteAllBreakpoints();
assertTrue(debugger.getAllBreakpoints().isEmpty());
}
use of org.eclipse.che.api.debug.shared.model.Breakpoint in project che by eclipse.
the class ZendDbgSessionTest method testGetValue.
@Test(groups = { "zendDbg" }, dependsOnGroups = { "checkPHP" })
public void testGetValue() throws Exception {
List<Breakpoint> breakpoints = new ArrayList<>();
Breakpoint bp1 = new BreakpointImpl(ZendDbgLocationHandler.createDBG(dbgClassesFile, 16));
breakpoints.add(bp1);
triggerSession(dbgHelloFile, getDbgSettings(false, false), breakpoints);
awaitBreakpointActivated(bp1);
awaitSuspend(dbgClassesFile, 16);
debugger.dumpStackFrame();
VariablePath variablePath = new VariablePathImpl("0");
SimpleValue simpleValue = debugger.getValue(variablePath);
assertEquals(simpleValue.getVariables().size(), 3);
List<String> path = Arrays.asList("0", "0");
variablePath = new VariablePathImpl(path);
simpleValue = debugger.getValue(variablePath);
assertEquals(simpleValue.getValue(), "\"A\"");
path = Arrays.asList("0", "1");
variablePath = new VariablePathImpl(path);
simpleValue = debugger.getValue(variablePath);
assertEquals(simpleValue.getValue(), "123");
path = Arrays.asList("0", "2");
variablePath = new VariablePathImpl(path);
simpleValue = debugger.getValue(variablePath);
assertEquals(simpleValue.getValue(), "array [3]");
}
Aggregations