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 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
367 Isolate* isolate = Isolate::Current(); | 367 Isolate* isolate = Isolate::Current(); |
368 DARTSCOPE(isolate); | 368 DARTSCOPE(isolate); |
369 Debugger* debugger = isolate->debugger(); | 369 Debugger* debugger = isolate->debugger(); |
370 ASSERT(debugger != NULL); | 370 ASSERT(debugger != NULL); |
371 | 371 |
372 SourceBreakpoint* bpt = debugger->GetBreakpointById(bp_id); | 372 SourceBreakpoint* bpt = debugger->GetBreakpointById(bp_id); |
373 if (bpt == NULL) { | 373 if (bpt == NULL) { |
374 return Api::NewError("%s: breakpoint with id %" Pd " does not exist", | 374 return Api::NewError("%s: breakpoint with id %" Pd " does not exist", |
375 CURRENT_FUNC, bp_id); | 375 CURRENT_FUNC, bp_id); |
376 } | 376 } |
377 return Api::NewHandle(isolate, bpt->SourceUrl()); | 377 return Api::NewHandle(isolate, bpt->url()); |
378 } | 378 } |
379 | 379 |
380 | 380 |
381 DART_EXPORT Dart_Handle Dart_GetBreakpointLine(intptr_t bp_id) { | 381 DART_EXPORT Dart_Handle Dart_GetBreakpointLine(intptr_t bp_id) { |
382 Isolate* isolate = Isolate::Current(); | 382 Isolate* isolate = Isolate::Current(); |
383 DARTSCOPE(isolate); | 383 DARTSCOPE(isolate); |
384 Debugger* debugger = isolate->debugger(); | 384 Debugger* debugger = isolate->debugger(); |
385 ASSERT(debugger != NULL); | 385 ASSERT(debugger != NULL); |
386 | 386 |
387 SourceBreakpoint* bpt = debugger->GetBreakpointById(bp_id); | 387 SourceBreakpoint* bpt = debugger->GetBreakpointById(bp_id); |
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
639 | 639 |
640 UNWRAP_AND_CHECK_PARAM(Type, type, type_in); | 640 UNWRAP_AND_CHECK_PARAM(Type, type, type_in); |
641 if (!type.IsFinalized()) { | 641 if (!type.IsFinalized()) { |
642 return Api::NewError("%s: type in 'type_in' is not a finalized type", | 642 return Api::NewError("%s: type in 'type_in' is not a finalized type", |
643 CURRENT_FUNC); | 643 CURRENT_FUNC); |
644 } | 644 } |
645 if (!type.IsInstantiated()) { | 645 if (!type.IsInstantiated()) { |
646 return Api::NewError("%s: type in 'type_in' is not an instantiated type", | 646 return Api::NewError("%s: type in 'type_in' is not an instantiated type", |
647 CURRENT_FUNC); | 647 CURRENT_FUNC); |
648 } | 648 } |
649 const Class& cls= Class::Handle(type.type_class()); | 649 const Class& cls = Class::Handle(type.type_class()); |
650 if (cls.NumTypeParameters() == 0) { | 650 if (cls.NumTypeParameters() == 0) { |
651 // The super type has no type parameters or it is already instantiated | 651 // The super type has no type parameters or it is already instantiated |
652 // just return it. | 652 // just return it. |
653 const AbstractType& type = AbstractType::Handle(cls.super_type()); | 653 const AbstractType& type = AbstractType::Handle(cls.super_type()); |
654 if (type.IsNull()) { | 654 if (type.IsNull()) { |
655 return Dart_Null(); | 655 return Dart_Null(); |
656 } | 656 } |
657 return Api::NewHandle(isolate, type.Canonicalize()); | 657 return Api::NewHandle(isolate, type.Canonicalize()); |
658 } | 658 } |
659 // Set up the type arguments array for the super class type. | 659 // Set up the type arguments array for the super class type. |
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
992 return Api::CastIsolate(isolate); | 992 return Api::CastIsolate(isolate); |
993 } | 993 } |
994 | 994 |
995 | 995 |
996 DART_EXPORT Dart_IsolateId Dart_GetIsolateId(Dart_Isolate dart_isolate) { | 996 DART_EXPORT Dart_IsolateId Dart_GetIsolateId(Dart_Isolate dart_isolate) { |
997 Isolate* isolate = reinterpret_cast<Isolate*>(dart_isolate); | 997 Isolate* isolate = reinterpret_cast<Isolate*>(dart_isolate); |
998 return isolate->debugger()->GetIsolateId(); | 998 return isolate->debugger()->GetIsolateId(); |
999 } | 999 } |
1000 | 1000 |
1001 } // namespace dart | 1001 } // namespace dart |
OLD | NEW |