OLD | NEW |
---|---|
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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/class_finalizer.h" | 7 #include "vm/class_finalizer.h" |
8 #include "vm/compiler.h" | 8 #include "vm/compiler.h" |
9 #include "vm/dart_api_impl.h" | 9 #include "vm/dart_api_impl.h" |
10 #include "vm/dart_api_state.h" | 10 #include "vm/dart_api_state.h" |
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
301 | 301 |
302 if (location != NULL) { | 302 if (location != NULL) { |
303 location->script_url = Api::NewHandle(isolate, frame->SourceUrl()); | 303 location->script_url = Api::NewHandle(isolate, frame->SourceUrl()); |
304 const Library& lib = Library::Handle(frame->Library()); | 304 const Library& lib = Library::Handle(frame->Library()); |
305 location->library_id = lib.index(); | 305 location->library_id = lib.index(); |
306 location->token_pos = frame->TokenPos(); | 306 location->token_pos = frame->TokenPos(); |
307 } | 307 } |
308 return Api::Success(); | 308 return Api::Success(); |
309 } | 309 } |
310 | 310 |
311 DART_EXPORT Dart_Handle Dart_ActivationFrameGetFramePointer( | |
312 Dart_ActivationFrame activation_frame, | |
313 uintptr_t* frame_pointer) { | |
314 Isolate* isolate = Isolate::Current(); | |
315 DARTSCOPE(isolate); | |
316 CHECK_AND_CAST(ActivationFrame, frame, activation_frame); | |
317 | |
318 if (frame_pointer != NULL) { | |
319 *frame_pointer = static_cast<uintptr_t>(frame->fp()); | |
hausner
2014/09/05 19:16:59
This is fine. How does it play with the V8 side of
Jacob
2014/09/05 20:12:25
In blink I truncate Dart stack frame values before
| |
320 } | |
321 return Api::Success(); | |
322 } | |
323 | |
311 | 324 |
312 DART_EXPORT Dart_Handle Dart_GetFunctionOrigin(Dart_Handle function_in) { | 325 DART_EXPORT Dart_Handle Dart_GetFunctionOrigin(Dart_Handle function_in) { |
313 Isolate* isolate = Isolate::Current(); | 326 Isolate* isolate = Isolate::Current(); |
314 DARTSCOPE(isolate); | 327 DARTSCOPE(isolate); |
315 UNWRAP_AND_CHECK_PARAM(Function, function, function_in); | 328 UNWRAP_AND_CHECK_PARAM(Function, function, function_in); |
316 | 329 |
317 const Class& cls = Class::Handle(function.origin()); | 330 const Class& cls = Class::Handle(function.origin()); |
318 if (!cls.IsTopLevel()) { | 331 if (!cls.IsTopLevel()) { |
319 return Dart_NewInteger(cls.id()); | 332 return Dart_NewInteger(cls.id()); |
320 } | 333 } |
(...skipping 658 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
979 return Api::CastIsolate(isolate); | 992 return Api::CastIsolate(isolate); |
980 } | 993 } |
981 | 994 |
982 | 995 |
983 DART_EXPORT Dart_IsolateId Dart_GetIsolateId(Dart_Isolate dart_isolate) { | 996 DART_EXPORT Dart_IsolateId Dart_GetIsolateId(Dart_Isolate dart_isolate) { |
984 Isolate* isolate = reinterpret_cast<Isolate*>(dart_isolate); | 997 Isolate* isolate = reinterpret_cast<Isolate*>(dart_isolate); |
985 return isolate->debugger()->GetIsolateId(); | 998 return isolate->debugger()->GetIsolateId(); |
986 } | 999 } |
987 | 1000 |
988 } // namespace dart | 1001 } // namespace dart |
OLD | NEW |