Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2413)

Unified Diff: runtime/vm/debugger_api_impl_test.cc

Issue 175533003: Handle stepping requests after isolate interrupt event (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/debugger.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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,
« no previous file with comments | « runtime/vm/debugger.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698