| Index: runtime/vm/debugger_api_impl_test.cc
|
| ===================================================================
|
| --- runtime/vm/debugger_api_impl_test.cc (revision 32907)
|
| +++ runtime/vm/debugger_api_impl_test.cc (working copy)
|
| @@ -1308,10 +1308,19 @@
|
|
|
| static Monitor* sync = NULL;
|
| static bool isolate_interrupted = false;
|
| +static bool pause_event_handled = false;
|
| static Dart_IsolateId interrupt_isolate_id = ILLEGAL_ISOLATE_ID;
|
| static volatile bool continue_isolate_loop = true;
|
|
|
|
|
| +static void InterruptIsolateHandler(Dart_IsolateId isolateId,
|
| + intptr_t breakpointId,
|
| + const Dart_CodeLocation& location) {
|
| + MonitorLocker ml(sync);
|
| + pause_event_handled = true;
|
| + ml.Notify();
|
| +}
|
| +
|
| static void TestInterruptIsolate(Dart_IsolateId isolate_id,
|
| Dart_IsolateEvent kind) {
|
| if (kind == kCreated) {
|
| @@ -1328,7 +1337,7 @@
|
| MonitorLocker ml(sync);
|
| isolate_interrupted = true;
|
| continue_isolate_loop = false;
|
| - ml.Notify();
|
| + Dart_SetStepInto();
|
| }
|
| } else if (kind == kShutdown) {
|
| if (interrupt_isolate_id == isolate_id) {
|
| @@ -1394,6 +1403,7 @@
|
| Dart_SetIsolateEventHandler(&TestInterruptIsolate);
|
| sync = new Monitor();
|
| EXPECT(interrupt_isolate_id == ILLEGAL_ISOLATE_ID);
|
| + Dart_SetPausedEventHandler(InterruptIsolateHandler);
|
| int result = Thread::Start(InterruptIsolateRun, 0);
|
| EXPECT_EQ(0, result);
|
|
|
| @@ -1413,11 +1423,12 @@
|
| // Wait for the test isolate to be interrupted.
|
| {
|
| MonitorLocker ml(sync);
|
| - while (!isolate_interrupted) {
|
| + while (!isolate_interrupted || !pause_event_handled) {
|
| ml.Wait();
|
| }
|
| }
|
| EXPECT(isolate_interrupted);
|
| + EXPECT(pause_event_handled);
|
|
|
| // Wait for the test isolate to shutdown.
|
| {
|
| @@ -1429,7 +1440,6 @@
|
| EXPECT(interrupt_isolate_id == ILLEGAL_ISOLATE_ID);
|
| }
|
|
|
| -
|
| static void StackTraceDump1BreakpointHandler(
|
| Dart_IsolateId isolate_id,
|
| intptr_t bp_id,
|
|
|