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

Unified Diff: runtime/vm/debugger_api_impl.cc

Issue 10407071: Introduce remote objects in Debugger protocol (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/debugger.cc ('k') | tools/ddbg.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/debugger_api_impl.cc
===================================================================
--- runtime/vm/debugger_api_impl.cc (revision 7863)
+++ runtime/vm/debugger_api_impl.cc (working copy)
@@ -43,6 +43,27 @@
}
+DART_EXPORT intptr_t Dart_CacheObject(Dart_Handle object_in) {
+ Isolate* isolate = Isolate::Current();
+ DARTSCOPE(isolate);
+ const Object& obj = Object::Handle(Api::UnwrapHandle(object_in));
+ if (obj.IsApiError()) {
+ return -1;
+ }
+ return isolate->debugger()->CacheObject(obj);
+}
+
+
+DART_EXPORT Dart_Handle Dart_GetCachedObject(intptr_t obj_id) {
+ Isolate* isolate = Isolate::Current();
+ DARTSCOPE(isolate);
+ if (!isolate->debugger()->IsValidObjectId(obj_id)) {
+ return Api::NewError("%s: object id %d is invalid", CURRENT_FUNC, obj_id);
+ }
+ return Api::NewHandle(isolate, isolate->debugger()->GetCachedObject(obj_id));
+}
+
+
DART_EXPORT Dart_Handle Dart_StackTraceLength(
Dart_StackTrace trace,
intptr_t* length) {
@@ -364,6 +385,18 @@
}
+DART_EXPORT Dart_Handle Dart_GetObjClassId(Dart_Handle object_in,
+ intptr_t* class_id) {
+ Isolate* isolate = Isolate::Current();
+ DARTSCOPE(isolate);
+ Instance& obj = Instance::Handle();
+ UNWRAP_AND_CHECK_PARAM(Instance, obj, object_in);
+ CHECK_NOT_NULL(class_id);
+ *class_id = Class::Handle(obj.clazz()).index();
+ return Api::True(isolate);
+}
+
+
DART_EXPORT Dart_Handle Dart_GetSuperclass(Dart_Handle cls_in) {
Isolate* isolate = Isolate::Current();
DARTSCOPE(isolate);
@@ -373,6 +406,40 @@
}
+DART_EXPORT Dart_Handle Dart_GetClassInfo(
+ intptr_t cls_id,
+ Dart_Handle* class_name,
+ Dart_Handle* library,
+ intptr_t* super_class_id,
+ Dart_Handle* static_fields) {
+ Isolate* isolate = Isolate::Current();
+ DARTSCOPE(isolate);
+ if (!isolate->class_table()->IsValidIndex(cls_id)) {
+ return Api::NewError("%s: %d is not a valid class id",
+ CURRENT_FUNC, cls_id);
+ }
+ Class& cls = Class::Handle(isolate->class_table()->At(cls_id));
+ if (class_name != NULL) {
+ *class_name = Api::NewHandle(isolate, cls.Name());
+ }
+ if (library != NULL) {
+ *library = Api::NewHandle(isolate, cls.library());
+ }
+ if (super_class_id != NULL) {
+ *super_class_id = 0;
+ cls = cls.SuperClass();
+ if (!cls.IsNull()) {
+ *super_class_id = cls.index();
+ }
+ }
+ if (static_fields != NULL) {
+ *static_fields =
+ Api::NewHandle(isolate, isolate->debugger()->GetStaticFields(cls));
+ }
+ return Api::True(isolate);
+}
+
+
DART_EXPORT Dart_Handle Dart_GetScriptSource(
Dart_Handle library_url_in,
Dart_Handle script_url_in) {
« no previous file with comments | « runtime/vm/debugger.cc ('k') | tools/ddbg.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698