Index: runtime/vm/isolate.cc |
diff --git a/runtime/vm/isolate.cc b/runtime/vm/isolate.cc |
index 50353e820c9f0d1821531bb861e8ff3464d07864..f058cd9f7d20daed7abd881810e164c67439e688 100644 |
--- a/runtime/vm/isolate.cc |
+++ b/runtime/vm/isolate.cc |
@@ -847,7 +847,8 @@ Isolate::Isolate(const Dart_IsolateFlags& api_flags) |
no_reload_scope_depth_(0), |
reload_every_n_stack_overflow_checks_(FLAG_reload_every), |
reload_context_(NULL), |
- last_reload_timestamp_(OS::GetCurrentTimeMillis()) { |
+ last_reload_timestamp_(OS::GetCurrentTimeMillis()), |
+ should_pause_post_service_request_(false) { |
NOT_IN_PRODUCT(FlagsCopyFrom(api_flags)); |
// TODO(asiva): A Thread is not available here, need to figure out |
// how the vm_tag (kEmbedderTagId) can be set, these tags need to |
@@ -1048,6 +1049,23 @@ void Isolate::set_debugger_name(const char* name) { |
} |
+bool Isolate::IsPaused() const { |
+ return (debugger_ != NULL) && (debugger_->PauseEvent() != NULL); |
+} |
+ |
+ |
+void Isolate::PausePostRequest() { |
+ if (debugger_ == NULL) { |
+ return; |
+ } |
+ ASSERT(!IsPaused()); |
+ const Error& error = Error::Handle(debugger_->PausePostRequest()); |
+ if (!error.IsNull()) { |
+ Exceptions::PropagateError(error); |
+ } |
+} |
+ |
+ |
void Isolate::BuildName(const char* name_prefix) { |
ASSERT(name_ == NULL); |
if (name_prefix == NULL) { |
@@ -2002,8 +2020,8 @@ void Isolate::PrintJSON(JSONStream* stream, bool ref) { |
ASSERT((debugger() == NULL) || (debugger()->PauseEvent() == NULL)); |
ServiceEvent pause_event(this, ServiceEvent::kPauseStart); |
jsobj.AddProperty("pauseEvent", &pause_event); |
- } else if (message_handler()->is_paused_on_exit()) { |
- ASSERT((debugger() == NULL) || (debugger()->PauseEvent() == NULL)); |
+ } else if (message_handler()->is_paused_on_exit() && |
+ ((debugger() == NULL) || (debugger()->PauseEvent() == NULL))) { |
ServiceEvent pause_event(this, ServiceEvent::kPauseExit); |
jsobj.AddProperty("pauseEvent", &pause_event); |
} else if ((debugger() != NULL) && |