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

Unified Diff: runtime/vm/service.cc

Issue 1174313002: Allow setting break-on-exceptions option over the service protocol. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/report_test.cc ('k') | runtime/vm/service_event.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/service.cc
diff --git a/runtime/vm/service.cc b/runtime/vm/service.cc
index 0593f7faa5edd29610cd8a5c1f164c3c2c2aecf0..f5aab5dbf4e6dc648d1ff6f8ec5633633eb8e9ed 100644
--- a/runtime/vm/service.cc
+++ b/runtime/vm/service.cc
@@ -2620,6 +2620,43 @@ static bool GetVM(Isolate* isolate, JSONStream* js) {
}
+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::kDebuggerSettingsUpdate);
+ Service::HandleEvent(&event);
+ }
+ PrintSuccess(js);
+ return true;
+}
+
+
static const MethodParameter* get_flag_list_params[] = {
NO_ISOLATE_PARAMETER,
NULL,
@@ -2738,7 +2775,7 @@ static ServiceMethodDescriptor service_methods_[] = {
get_coverage_params },
{ "_getCpuProfile", GetCpuProfile,
get_cpu_profile_params },
- { "getFlagList", GetFlagList ,
+ { "getFlagList", GetFlagList,
get_flag_list_params },
{ "_getHeapMap", GetHeapMap,
get_heap_map_params },
@@ -2782,6 +2819,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,
« no previous file with comments | « runtime/vm/report_test.cc ('k') | runtime/vm/service_event.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698