use of com.oracle.truffle.api.debug.DebuggerSession in project graal by oracle.
the class DebuggerSessionTest method testResumeAll1.
@Test
public void testResumeAll1() {
Source testSource = testSource("ROOT(\n" + "STATEMENT,\n" + "STATEMENT)");
try (DebuggerSession session = startSession()) {
for (int i = 0; i < 10; i++) {
session.suspendNextExecution();
// resume all invalidates suspendNextExecution
session.resumeAll();
startEval(testSource);
expectDone();
}
}
}
use of com.oracle.truffle.api.debug.DebuggerSession 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.DebuggerSession 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();
}
}
use of com.oracle.truffle.api.debug.DebuggerSession in project graal by oracle.
the class DebuggerSessionTest method testResumeAll2.
@Test
public void testResumeAll2() {
Source testSource = testSource("ROOT(\n" + "STATEMENT,\n" + "STATEMENT)");
try (DebuggerSession session = startSession()) {
for (int i = 0; i < 10; i++) {
suspendAll(session);
session.resumeAll();
startEval(testSource);
expectDone();
}
}
}
use of com.oracle.truffle.api.debug.DebuggerSession in project graal by oracle.
the class DebuggerThreadsTest method testSingleThread.
@Test
public void testSingleThread() throws Throwable {
final Source source = testSource("STATEMENT()");
TestThreadsListener threadsListener = new TestThreadsListener();
List<ThreadEvent> events = threadsListener.events;
try (DebuggerSession session = startSession()) {
session.suspendNextExecution();
session.setThreadsListener(threadsListener, false);
startEval(source);
expectSuspended((SuspendedEvent event) -> {
assertEquals(1, events.size());
assertTrue(events.get(0).isNew);
assertEquals(Thread.currentThread(), events.get(0).thread);
assertNotNull(events.get(0).context);
});
expectDone();
closeEngine();
// We're closing the engine not on the execution thread - we get two more thread events.
assertEquals(4, events.size());
assertFalse(events.get(3).isNew);
assertEquals(events.get(0).context, events.get(3).context);
}
events.clear();
}
Aggregations