Index: runtime/vm/isolate.cc |
diff --git a/runtime/vm/isolate.cc b/runtime/vm/isolate.cc |
index 4172327255161565a66b914e5e0008df5877e423..52c3c4553772e7b09d12d5a01e8b1140c798cc2b 100644 |
--- a/runtime/vm/isolate.cc |
+++ b/runtime/vm/isolate.cc |
@@ -1995,11 +1995,22 @@ void Isolate::PrintJSON(JSONStream* stream, bool ref) { |
ASSERT((debugger() == NULL) || (debugger()->PauseEvent() == NULL)); |
ServiceEvent pause_event(this, ServiceEvent::kNone); |
jsobj.AddProperty("pauseEvent", &pause_event); |
- } else if (message_handler()->is_paused_on_start() || |
- message_handler()->should_pause_on_start()) { |
- ASSERT((debugger() == NULL) || (debugger()->PauseEvent() == NULL)); |
- ServiceEvent pause_event(this, ServiceEvent::kPauseStart); |
- jsobj.AddProperty("pauseEvent", &pause_event); |
+ } else if (message_handler()->should_pause_on_start()) { |
+ if (message_handler()->is_paused_on_start()) { |
+ ASSERT((debugger() == NULL) || (debugger()->PauseEvent() == NULL)); |
+ ServiceEvent pause_event(this, ServiceEvent::kPauseStart); |
+ jsobj.AddProperty("pauseEvent", &pause_event); |
+ } else { |
+ // Isolate is runnable but not paused on start. |
+ // Some service clients get confused if they see: |
+ // NotRunnable -> Runnable -> PausedAtStart |
+ // Treat Runnable+ShouldPauseOnStart as NotRunnable so they see: |
+ // NonRunnable -> PausedAtStart |
+ // The should_pause_on_start flag is set to false after resume. |
+ ASSERT((debugger() == NULL) || (debugger()->PauseEvent() == NULL)); |
+ ServiceEvent pause_event(this, ServiceEvent::kNone); |
+ jsobj.AddProperty("pauseEvent", &pause_event); |
+ } |
} else if (message_handler()->is_paused_on_exit() && |
((debugger() == NULL) || (debugger()->PauseEvent() == NULL))) { |
ServiceEvent pause_event(this, ServiceEvent::kPauseExit); |