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

Side by Side Diff: runtime/vm/service.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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/vm/object.cc ('k') | tools/ddbg.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 "vm/service.h" 5 #include "vm/service.h"
6 6
7 #include "include/dart_api.h" 7 #include "include/dart_api.h"
8 #include "platform/globals.h" 8 #include "platform/globals.h"
9 9
10 #include "vm/compiler.h" 10 #include "vm/compiler.h"
(...skipping 864 matching lines...) Expand 10 before | Expand all | Expand 10 after
875 } 875 }
876 const char* expr = js->LookupOption("expr"); 876 const char* expr = js->LookupOption("expr");
877 if (expr == NULL) { 877 if (expr == NULL) {
878 PrintError(js, "eval expects an 'expr' option\n", 878 PrintError(js, "eval expects an 'expr' option\n",
879 js->num_arguments()); 879 js->num_arguments());
880 return true; 880 return true;
881 } 881 }
882 const String& expr_str = String::Handle(isolate, String::New(expr)); 882 const String& expr_str = String::Handle(isolate, String::New(expr));
883 ASSERT(obj.IsInstance()); 883 ASSERT(obj.IsInstance());
884 const Instance& instance = Instance::Cast(obj); 884 const Instance& instance = Instance::Cast(obj);
885 const Object& result = Object::Handle(instance.Evaluate(expr_str)); 885 const Object& result =
886 Object::Handle(instance.Evaluate(expr_str,
887 Array::empty_array(),
888 Array::empty_array()));
886 if (result.IsNull()) { 889 if (result.IsNull()) {
887 Object::null_instance().PrintToJSONStream(js, true); 890 Object::null_instance().PrintToJSONStream(js, true);
888 } else { 891 } else {
889 result.PrintToJSONStream(js, true); 892 result.PrintToJSONStream(js, true);
890 } 893 }
891 return true; 894 return true;
892 } 895 }
893 896
894 PrintError(js, "unrecognized action '%s'\n", action); 897 PrintError(js, "unrecognized action '%s'\n", action);
895 return true; 898 return true;
(...skipping 28 matching lines...) Expand all
924 PrintError(js, "Command too long"); 927 PrintError(js, "Command too long");
925 return true; 928 return true;
926 } 929 }
927 const char* expr = js->LookupOption("expr"); 930 const char* expr = js->LookupOption("expr");
928 if (expr == NULL) { 931 if (expr == NULL) {
929 PrintError(js, "eval expects an 'expr' option\n", 932 PrintError(js, "eval expects an 'expr' option\n",
930 js->num_arguments()); 933 js->num_arguments());
931 return true; 934 return true;
932 } 935 }
933 const String& expr_str = String::Handle(isolate, String::New(expr)); 936 const String& expr_str = String::Handle(isolate, String::New(expr));
934 const Object& result = Object::Handle(cls.Evaluate(expr_str)); 937 const Object& result = Object::Handle(cls.Evaluate(expr_str,
938 Array::empty_array(),
939 Array::empty_array()));
935 if (result.IsNull()) { 940 if (result.IsNull()) {
936 Object::null_instance().PrintToJSONStream(js, true); 941 Object::null_instance().PrintToJSONStream(js, true);
937 } else { 942 } else {
938 result.PrintToJSONStream(js, true); 943 result.PrintToJSONStream(js, true);
939 } 944 }
940 return true; 945 return true;
941 } 946 }
942 947
943 948
944 static bool HandleClassesDispatchers(Isolate* isolate, const Class& cls, 949 static bool HandleClassesDispatchers(Isolate* isolate, const Class& cls,
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
1116 PrintError(js, "Command too long"); 1121 PrintError(js, "Command too long");
1117 return true; 1122 return true;
1118 } 1123 }
1119 const char* expr = js->LookupOption("expr"); 1124 const char* expr = js->LookupOption("expr");
1120 if (expr == NULL) { 1125 if (expr == NULL) {
1121 PrintError(js, "eval expects an 'expr' option\n", 1126 PrintError(js, "eval expects an 'expr' option\n",
1122 js->num_arguments()); 1127 js->num_arguments());
1123 return true; 1128 return true;
1124 } 1129 }
1125 const String& expr_str = String::Handle(isolate, String::New(expr)); 1130 const String& expr_str = String::Handle(isolate, String::New(expr));
1126 const Object& result = Object::Handle(lib.Evaluate(expr_str)); 1131 const Object& result = Object::Handle(lib.Evaluate(expr_str,
1132 Array::empty_array(),
1133 Array::empty_array()));
1127 if (result.IsNull()) { 1134 if (result.IsNull()) {
1128 Object::null_instance().PrintToJSONStream(js, true); 1135 Object::null_instance().PrintToJSONStream(js, true);
1129 } else { 1136 } else {
1130 result.PrintToJSONStream(js, true); 1137 result.PrintToJSONStream(js, true);
1131 } 1138 }
1132 return true; 1139 return true;
1133 } 1140 }
1134 1141
1135 1142
1136 static bool HandleLibraries(Isolate* isolate, JSONStream* js) { 1143 static bool HandleLibraries(Isolate* isolate, JSONStream* js) {
(...skipping 830 matching lines...) Expand 10 before | Expand all | Expand 10 after
1967 while (current != NULL) { 1974 while (current != NULL) {
1968 if (strcmp(name, current->name()) == 0) { 1975 if (strcmp(name, current->name()) == 0) {
1969 return current; 1976 return current;
1970 } 1977 }
1971 current = current->next(); 1978 current = current->next();
1972 } 1979 }
1973 return NULL; 1980 return NULL;
1974 } 1981 }
1975 1982
1976 } // namespace dart 1983 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/object.cc ('k') | tools/ddbg.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698