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

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
« runtime/observatory/lib/src/service/object.dart ('K') | « runtime/vm/raw_object.h ('k') | no next file » | 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..0f35311be471d67c14d33643e802253454e0e46e 100644
--- a/runtime/vm/service.cc
+++ b/runtime/vm/service.cc
@@ -2620,6 +2620,65 @@ static bool GetVM(Isolate* isolate, JSONStream* js) {
}
+static const MethodParameter* get_exception_pause_info_params[] = {
+ ISOLATE_PARAMETER,
+ NULL,
+};
+
+
+static bool GetExceptionPauseInfo(Isolate* isolate, JSONStream* js) {
+ JSONObject jsobj(js);
+ jsobj.AddProperty("type", "ExceptionPauseInfo");
+ switch (isolate->debugger()->GetExceptionPauseInfo()) {
+ case kNoPauseOnExceptions:
+ jsobj.AddProperty("exceptions", "none");
+ break;
+ case kPauseOnAllExceptions:
+ jsobj.AddProperty("exceptions", "all");
+ break;
+ case kPauseOnUnhandledExceptions:
+ jsobj.AddProperty("exceptions", "unhandled");
+ break;
+ default:
+ UNREACHABLE();
+ }
+ 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);
Cutch 2015/06/11 21:20:12 This state change affects all debuggers. This shou
rmacnak 2015/06/12 00:09:38 Rejiggered as a DebuggerChanged event.
+ PrintSuccess(js);
+ return true;
+}
+
+
static const MethodParameter* get_flag_list_params[] = {
NO_ISOLATE_PARAMETER,
NULL,
@@ -2738,6 +2797,8 @@ static ServiceMethodDescriptor service_methods_[] = {
get_coverage_params },
{ "_getCpuProfile", GetCpuProfile,
get_cpu_profile_params },
+ { "_getExceptionPauseInfo", GetExceptionPauseInfo,
+ get_exception_pause_info_params },
{ "getFlagList", GetFlagList ,
get_flag_list_params },
{ "_getHeapMap", GetHeapMap,
@@ -2782,6 +2843,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,
« runtime/observatory/lib/src/service/object.dart ('K') | « runtime/vm/raw_object.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698