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

Side by Side Diff: runtime/vm/service.cc

Issue 1665773004: Add necessary support functions so that embedders can implemented pause on start and exit (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 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 unified diff | Download patch
« runtime/vm/message_handler.cc ('K') | « runtime/vm/message_handler.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/service.h" 5 #include "vm/service.h"
6 6
7 #include "include/dart_api.h" 7 #include "include/dart_api.h"
8 #include "include/dart_native_api.h" 8 #include "include/dart_native_api.h"
9 #include "platform/globals.h" 9 #include "platform/globals.h"
10 10
(...skipping 2947 matching lines...) Expand 10 before | Expand all | Expand 10 after
2958 static bool Resume(Thread* thread, JSONStream* js) { 2958 static bool Resume(Thread* thread, JSONStream* js) {
2959 const char* step_param = js->LookupParam("step"); 2959 const char* step_param = js->LookupParam("step");
2960 Isolate* isolate = thread->isolate(); 2960 Isolate* isolate = thread->isolate();
2961 if (isolate->message_handler()->paused_on_start()) { 2961 if (isolate->message_handler()->paused_on_start()) {
2962 // If the user is issuing a 'Over' or an 'Out' step, that is the 2962 // If the user is issuing a 'Over' or an 'Out' step, that is the
2963 // same as a regular resume request. 2963 // same as a regular resume request.
2964 if ((step_param != NULL) && (strcmp(step_param, "Into") == 0)) { 2964 if ((step_param != NULL) && (strcmp(step_param, "Into") == 0)) {
2965 isolate->debugger()->EnterSingleStepMode(); 2965 isolate->debugger()->EnterSingleStepMode();
2966 } 2966 }
2967 isolate->message_handler()->set_pause_on_start(false); 2967 isolate->message_handler()->set_pause_on_start(false);
2968 isolate->set_last_resume_timestamp(); 2968 isolate->Resume();
2969 if (Service::debug_stream.enabled()) { 2969 if (Service::debug_stream.enabled()) {
2970 ServiceEvent event(isolate, ServiceEvent::kResume); 2970 ServiceEvent event(isolate, ServiceEvent::kResume);
2971 Service::HandleEvent(&event); 2971 Service::HandleEvent(&event);
2972 } 2972 }
2973 PrintSuccess(js); 2973 PrintSuccess(js);
2974 return true; 2974 return true;
2975 } 2975 }
2976 if (isolate->message_handler()->paused_on_exit()) { 2976 if (isolate->message_handler()->paused_on_exit()) {
2977 isolate->message_handler()->set_pause_on_exit(false); 2977 isolate->message_handler()->set_pause_on_exit(false);
2978 isolate->Resume();
turnidge 2016/02/03 21:33:37 Does this send a resume event? Do we want to supp
Cutch 2016/02/03 23:04:05 No it doesn't and I've actually renamed this to be
2978 // We don't send a resume event because we will be exiting. 2979 // We don't send a resume event because we will be exiting.
2979 PrintSuccess(js); 2980 PrintSuccess(js);
2980 return true; 2981 return true;
2981 } 2982 }
2982 if (isolate->debugger()->PauseEvent() != NULL) { 2983 if (isolate->debugger()->PauseEvent() != NULL) {
2983 if (step_param != NULL) { 2984 if (step_param != NULL) {
2984 if (strcmp(step_param, "Into") == 0) { 2985 if (strcmp(step_param, "Into") == 0) {
2985 isolate->debugger()->SetSingleStep(); 2986 isolate->debugger()->SetSingleStep();
2986 } else if (strcmp(step_param, "Over") == 0) { 2987 } else if (strcmp(step_param, "Over") == 0) {
2987 isolate->debugger()->SetStepOver(); 2988 isolate->debugger()->SetStepOver();
(...skipping 964 matching lines...) Expand 10 before | Expand all | Expand 10 after
3952 const ServiceMethodDescriptor& method = service_methods_[i]; 3953 const ServiceMethodDescriptor& method = service_methods_[i];
3953 if (strcmp(method_name, method.name) == 0) { 3954 if (strcmp(method_name, method.name) == 0) {
3954 return &method; 3955 return &method;
3955 } 3956 }
3956 } 3957 }
3957 return NULL; 3958 return NULL;
3958 } 3959 }
3959 3960
3960 3961
3961 } // namespace dart 3962 } // namespace dart
OLDNEW
« runtime/vm/message_handler.cc ('K') | « runtime/vm/message_handler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698