use of com.oracle.truffle.api.debug.SuspendedEvent in project graal by oracle.
the class DebuggerSessionTest method testSuspendAll2.
@Test
public void testSuspendAll2() {
Source testSource = testSource("ROOT(\n" + "STATEMENT,\n" + "STATEMENT)");
try (DebuggerSession session = startSession()) {
suspendAll(session);
startEval(testSource);
expectSuspended((SuspendedEvent event) -> {
checkState(event, 2, true, "STATEMENT").prepareContinue();
});
// prepareContinue should be ignored here as suspenions counts higher
suspendAll(session);
expectSuspended((SuspendedEvent event) -> {
checkState(event, 3, true, "STATEMENT").prepareContinue();
});
expectDone();
}
}
use of com.oracle.truffle.api.debug.SuspendedEvent in project graal by oracle.
the class DebuggerSessionTest method testSuspendAll3.
@Test
public void testSuspendAll3() {
Source testSource = testSource("ROOT(\n" + "STATEMENT,\n" + "STATEMENT)");
try (DebuggerSession session = startSession()) {
suspendAll(session);
startEval(testSource);
expectSuspended((SuspendedEvent event) -> {
checkState(event, 2, true, "STATEMENT").prepareKill();
});
// For prepareKill additional suspensions should be ignored
suspendAll(session);
expectKilled();
}
}
use of com.oracle.truffle.api.debug.SuspendedEvent in project graal by oracle.
the class DebuggerSessionTest method testSuspendThread2.
@Test
public void testSuspendThread2() {
Source testSource = testSource("ROOT(\n" + "STATEMENT,\n" + "STATEMENT)");
try (DebuggerSession session = startSession()) {
suspend(session, getEvalThread());
startEval(testSource);
expectSuspended((SuspendedEvent event) -> {
checkState(event, 2, true, "STATEMENT").prepareContinue();
});
// prepareContinue should be ignored here as suspensions counts more
suspend(session, getEvalThread());
expectSuspended((SuspendedEvent event) -> {
checkState(event, 3, true, "STATEMENT").prepareContinue();
});
expectDone();
}
}
use of com.oracle.truffle.api.debug.SuspendedEvent in project graal by oracle.
the class DebuggerSessionTest method testSuspendThread3.
@Test
public void testSuspendThread3() {
Source testSource = testSource("ROOT(\n" + "STATEMENT,\n" + "STATEMENT)");
try (DebuggerSession session = startSession()) {
suspend(session, getEvalThread());
startEval(testSource);
expectSuspended((SuspendedEvent event) -> {
checkState(event, 2, true, "STATEMENT").prepareKill();
});
// For prepareKill additional suspensions should be ignored
suspend(session, getEvalThread());
expectKilled();
}
}
use of com.oracle.truffle.api.debug.SuspendedEvent in project graal by oracle.
the class DebuggerSessionTest method testSuspendNextExecution2.
@Test
public void testSuspendNextExecution2() {
Source testSource = testSource("ROOT(\n" + "STATEMENT,\n" + "STATEMENT)");
try (DebuggerSession session = startSession()) {
// calling it multiple times should not make a difference
session.suspendNextExecution();
session.suspendNextExecution();
session.suspendNextExecution();
startEval(testSource);
expectSuspended((SuspendedEvent event) -> {
checkState(event, 2, true, "STATEMENT").prepareContinue();
});
expectDone();
}
}
Aggregations