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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « runtime/vm/report_test.cc ('k') | runtime/vm/service_event.h » ('j') | 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 "platform/globals.h" 8 #include "platform/globals.h"
9 9
10 #include "vm/compiler.h" 10 #include "vm/compiler.h"
(...skipping 2602 matching lines...) Expand 10 before | Expand all | Expand 10 after
2613 // Construct the isolate list. 2613 // Construct the isolate list.
2614 { 2614 {
2615 JSONArray jsarr(&jsobj, "isolates"); 2615 JSONArray jsarr(&jsobj, "isolates");
2616 ServiceIsolateVisitor visitor(&jsarr); 2616 ServiceIsolateVisitor visitor(&jsarr);
2617 Isolate::VisitIsolates(&visitor); 2617 Isolate::VisitIsolates(&visitor);
2618 } 2618 }
2619 return true; 2619 return true;
2620 } 2620 }
2621 2621
2622 2622
2623 static const MethodParameter* set_exception_pause_info_params[] = {
2624 ISOLATE_PARAMETER,
2625 NULL,
2626 };
2627
2628
2629 static bool SetExceptionPauseInfo(Isolate* isolate, JSONStream* js) {
2630 const char* exceptions = js->LookupParam("exceptions");
2631 if (exceptions == NULL) {
2632 PrintMissingParamError(js, "exceptions");
2633 return true;
2634 }
2635
2636 Dart_ExceptionPauseInfo info = kNoPauseOnExceptions;
2637 if (strcmp(exceptions, "none") == 0) {
2638 info = kNoPauseOnExceptions;
2639 } else if (strcmp(exceptions, "all") == 0) {
2640 info = kPauseOnAllExceptions;
2641 } else if (strcmp(exceptions, "unhandled") == 0) {
2642 info = kPauseOnUnhandledExceptions;
2643 } else {
2644 JSONObject jsobj(js);
2645 jsobj.AddProperty("type", "Error");
2646 jsobj.AddProperty("message", "illegal value for parameter 'exceptions'");
2647 return true;
2648 }
2649
2650 isolate->debugger()->SetExceptionPauseInfo(info);
2651 if (Service::NeedsDebugEvents()) {
2652 ServiceEvent event(isolate, ServiceEvent::kDebuggerSettingsUpdate);
2653 Service::HandleEvent(&event);
2654 }
2655 PrintSuccess(js);
2656 return true;
2657 }
2658
2659
2623 static const MethodParameter* get_flag_list_params[] = { 2660 static const MethodParameter* get_flag_list_params[] = {
2624 NO_ISOLATE_PARAMETER, 2661 NO_ISOLATE_PARAMETER,
2625 NULL, 2662 NULL,
2626 }; 2663 };
2627 2664
2628 2665
2629 static bool GetFlagList(Isolate* isolate, JSONStream* js) { 2666 static bool GetFlagList(Isolate* isolate, JSONStream* js) {
2630 Flags::PrintJSON(js); 2667 Flags::PrintJSON(js);
2631 return true; 2668 return true;
2632 } 2669 }
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
2731 { "_getAllocationProfile", GetAllocationProfile, 2768 { "_getAllocationProfile", GetAllocationProfile,
2732 get_allocation_profile_params }, 2769 get_allocation_profile_params },
2733 { "_getCallSiteData", GetCallSiteData, 2770 { "_getCallSiteData", GetCallSiteData,
2734 get_call_site_data_params }, 2771 get_call_site_data_params },
2735 { "getClassList", GetClassList, 2772 { "getClassList", GetClassList,
2736 get_class_list_params }, 2773 get_class_list_params },
2737 { "_getCoverage", GetCoverage, 2774 { "_getCoverage", GetCoverage,
2738 get_coverage_params }, 2775 get_coverage_params },
2739 { "_getCpuProfile", GetCpuProfile, 2776 { "_getCpuProfile", GetCpuProfile,
2740 get_cpu_profile_params }, 2777 get_cpu_profile_params },
2741 { "getFlagList", GetFlagList , 2778 { "getFlagList", GetFlagList,
2742 get_flag_list_params }, 2779 get_flag_list_params },
2743 { "_getHeapMap", GetHeapMap, 2780 { "_getHeapMap", GetHeapMap,
2744 get_heap_map_params }, 2781 get_heap_map_params },
2745 { "_getInboundReferences", GetInboundReferences, 2782 { "_getInboundReferences", GetInboundReferences,
2746 get_inbound_references_params }, 2783 get_inbound_references_params },
2747 { "_getInstances", GetInstances, 2784 { "_getInstances", GetInstances,
2748 get_instances_params }, 2785 get_instances_params },
2749 { "getIsolate", GetIsolate, 2786 { "getIsolate", GetIsolate,
2750 get_isolate_params }, 2787 get_isolate_params },
2751 { "_getIsolateMetric", GetIsolateMetric, 2788 { "_getIsolateMetric", GetIsolateMetric,
(...skipping 23 matching lines...) Expand all
2775 { "_getVMMetricList", GetVMMetricList, 2812 { "_getVMMetricList", GetVMMetricList,
2776 get_vm_metric_list_params }, 2813 get_vm_metric_list_params },
2777 { "pause", Pause, 2814 { "pause", Pause,
2778 pause_params }, 2815 pause_params },
2779 { "removeBreakpoint", RemoveBreakpoint, 2816 { "removeBreakpoint", RemoveBreakpoint,
2780 remove_breakpoint_params }, 2817 remove_breakpoint_params },
2781 { "resume", Resume, 2818 { "resume", Resume,
2782 resume_params }, 2819 resume_params },
2783 { "_requestHeapSnapshot", RequestHeapSnapshot, 2820 { "_requestHeapSnapshot", RequestHeapSnapshot,
2784 request_heap_snapshot_params }, 2821 request_heap_snapshot_params },
2822 { "_setExceptionPauseInfo", SetExceptionPauseInfo,
2823 set_exception_pause_info_params },
2785 { "_setFlag", SetFlag, 2824 { "_setFlag", SetFlag,
2786 set_flags_params }, 2825 set_flags_params },
2787 { "setLibraryDebuggable", SetLibraryDebuggable, 2826 { "setLibraryDebuggable", SetLibraryDebuggable,
2788 set_library_debuggable_params }, 2827 set_library_debuggable_params },
2789 { "setName", SetName, 2828 { "setName", SetName,
2790 set_name_params }, 2829 set_name_params },
2791 }; 2830 };
2792 2831
2793 2832
2794 ServiceMethodDescriptor* FindMethod(const char* method_name) { 2833 ServiceMethodDescriptor* FindMethod(const char* method_name) {
2795 intptr_t num_methods = sizeof(service_methods_) / 2834 intptr_t num_methods = sizeof(service_methods_) /
2796 sizeof(service_methods_[0]); 2835 sizeof(service_methods_[0]);
2797 for (intptr_t i = 0; i < num_methods; i++) { 2836 for (intptr_t i = 0; i < num_methods; i++) {
2798 ServiceMethodDescriptor& method = service_methods_[i]; 2837 ServiceMethodDescriptor& method = service_methods_[i];
2799 if (strcmp(method_name, method.name) == 0) { 2838 if (strcmp(method_name, method.name) == 0) {
2800 return &method; 2839 return &method;
2801 } 2840 }
2802 } 2841 }
2803 return NULL; 2842 return NULL;
2804 } 2843 }
2805 2844
2806 2845
2807 } // namespace dart 2846 } // namespace dart
OLDNEW
« 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