| 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 2611 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2622 return true; | 2622 return true; |
| 2623 } | 2623 } |
| 2624 const char* object_id = js->LookupParam("objectId"); | 2624 const char* object_id = js->LookupParam("objectId"); |
| 2625 Object& obj = Object::Handle(LookupHeapObject(thread, object_id, NULL)); | 2625 Object& obj = Object::Handle(LookupHeapObject(thread, object_id, NULL)); |
| 2626 if (obj.raw() == Object::sentinel().raw() || !obj.IsInstance()) { | 2626 if (obj.raw() == Object::sentinel().raw() || !obj.IsInstance()) { |
| 2627 PrintInvalidParamError(js, "objectId"); | 2627 PrintInvalidParamError(js, "objectId"); |
| 2628 return true; | 2628 return true; |
| 2629 } | 2629 } |
| 2630 const Instance& closure = Instance::Cast(obj); | 2630 const Instance& closure = Instance::Cast(obj); |
| 2631 Breakpoint* bpt = | 2631 Breakpoint* bpt = |
| 2632 thread->isolate()->debugger()->SetBreakpointAtActivation(closure); | 2632 thread->isolate()->debugger()->SetBreakpointAtActivation(closure, false); |
| 2633 if (bpt == NULL) { | 2633 if (bpt == NULL) { |
| 2634 js->PrintError(kCannotAddBreakpoint, | 2634 js->PrintError(kCannotAddBreakpoint, |
| 2635 "%s: Cannot add breakpoint at activation", | 2635 "%s: Cannot add breakpoint at activation", |
| 2636 js->method()); | 2636 js->method()); |
| 2637 return true; | 2637 return true; |
| 2638 } | 2638 } |
| 2639 bpt->PrintJSON(js); | 2639 bpt->PrintJSON(js); |
| 2640 return true; | 2640 return true; |
| 2641 } | 2641 } |
| 2642 | 2642 |
| (...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3013 return true; | 3013 return true; |
| 3014 } | 3014 } |
| 3015 if (isolate->debugger()->PauseEvent() != NULL) { | 3015 if (isolate->debugger()->PauseEvent() != NULL) { |
| 3016 if (step_param != NULL) { | 3016 if (step_param != NULL) { |
| 3017 if (strcmp(step_param, "Into") == 0) { | 3017 if (strcmp(step_param, "Into") == 0) { |
| 3018 isolate->debugger()->SetSingleStep(); | 3018 isolate->debugger()->SetSingleStep(); |
| 3019 } else if (strcmp(step_param, "Over") == 0) { | 3019 } else if (strcmp(step_param, "Over") == 0) { |
| 3020 isolate->debugger()->SetStepOver(); | 3020 isolate->debugger()->SetStepOver(); |
| 3021 } else if (strcmp(step_param, "Out") == 0) { | 3021 } else if (strcmp(step_param, "Out") == 0) { |
| 3022 isolate->debugger()->SetStepOut(); | 3022 isolate->debugger()->SetStepOut(); |
| 3023 } else if (strcmp(step_param, "OverAsyncSuspension") == 0) { |
| 3024 if (!isolate->debugger()->SetupStepOverAsyncSuspension()) { |
| 3025 js->PrintError(kInvalidParams, |
| 3026 "Isolate must be paused at an async suspension point"); |
| 3027 return true; |
| 3028 } |
| 3023 } else { | 3029 } else { |
| 3024 PrintInvalidParamError(js, "step"); | 3030 PrintInvalidParamError(js, "step"); |
| 3025 return true; | 3031 return true; |
| 3026 } | 3032 } |
| 3027 } | 3033 } |
| 3028 isolate->SetResumeRequest(); | 3034 isolate->SetResumeRequest(); |
| 3029 PrintSuccess(js); | 3035 PrintSuccess(js); |
| 3030 return true; | 3036 return true; |
| 3031 } | 3037 } |
| 3032 | 3038 |
| (...skipping 565 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3598 static const MethodParameter* get_version_params[] = { | 3604 static const MethodParameter* get_version_params[] = { |
| 3599 NO_ISOLATE_PARAMETER, | 3605 NO_ISOLATE_PARAMETER, |
| 3600 NULL, | 3606 NULL, |
| 3601 }; | 3607 }; |
| 3602 | 3608 |
| 3603 | 3609 |
| 3604 static bool GetVersion(Thread* thread, JSONStream* js) { | 3610 static bool GetVersion(Thread* thread, JSONStream* js) { |
| 3605 JSONObject jsobj(js); | 3611 JSONObject jsobj(js); |
| 3606 jsobj.AddProperty("type", "Version"); | 3612 jsobj.AddProperty("type", "Version"); |
| 3607 jsobj.AddProperty("major", static_cast<intptr_t>(3)); | 3613 jsobj.AddProperty("major", static_cast<intptr_t>(3)); |
| 3608 jsobj.AddProperty("minor", static_cast<intptr_t>(2)); | 3614 jsobj.AddProperty("minor", static_cast<intptr_t>(3)); |
| 3609 jsobj.AddProperty("_privateMajor", static_cast<intptr_t>(0)); | 3615 jsobj.AddProperty("_privateMajor", static_cast<intptr_t>(0)); |
| 3610 jsobj.AddProperty("_privateMinor", static_cast<intptr_t>(0)); | 3616 jsobj.AddProperty("_privateMinor", static_cast<intptr_t>(0)); |
| 3611 return true; | 3617 return true; |
| 3612 } | 3618 } |
| 3613 | 3619 |
| 3614 | 3620 |
| 3615 class ServiceIsolateVisitor : public IsolateVisitor { | 3621 class ServiceIsolateVisitor : public IsolateVisitor { |
| 3616 public: | 3622 public: |
| 3617 explicit ServiceIsolateVisitor(JSONArray* jsarr) | 3623 explicit ServiceIsolateVisitor(JSONArray* jsarr) |
| 3618 : jsarr_(jsarr) { | 3624 : jsarr_(jsarr) { |
| (...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3986 if (strcmp(method_name, method.name) == 0) { | 3992 if (strcmp(method_name, method.name) == 0) { |
| 3987 return &method; | 3993 return &method; |
| 3988 } | 3994 } |
| 3989 } | 3995 } |
| 3990 return NULL; | 3996 return NULL; |
| 3991 } | 3997 } |
| 3992 | 3998 |
| 3993 #endif // !PRODUCT | 3999 #endif // !PRODUCT |
| 3994 | 4000 |
| 3995 } // namespace dart | 4001 } // namespace dart |
| OLD | NEW |