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

Unified Diff: runtime/vm/debugger_api_impl.cc

Issue 249533003: Support evaluation of expressions in context of a stack frame (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 8 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') | runtime/vm/object.h » ('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 35336)
+++ runtime/vm/debugger_api_impl.cc (working copy)
@@ -542,6 +542,17 @@
}
+DART_EXPORT Dart_Handle Dart_ActivationFrameEvaluate(
+ Dart_ActivationFrame activation_frame,
+ Dart_Handle expr_in) {
+ Isolate* isolate = Isolate::Current();
+ DARTSCOPE(isolate);
+ CHECK_AND_CAST(ActivationFrame, frame, activation_frame);
+ UNWRAP_AND_CHECK_PARAM(String, expr, expr_in);
+ return Api::NewHandle(isolate, frame->Evaluate(expr));
+}
+
+
DART_EXPORT Dart_Handle Dart_EvaluateExpr(Dart_Handle target_in,
Dart_Handle expr_in) {
Isolate* isolate = Isolate::Current();
@@ -557,13 +568,24 @@
// Type extends Instance, must check first.
if (target.IsType()) {
const Class& cls = Class::Handle(isolate, Type::Cast(target).type_class());
- return Api::NewHandle(isolate, cls.Evaluate(expr));
+ return Api::NewHandle(isolate, cls.Evaluate(expr,
+ Array::empty_array(),
+ Array::empty_array()));
} else if (target.IsInstance()) {
- return Api::NewHandle(isolate, Instance::Cast(target).Evaluate(expr));
+ const Instance& inst = Instance::Cast(target);
+ return Api::NewHandle(isolate, inst.Evaluate(expr,
+ Array::empty_array(),
+ Array::empty_array()));
} else if (target.IsLibrary()) {
- return Api::NewHandle(isolate, Library::Cast(target).Evaluate(expr));
+ const Library& lib = Library::Cast(target);
+ return Api::NewHandle(isolate, lib.Evaluate(expr,
+ Array::empty_array(),
+ Array::empty_array()));
} else if (target.IsClass()) {
- return Api::NewHandle(isolate, Class::Cast(target).Evaluate(expr));
+ const Class& cls = Class::Cast(target);
+ return Api::NewHandle(isolate, cls.Evaluate(expr,
+ Array::empty_array(),
+ Array::empty_array()));
}
return Api::NewError("%s: unsupported target type", CURRENT_FUNC);
}
« no previous file with comments | « runtime/vm/debugger.cc ('k') | runtime/vm/object.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698