Chromium Code Reviews| Index: runtime/vm/service.cc |
| diff --git a/runtime/vm/service.cc b/runtime/vm/service.cc |
| index 0593f7faa5edd29610cd8a5c1f164c3c2c2aecf0..714583f7a06489018b362c37cab693a90335faec 100644 |
| --- a/runtime/vm/service.cc |
| +++ b/runtime/vm/service.cc |
| @@ -2620,6 +2620,59 @@ static bool GetVM(Isolate* isolate, JSONStream* js) { |
| } |
| +static const MethodParameter* get_debugger_update_params[] = { |
| + ISOLATE_PARAMETER, |
| + NULL, |
| +}; |
| + |
| + |
| +static bool GetDebuggerUpdate(Isolate* isolate, JSONStream* js) { |
| + if (Service::NeedsDebugEvents()) { |
| + ServiceEvent event(isolate, ServiceEvent::kDebuggerUpdate); |
| + Service::HandleEvent(&event); |
| + } |
| + PrintSuccess(js); |
| + return true; |
| +} |
| + |
| + |
| +static const MethodParameter* set_exception_pause_info_params[] = { |
| + ISOLATE_PARAMETER, |
| + NULL, |
| +}; |
| + |
| + |
| +static bool SetExceptionPauseInfo(Isolate* isolate, JSONStream* js) { |
| + const char* exceptions = js->LookupParam("exceptions"); |
| + if (exceptions == NULL) { |
| + PrintMissingParamError(js, "exceptions"); |
| + return true; |
| + } |
| + |
| + Dart_ExceptionPauseInfo info = kNoPauseOnExceptions; |
| + if (strcmp(exceptions, "none") == 0) { |
| + info = kNoPauseOnExceptions; |
| + } else if (strcmp(exceptions, "all") == 0) { |
| + info = kPauseOnAllExceptions; |
| + } else if (strcmp(exceptions, "unhandled") == 0) { |
| + info = kPauseOnUnhandledExceptions; |
| + } else { |
| + JSONObject jsobj(js); |
| + jsobj.AddProperty("type", "Error"); |
| + jsobj.AddProperty("message", "illegal value for parameter 'exceptions'"); |
| + return true; |
| + } |
| + |
| + isolate->debugger()->SetExceptionPauseInfo(info); |
| + if (Service::NeedsDebugEvents()) { |
| + ServiceEvent event(isolate, ServiceEvent::kDebuggerUpdate); |
| + Service::HandleEvent(&event); |
| + } |
| + PrintSuccess(js); |
| + return true; |
| +} |
| + |
| + |
| static const MethodParameter* get_flag_list_params[] = { |
| NO_ISOLATE_PARAMETER, |
| NULL, |
| @@ -2738,6 +2791,8 @@ static ServiceMethodDescriptor service_methods_[] = { |
| get_coverage_params }, |
| { "_getCpuProfile", GetCpuProfile, |
| get_cpu_profile_params }, |
| + { "_getDebuggerUpdate", GetDebuggerUpdate, |
|
Cutch
2015/06/12 13:10:47
What about including the debugger settings in stac
rmacnak
2015/06/15 17:53:51
Seems okay. A debugger will generally fetch the st
|
| + get_debugger_update_params }, |
| { "getFlagList", GetFlagList , |
| get_flag_list_params }, |
| { "_getHeapMap", GetHeapMap, |
| @@ -2782,6 +2837,8 @@ static ServiceMethodDescriptor service_methods_[] = { |
| resume_params }, |
| { "_requestHeapSnapshot", RequestHeapSnapshot, |
| request_heap_snapshot_params }, |
| + { "_setExceptionPauseInfo", SetExceptionPauseInfo, |
| + set_exception_pause_info_params }, |
| { "_setFlag", SetFlag, |
| set_flags_params }, |
| { "setLibraryDebuggable", SetLibraryDebuggable, |