Search in sources :

Example 6 with SuspendEvent

use of org.eclipse.che.api.debug.shared.model.event.SuspendEvent in project che by eclipse.

the class GdbDebuggerTest method startDebugger.

private void startDebugger() throws DebuggerException, InterruptedException {
    gdbDebugger.start(new StartActionImpl(Collections.emptyList()));
    assertEquals(events.size(), 1);
    DebuggerEvent debuggerEvent = events.take();
    assertTrue(debuggerEvent instanceof SuspendEvent);
    SuspendEvent suspendEvent = (SuspendEvent) debuggerEvent;
    assertEquals(suspendEvent.getLocation().getTarget(), "h.cpp");
    assertEquals(suspendEvent.getLocation().getLineNumber(), 7);
}
Also used : SuspendEvent(org.eclipse.che.api.debug.shared.model.event.SuspendEvent) StartActionImpl(org.eclipse.che.api.debug.shared.model.impl.action.StartActionImpl) DebuggerEvent(org.eclipse.che.api.debug.shared.model.event.DebuggerEvent)

Example 7 with SuspendEvent

use of org.eclipse.che.api.debug.shared.model.event.SuspendEvent in project che by eclipse.

the class GdbDebuggerTest method stepOver.

private void stepOver() throws DebuggerException, InterruptedException {
    gdbDebugger.stepOver(new StepOverActionImpl());
    DebuggerEvent debuggerEvent = events.take();
    assertTrue(debuggerEvent instanceof SuspendEvent);
    SuspendEvent suspendEvent = (SuspendEvent) debuggerEvent;
    assertEquals(suspendEvent.getLocation().getTarget(), "h.cpp");
    assertEquals(suspendEvent.getLocation().getLineNumber(), 5);
    gdbDebugger.stepOver(new StepOverActionImpl());
    debuggerEvent = events.take();
    assertTrue(debuggerEvent instanceof SuspendEvent);
    suspendEvent = (SuspendEvent) debuggerEvent;
    assertEquals(suspendEvent.getLocation().getTarget(), "h.cpp");
    assertEquals(suspendEvent.getLocation().getLineNumber(), 6);
    gdbDebugger.stepOver(new StepOverActionImpl());
    debuggerEvent = events.take();
    assertTrue(debuggerEvent instanceof SuspendEvent);
    suspendEvent = (SuspendEvent) debuggerEvent;
    assertEquals(suspendEvent.getLocation().getTarget(), "h.cpp");
    assertEquals(suspendEvent.getLocation().getLineNumber(), 7);
}
Also used : StepOverActionImpl(org.eclipse.che.api.debug.shared.model.impl.action.StepOverActionImpl) SuspendEvent(org.eclipse.che.api.debug.shared.model.event.SuspendEvent) DebuggerEvent(org.eclipse.che.api.debug.shared.model.event.DebuggerEvent)

Example 8 with SuspendEvent

use of org.eclipse.che.api.debug.shared.model.event.SuspendEvent in project che by eclipse.

the class GdbDebuggerTest method stepOut.

private void stepOut() throws DebuggerException, InterruptedException {
    try {
        gdbDebugger.stepOut(new StepOutActionImpl());
    } catch (DebuggerException e) {
    // ignore
    }
    DebuggerEvent debuggerEvent = events.take();
    assertTrue(debuggerEvent instanceof SuspendEvent);
}
Also used : SuspendEvent(org.eclipse.che.api.debug.shared.model.event.SuspendEvent) DebuggerException(org.eclipse.che.api.debugger.server.exceptions.DebuggerException) StepOutActionImpl(org.eclipse.che.api.debug.shared.model.impl.action.StepOutActionImpl) DebuggerEvent(org.eclipse.che.api.debug.shared.model.event.DebuggerEvent)

Example 9 with SuspendEvent

use of org.eclipse.che.api.debug.shared.model.event.SuspendEvent in project che by eclipse.

the class AbstractZendDbgSessionTest method awaitSuspend.

protected void awaitSuspend(String dbgFile, int lineNumber) throws Exception {
    DebuggerEvent debuggerEvent = dbgEvents.poll(5, TimeUnit.SECONDS);
    if (debuggerEvent == null) {
        throw new Exception("Suspend event timeout occurred.");
    }
    assertTrue(debuggerEvent instanceof SuspendEvent);
    SuspendEvent suspendEvent = (SuspendEvent) debuggerEvent;
    assertEquals(suspendEvent.getLocation().getResourcePath(), dbgFile);
    assertEquals(suspendEvent.getLocation().getLineNumber(), lineNumber);
}
Also used : SuspendEvent(org.eclipse.che.api.debug.shared.model.event.SuspendEvent) DebuggerEvent(org.eclipse.che.api.debug.shared.model.event.DebuggerEvent)

Aggregations

SuspendEvent (org.eclipse.che.api.debug.shared.model.event.SuspendEvent)9 DebuggerEvent (org.eclipse.che.api.debug.shared.model.event.DebuggerEvent)7 Test (org.testng.annotations.Test)4 StepOutActionImpl (org.eclipse.che.api.debug.shared.model.impl.action.StepOutActionImpl)3 StepOverActionImpl (org.eclipse.che.api.debug.shared.model.impl.action.StepOverActionImpl)3 Location (org.eclipse.che.api.debug.shared.model.Location)2 BreakpointActivatedEvent (org.eclipse.che.api.debug.shared.model.event.BreakpointActivatedEvent)2 BreakpointImpl (org.eclipse.che.api.debug.shared.model.impl.BreakpointImpl)2 LocationImpl (org.eclipse.che.api.debug.shared.model.impl.LocationImpl)2 ResumeActionImpl (org.eclipse.che.api.debug.shared.model.impl.action.ResumeActionImpl)2 StartActionImpl (org.eclipse.che.api.debug.shared.model.impl.action.StartActionImpl)2 StepIntoActionImpl (org.eclipse.che.api.debug.shared.model.impl.action.StepIntoActionImpl)2 DebuggerException (org.eclipse.che.api.debugger.server.exceptions.DebuggerException)1