use of com.oracle.truffle.api.debug.SuspendedEvent in project graal by oracle.
the class DebuggerSessionTest method testSuspendNextExecution3.
@Test
public void testSuspendNextExecution3() {
Source testSource = testSource("ROOT(\n" + "STATEMENT,\n" + "STATEMENT)");
try (DebuggerSession session = startSession()) {
// do suspend next for a few times
for (int i = 0; i < 100; i++) {
session.suspendNextExecution();
startEval(testSource);
expectSuspended((SuspendedEvent event) -> {
checkState(event, 2, true, "STATEMENT").prepareContinue();
});
expectDone();
}
}
}
use of com.oracle.truffle.api.debug.SuspendedEvent in project graal by oracle.
the class DebuggerSessionTest method testSuspendNextExecution4.
@Test
public void testSuspendNextExecution4() {
Source testSource = testSource("ROOT(\n" + "STATEMENT,\n" + "STATEMENT)");
try (DebuggerSession session = startSession()) {
session.suspendNextExecution();
startEval(testSource);
expectSuspended((SuspendedEvent event) -> {
checkState(event, 2, true, "STATEMENT").prepareContinue();
// use suspend next in an event
event.getSession().suspendNextExecution();
});
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 testResumeThread2.
@Test
public void testResumeThread2() {
Source testSource = testSource("ROOT(\n" + "STATEMENT,\n" + "STATEMENT)");
try (DebuggerSession session = startSession()) {
for (int i = 0; i < 10; i++) {
session.suspendNextExecution();
resume(session, getEvalThread());
startEval(testSource);
// even if the thread is resumed suspend next execution will trigger.
expectSuspended((SuspendedEvent event) -> {
checkState(event, 2, true, "STATEMENT").prepareStepOver(1);
});
resume(session, getEvalThread());
expectDone();
}
}
}
use of com.oracle.truffle.api.debug.SuspendedEvent in project graal by oracle.
the class DebuggerSessionTest method testResumeThread1.
@Test
public void testResumeThread1() {
Source testSource = testSource("ROOT(\n" + "STATEMENT,\n" + "STATEMENT)");
try (DebuggerSession session = startSession()) {
for (int i = 0; i < 10; i++) {
session.suspendNextExecution();
startEval(testSource);
expectSuspended((SuspendedEvent event) -> {
checkState(event, 2, true, "STATEMENT").prepareStepOver(1);
});
// resume events are ignored by stepping
resume(session, getEvalThread());
expectDone();
}
}
}
use of com.oracle.truffle.api.debug.SuspendedEvent in project graal by oracle.
the class DebuggerSessionTest method testSuspendNextExecution1.
@Test
public void testSuspendNextExecution1() {
Source testSource = testSource("ROOT(\n" + "STATEMENT,\n" + "STATEMENT)");
try (DebuggerSession session = startSession()) {
session.suspendNextExecution();
startEval(testSource);
expectSuspended((SuspendedEvent event) -> {
checkState(event, 2, true, "STATEMENT").prepareContinue();
});
expectDone();
}
}
Aggregations