| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 "include/dart_debugger_api.h" | 5 #include "include/dart_debugger_api.h" |
| 6 | 6 |
| 7 #include "vm/dart_api_impl.h" | 7 #include "vm/dart_api_impl.h" |
| 8 #include "vm/dart_api_state.h" | 8 #include "vm/dart_api_state.h" |
| 9 #include "vm/debugger.h" | 9 #include "vm/debugger.h" |
| 10 #include "vm/isolate.h" | 10 #include "vm/isolate.h" |
| (...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 Dart_Breakpoint breakpoint_in) { | 214 Dart_Breakpoint breakpoint_in) { |
| 215 Isolate* isolate = Isolate::Current(); | 215 Isolate* isolate = Isolate::Current(); |
| 216 DARTSCOPE(isolate); | 216 DARTSCOPE(isolate); |
| 217 | 217 |
| 218 CHECK_AND_CAST(Breakpoint, breakpoint, breakpoint_in); | 218 CHECK_AND_CAST(Breakpoint, breakpoint, breakpoint_in); |
| 219 isolate->debugger()->RemoveBreakpoint(breakpoint); | 219 isolate->debugger()->RemoveBreakpoint(breakpoint); |
| 220 return Api::True(); | 220 return Api::True(); |
| 221 } | 221 } |
| 222 | 222 |
| 223 | 223 |
| 224 DART_EXPORT Dart_Handle Dart_GetInstanceFields(Dart_Handle object_in) { |
| 225 Isolate* isolate = Isolate::Current(); |
| 226 DARTSCOPE(isolate); |
| 227 Instance& obj = Instance::Handle(); |
| 228 UNWRAP_AND_CHECK_PARAM(Instance, obj, object_in); |
| 229 Array& fields = Array::Handle(); |
| 230 fields = isolate->debugger()->GetInstanceFields(obj); |
| 231 return Api::NewLocalHandle(fields); |
| 232 } |
| 233 |
| 234 |
| 235 DART_EXPORT Dart_Handle Dart_GetStaticFields(Dart_Handle cls_in) { |
| 236 Isolate* isolate = Isolate::Current(); |
| 237 DARTSCOPE(isolate); |
| 238 Class& cls = Class::Handle(); |
| 239 UNWRAP_AND_CHECK_PARAM(Class, cls, cls_in); |
| 240 Array& fields = Array::Handle(); |
| 241 fields = isolate->debugger()->GetStaticFields(cls); |
| 242 return Api::NewLocalHandle(fields); |
| 243 } |
| 244 |
| 245 |
| 246 DART_EXPORT Dart_Handle Dart_GetObjClass(Dart_Handle object_in) { |
| 247 Isolate* isolate = Isolate::Current(); |
| 248 DARTSCOPE(isolate); |
| 249 Instance& obj = Instance::Handle(); |
| 250 UNWRAP_AND_CHECK_PARAM(Instance, obj, object_in); |
| 251 const Class& cls = Class::Handle(obj.clazz()); |
| 252 return Api::NewLocalHandle(cls); |
| 253 } |
| 254 |
| 255 |
| 256 DART_EXPORT Dart_Handle Dart_GetSuperclass(Dart_Handle cls_in) { |
| 257 Isolate* isolate = Isolate::Current(); |
| 258 DARTSCOPE(isolate); |
| 259 Class& cls = Class::Handle(); |
| 260 UNWRAP_AND_CHECK_PARAM(Class, cls, cls_in); |
| 261 cls = cls.SuperClass(); |
| 262 return Api::NewLocalHandle(cls); |
| 263 } |
| 264 |
| 265 |
| 224 DART_EXPORT Dart_Handle Dart_GetScriptSource( | 266 DART_EXPORT Dart_Handle Dart_GetScriptSource( |
| 225 Dart_Handle library_url_in, | 267 Dart_Handle library_url_in, |
| 226 Dart_Handle script_url_in) { | 268 Dart_Handle script_url_in) { |
| 227 Isolate* isolate = Isolate::Current(); | 269 Isolate* isolate = Isolate::Current(); |
| 228 DARTSCOPE(isolate); | 270 DARTSCOPE(isolate); |
| 229 String& library_url = String::Handle(); | 271 String& library_url = String::Handle(); |
| 230 UNWRAP_AND_CHECK_PARAM(String, library_url, library_url_in); | 272 UNWRAP_AND_CHECK_PARAM(String, library_url, library_url_in); |
| 231 String& script_url = String::Handle(); | 273 String& script_url = String::Handle(); |
| 232 UNWRAP_AND_CHECK_PARAM(String, script_url, script_url_in); | 274 UNWRAP_AND_CHECK_PARAM(String, script_url, script_url_in); |
| 233 | 275 |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 296 for (int i = 0; i < num_libs; i++) { | 338 for (int i = 0; i < num_libs; i++) { |
| 297 ASSERT(!lib.IsNull()); | 339 ASSERT(!lib.IsNull()); |
| 298 lib_url = lib.url(); | 340 lib_url = lib.url(); |
| 299 library_list.SetAt(i, lib_url); | 341 library_list.SetAt(i, lib_url); |
| 300 lib = lib.next_registered(); | 342 lib = lib.next_registered(); |
| 301 } | 343 } |
| 302 return Api::NewLocalHandle(library_list); | 344 return Api::NewLocalHandle(library_list); |
| 303 } | 345 } |
| 304 | 346 |
| 305 } // namespace dart | 347 } // namespace dart |
| OLD | NEW |