use of com.oracle.truffle.api.debug.DebuggerSession 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.DebuggerSession 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();
}
}
use of com.oracle.truffle.api.debug.DebuggerSession in project graal by oracle.
the class DebuggerSessionTest method testSuspendAll1.
@Test
public void testSuspendAll1() {
Source testSource = testSource("ROOT(\n" + "STATEMENT,\n" + "STATEMENT)");
try (DebuggerSession session = startSession()) {
for (int i = 0; i < 10; i++) {
suspendAll(session);
startEval(testSource);
expectSuspended((SuspendedEvent event) -> {
checkState(event, 2, true, "STATEMENT").prepareContinue();
});
expectDone();
}
}
}
use of com.oracle.truffle.api.debug.DebuggerSession in project graal by oracle.
the class DebuggerSessionTest method testClosing1.
@Test
public void testClosing1() {
Source testSource = testSource("ROOT(\n" + "STATEMENT,\n" + "STATEMENT)");
DebuggerSession session = startSession();
session.install(Breakpoint.newBuilder(getSourceImpl(testSource)).lineIs(3).build());
session.suspendNextExecution();
startEval(testSource);
expectSuspended((SuspendedEvent event) -> {
checkState(event, 2, true, "STATEMENT").prepareStepOver(1);
});
// closing the session should disable breakpoints and current stepping
session.close();
expectDone();
}
use of com.oracle.truffle.api.debug.DebuggerSession in project graal by oracle.
the class DebuggerSessionTest method testSuspendThread1.
@Test
public void testSuspendThread1() {
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++) {
suspend(session, getEvalThread());
startEval(testSource);
expectSuspended((SuspendedEvent event) -> {
checkState(event, 2, true, "STATEMENT").prepareContinue();
});
expectDone();
}
}
}
Aggregations