| Index: runtime/vm/service.cc
|
| diff --git a/runtime/vm/service.cc b/runtime/vm/service.cc
|
| index efc5c24b304a3a46a81b962b952b86f92593ea3f..5145ebe0ef031f68be650bd9502ab3378d347c25 100644
|
| --- a/runtime/vm/service.cc
|
| +++ b/runtime/vm/service.cc
|
| @@ -970,7 +970,15 @@ void Service::HandleObjectRootMessage(const Array& msg_instance) {
|
|
|
| void Service::HandleIsolateMessage(Isolate* isolate, const Array& msg) {
|
| ASSERT(isolate != NULL);
|
| + const bool is_paused = isolate->IsPaused();
|
| InvokeMethod(isolate, msg);
|
| + // Don't pause twice.
|
| + if (!is_paused) {
|
| + if (isolate->should_pause_post_reload_request()) {
|
| + isolate->set_should_pause_post_reload_request(false);
|
| + isolate->PausePostReload();
|
| + }
|
| + }
|
| }
|
|
|
|
|
| @@ -1085,6 +1093,11 @@ static void ReportPauseOnConsole(ServiceEvent* event) {
|
| "vm-service: isolate '%s' has no debugger attached and is paused.",
|
| name);
|
| break;
|
| + case ServiceEvent::kPausePostReload:
|
| + OS::PrintErr(
|
| + "vm-service: isolate '%s' has no debugger attached and is paused "
|
| + "post reload.", name);
|
| + break;
|
| default:
|
| UNREACHABLE();
|
| break;
|
| @@ -2510,6 +2523,7 @@ static bool GetSourceReport(Thread* thread, JSONStream* js) {
|
| static const MethodParameter* reload_sources_params[] = {
|
| RUNNABLE_ISOLATE_PARAMETER,
|
| new BoolParameter("force", false),
|
| + new BoolParameter("pause", false),
|
| NULL,
|
| };
|
|
|
| @@ -2554,6 +2568,10 @@ static bool ReloadSources(Thread* thread, JSONStream* js) {
|
|
|
| isolate->ReloadSources(js, force_reload);
|
|
|
| + // Should we pause?
|
| + isolate->set_should_pause_post_reload_request(
|
| + BoolParameter::Parse(js->LookupParam("pause"), false));
|
| +
|
| return true;
|
| }
|
|
|
| @@ -4163,6 +4181,8 @@ static const ServiceMethodDescriptor service_methods_[] = {
|
| remove_breakpoint_params },
|
| { "_restartVM", RestartVM,
|
| restart_vm_params },
|
| + { "reloadSources", ReloadSources,
|
| + reload_sources_params },
|
| { "_reloadSources", ReloadSources,
|
| reload_sources_params },
|
| { "resume", Resume,
|
|
|