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

Unified Diff: runtime/vm/debugger_api_impl.cc

Issue 9288071: Add debugger functions to inspect objects and classes (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 11 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
Index: runtime/vm/debugger_api_impl.cc
===================================================================
--- runtime/vm/debugger_api_impl.cc (revision 3572)
+++ runtime/vm/debugger_api_impl.cc (working copy)
@@ -221,6 +221,48 @@
}
+DART_EXPORT Dart_Handle Dart_GetInstanceFields(Dart_Handle object_in) {
+ Isolate* isolate = Isolate::Current();
+ DARTSCOPE(isolate);
+ Instance& obj = Instance::Handle();
+ UNWRAP_AND_CHECK_PARAM(Instance, obj, object_in);
+ Array& fields = Array::Handle();
+ fields = isolate->debugger()->GetInstanceFields(obj);
+ return Api::NewLocalHandle(fields);
+}
+
+
+DART_EXPORT Dart_Handle Dart_GetStaticFields(Dart_Handle cls_in) {
+ Isolate* isolate = Isolate::Current();
+ DARTSCOPE(isolate);
+ Class& cls = Class::Handle();
+ UNWRAP_AND_CHECK_PARAM(Class, cls, cls_in);
+ Array& fields = Array::Handle();
+ fields = isolate->debugger()->GetStaticFields(cls);
+ return Api::NewLocalHandle(fields);
+}
+
+
+DART_EXPORT Dart_Handle Dart_GetObjClass(Dart_Handle object_in) {
+ Isolate* isolate = Isolate::Current();
+ DARTSCOPE(isolate);
+ Instance& obj = Instance::Handle();
+ UNWRAP_AND_CHECK_PARAM(Instance, obj, object_in);
+ const Class& cls = Class::Handle(obj.clazz());
+ return Api::NewLocalHandle(cls);
+}
+
+
+DART_EXPORT Dart_Handle Dart_GetSuperclass(Dart_Handle cls_in) {
+ Isolate* isolate = Isolate::Current();
+ DARTSCOPE(isolate);
+ Class& cls = Class::Handle();
+ UNWRAP_AND_CHECK_PARAM(Class, cls, cls_in);
+ cls = cls.SuperClass();
+ return Api::NewLocalHandle(cls);
+}
+
+
DART_EXPORT Dart_Handle Dart_GetScriptSource(
Dart_Handle library_url_in,
Dart_Handle script_url_in) {

Powered by Google App Engine
This is Rietveld 408576698