Index: runtime/vm/debugger_api_impl.cc |
diff --git a/runtime/vm/debugger_api_impl.cc b/runtime/vm/debugger_api_impl.cc |
index 3ffff4a21679cd219f095dbeb5ac19346385d69b..c20bf670a12307a11a992be55ababd04ab5b44e7 100644 |
--- a/runtime/vm/debugger_api_impl.cc |
+++ b/runtime/vm/debugger_api_impl.cc |
@@ -796,6 +796,22 @@ DART_EXPORT Dart_Handle Dart_GetLibraryFromId(intptr_t library_id) { |
} |
+DART_EXPORT Dart_Handle Dart_LibraryId(Dart_Handle library, |
+ intptr_t* library_id) { |
+ Isolate* isolate = Isolate::Current(); |
+ DARTSCOPE(isolate); |
+ const Library& lib = Api::UnwrapLibraryHandle(isolate, library); |
+ if (lib.IsNull()) { |
+ RETURN_TYPE_ERROR(isolate, library, Library); |
+ } |
+ if (library_id == NULL) { |
+ RETURN_NULL_ERROR(library_id); |
+ } |
+ *library_id = lib.index(); |
+ return Api::Success(); |
+} |
+ |
+ |
DART_EXPORT Dart_Handle Dart_GetLibraryImports(intptr_t library_id) { |
Isolate* isolate = Isolate::Current(); |
ASSERT(isolate != NULL); |