| OLD | NEW |
| 1 // Copyright (c) 2011, 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/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" |
| 11 #include "vm/object_store.h" | 11 #include "vm/object_store.h" |
| (...skipping 30 matching lines...) Expand all Loading... |
| 42 CURRENT_FUNC, #param); \ | 42 CURRENT_FUNC, #param); \ |
| 43 } | 43 } |
| 44 | 44 |
| 45 | 45 |
| 46 DART_EXPORT Dart_Handle Dart_StackTraceLength( | 46 DART_EXPORT Dart_Handle Dart_StackTraceLength( |
| 47 Dart_StackTrace trace, | 47 Dart_StackTrace trace, |
| 48 intptr_t* length) { | 48 intptr_t* length) { |
| 49 Isolate* isolate = Isolate::Current(); | 49 Isolate* isolate = Isolate::Current(); |
| 50 DARTSCOPE(isolate); | 50 DARTSCOPE(isolate); |
| 51 CHECK_NOT_NULL(length); | 51 CHECK_NOT_NULL(length); |
| 52 CHECK_AND_CAST(StackTrace, stack_trace, trace); | 52 CHECK_AND_CAST(DebuggerStackTrace, stack_trace, trace); |
| 53 *length = stack_trace->Length(); | 53 *length = stack_trace->Length(); |
| 54 return Api::True(); | 54 return Api::True(); |
| 55 } | 55 } |
| 56 | 56 |
| 57 | 57 |
| 58 DART_EXPORT Dart_Handle Dart_GetActivationFrame( | 58 DART_EXPORT Dart_Handle Dart_GetActivationFrame( |
| 59 Dart_StackTrace trace, | 59 Dart_StackTrace trace, |
| 60 int frame_index, | 60 int frame_index, |
| 61 Dart_ActivationFrame* frame) { | 61 Dart_ActivationFrame* frame) { |
| 62 Isolate* isolate = Isolate::Current(); | 62 Isolate* isolate = Isolate::Current(); |
| 63 DARTSCOPE(isolate); | 63 DARTSCOPE(isolate); |
| 64 CHECK_NOT_NULL(frame); | 64 CHECK_NOT_NULL(frame); |
| 65 CHECK_AND_CAST(StackTrace, stack_trace, trace); | 65 CHECK_AND_CAST(DebuggerStackTrace, stack_trace, trace); |
| 66 if ((frame_index < 0) || (frame_index >= stack_trace->Length())) { | 66 if ((frame_index < 0) || (frame_index >= stack_trace->Length())) { |
| 67 return Api::NewError("argument 'frame_index' is out of range for %s", | 67 return Api::NewError("argument 'frame_index' is out of range for %s", |
| 68 CURRENT_FUNC); | 68 CURRENT_FUNC); |
| 69 } | 69 } |
| 70 *frame = reinterpret_cast<Dart_ActivationFrame>( | 70 *frame = reinterpret_cast<Dart_ActivationFrame>( |
| 71 stack_trace->ActivationFrameAt(frame_index)); | 71 stack_trace->ActivationFrameAt(frame_index)); |
| 72 return Api::True(); | 72 return Api::True(); |
| 73 } | 73 } |
| 74 | 74 |
| 75 | 75 |
| (...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 357 for (int i = 0; i < num_libs; i++) { | 357 for (int i = 0; i < num_libs; i++) { |
| 358 ASSERT(!lib.IsNull()); | 358 ASSERT(!lib.IsNull()); |
| 359 lib_url = lib.url(); | 359 lib_url = lib.url(); |
| 360 library_list.SetAt(i, lib_url); | 360 library_list.SetAt(i, lib_url); |
| 361 lib = lib.next_registered(); | 361 lib = lib.next_registered(); |
| 362 } | 362 } |
| 363 return Api::NewLocalHandle(library_list); | 363 return Api::NewLocalHandle(library_list); |
| 364 } | 364 } |
| 365 | 365 |
| 366 } // namespace dart | 366 } // namespace dart |
| OLD | NEW |