OLD | NEW |
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 3001 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3012 "None", | 3012 "None", |
3013 "Unhandled", | 3013 "Unhandled", |
3014 NULL, | 3014 NULL, |
3015 }; | 3015 }; |
3016 | 3016 |
3017 | 3017 |
3018 static Dart_ExceptionPauseInfo exception_pause_mode_values[] = { | 3018 static Dart_ExceptionPauseInfo exception_pause_mode_values[] = { |
3019 kPauseOnAllExceptions, | 3019 kPauseOnAllExceptions, |
3020 kNoPauseOnExceptions, | 3020 kNoPauseOnExceptions, |
3021 kPauseOnUnhandledExceptions, | 3021 kPauseOnUnhandledExceptions, |
3022 static_cast<Dart_ExceptionPauseInfo>(-1), // Fall through. | 3022 kInvalidExceptionPauseInfo, |
3023 }; | 3023 }; |
3024 | 3024 |
3025 | 3025 |
3026 static const MethodParameter* set_exception_pause_mode_params[] = { | 3026 static const MethodParameter* set_exception_pause_mode_params[] = { |
3027 ISOLATE_PARAMETER, | 3027 ISOLATE_PARAMETER, |
3028 new EnumParameter("mode", true, exception_pause_mode_names), | 3028 new EnumParameter("mode", true, exception_pause_mode_names), |
3029 NULL, | 3029 NULL, |
3030 }; | 3030 }; |
3031 | 3031 |
3032 | 3032 |
3033 static bool SetExceptionPauseMode(Isolate* isolate, JSONStream* js) { | 3033 static bool SetExceptionPauseMode(Isolate* isolate, JSONStream* js) { |
3034 const char* mode = js->LookupParam("mode"); | 3034 const char* mode = js->LookupParam("mode"); |
3035 if (mode == NULL) { | 3035 if (mode == NULL) { |
3036 PrintMissingParamError(js, "mode"); | 3036 PrintMissingParamError(js, "mode"); |
3037 return true; | 3037 return true; |
3038 } | 3038 } |
3039 Dart_ExceptionPauseInfo info = | 3039 Dart_ExceptionPauseInfo info = |
3040 EnumMapper(mode, exception_pause_mode_names, exception_pause_mode_values); | 3040 EnumMapper(mode, exception_pause_mode_names, exception_pause_mode_values); |
3041 if (info == -1) { | 3041 if (info == kInvalidExceptionPauseInfo) { |
3042 PrintInvalidParamError(js, "mode"); | 3042 PrintInvalidParamError(js, "mode"); |
3043 return true; | 3043 return true; |
3044 } | 3044 } |
3045 isolate->debugger()->SetExceptionPauseInfo(info); | 3045 isolate->debugger()->SetExceptionPauseInfo(info); |
3046 if (Service::debug_stream.enabled()) { | 3046 if (Service::debug_stream.enabled()) { |
3047 ServiceEvent event(isolate, ServiceEvent::kDebuggerSettingsUpdate); | 3047 ServiceEvent event(isolate, ServiceEvent::kDebuggerSettingsUpdate); |
3048 Service::HandleEvent(&event); | 3048 Service::HandleEvent(&event); |
3049 } | 3049 } |
3050 PrintSuccess(js); | 3050 PrintSuccess(js); |
3051 return true; | 3051 return true; |
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3288 ServiceMethodDescriptor& method = service_methods_[i]; | 3288 ServiceMethodDescriptor& method = service_methods_[i]; |
3289 if (strcmp(method_name, method.name) == 0) { | 3289 if (strcmp(method_name, method.name) == 0) { |
3290 return &method; | 3290 return &method; |
3291 } | 3291 } |
3292 } | 3292 } |
3293 return NULL; | 3293 return NULL; |
3294 } | 3294 } |
3295 | 3295 |
3296 | 3296 |
3297 } // namespace dart | 3297 } // namespace dart |
OLD | NEW |