Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(71)

Side by Side Diff: runtime/vm/debugger_api_impl.cc

Issue 10797033: Debugger API to enable/disable debugging of libraries (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/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 638 matching lines...) Expand 10 before | Expand all | Expand 10 after
649 const Array& library_url_list = Array::Handle(Array::New(num_libs)); 649 const Array& library_url_list = Array::Handle(Array::New(num_libs));
650 for (int i = 0; i < num_libs; i++) { 650 for (int i = 0; i < num_libs; i++) {
651 lib ^= libs.At(i); 651 lib ^= libs.At(i);
652 ASSERT(!lib.IsNull()); 652 ASSERT(!lib.IsNull());
653 lib_url = lib.url(); 653 lib_url = lib.url();
654 library_url_list.SetAt(i, lib_url); 654 library_url_list.SetAt(i, lib_url);
655 } 655 }
656 return Api::NewHandle(isolate, library_url_list.raw()); 656 return Api::NewHandle(isolate, library_url_list.raw());
657 } 657 }
658 658
659
660 DART_EXPORT Dart_Handle Dart_GetLibraryDebuggable(intptr_t library_id,
661 bool* is_debuggable) {
662 Isolate* isolate = Isolate::Current();
663 ASSERT(isolate != NULL);
664 DARTSCOPE(isolate);
665 CHECK_NOT_NULL(is_debuggable);
666 const Library& lib = Library::Handle(Library::GetLibrary(library_id));
667 if (lib.IsNull()) {
668 return Api::NewError("%s: %d is not a valid library id",
669 CURRENT_FUNC, library_id);
670 }
671 *is_debuggable = lib.IsDebuggable();
672 return Api::True(isolate);
673 }
674
675
676 DART_EXPORT Dart_Handle Dart_SetLibraryDebuggable(intptr_t library_id,
677 bool is_debuggable) {
678 Isolate* isolate = Isolate::Current();
679 ASSERT(isolate != NULL);
680 DARTSCOPE(isolate);
681 const Library& lib = Library::Handle(Library::GetLibrary(library_id));
682 if (lib.IsNull()) {
683 return Api::NewError("%s: %d is not a valid library id",
684 CURRENT_FUNC, library_id);
685 }
686 lib.set_debuggable(is_debuggable);
687 return Api::True(isolate);
688 }
689
690
659 } // namespace dart 691 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698