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

Side by Side Diff: runtime/observatory/lib/src/service/object.dart

Issue 993613002: Implement 'print', 'up', 'down', and 'frame' commands in the Observatory debugger. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: code review Created 5 years, 9 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
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 part of service; 5 part of service;
6 6
7 /// A [ServiceObject] represents a persistent object within the vm. 7 /// A [ServiceObject] represents a persistent object within the vm.
8 abstract class ServiceObject extends Observable { 8 abstract class ServiceObject extends Observable {
9 static int LexicalSortName(ServiceObject o1, ServiceObject o2) { 9 static int LexicalSortName(ServiceObject o1, ServiceObject o2) {
10 return o1.name.compareTo(o2.name); 10 return o1.name.compareTo(o2.name);
(...skipping 1117 matching lines...) Expand 10 before | Expand all | Expand 10 after
1128 Future<ServiceObject> addBreakpointAtEntry(ServiceFunction function) { 1128 Future<ServiceObject> addBreakpointAtEntry(ServiceFunction function) {
1129 return invokeRpc('addBreakpointAtEntry', 1129 return invokeRpc('addBreakpointAtEntry',
1130 { 'functionId': function.id }); 1130 { 'functionId': function.id });
1131 } 1131 }
1132 1132
1133 Future removeBreakpoint(Breakpoint bpt) { 1133 Future removeBreakpoint(Breakpoint bpt) {
1134 return invokeRpc('removeBreakpoint', 1134 return invokeRpc('removeBreakpoint',
1135 { 'breakpointId': bpt.id }); 1135 { 'breakpointId': bpt.id });
1136 } 1136 }
1137 1137
1138 // TODO(turnidge): If the user invokes pause (or other rpcs) twice,
1139 // they could get a race. Consider returning an "in progress"
1140 // future to avoid this.
1141 Future pause() { 1138 Future pause() {
1142 return invokeRpc('pause', {}).then((result) { 1139 return invokeRpc('pause', {}).then((result) {
1143 if (result is DartError) { 1140 if (result is DartError) {
1144 // TODO(turnidge): Handle this more gracefully. 1141 // TODO(turnidge): Handle this more gracefully.
1145 Logger.root.severe(result.message); 1142 Logger.root.severe(result.message);
1146 } 1143 }
1147 return isolate.reload();
1148 }); 1144 });
1149 } 1145 }
1150 1146
1151 Future resume() { 1147 Future resume() {
1152 return invokeRpc('resume', {}).then((result) { 1148 return invokeRpc('resume', {}).then((result) {
1153 if (result is DartError) { 1149 if (result is DartError) {
1154 // TODO(turnidge): Handle this more gracefully. 1150 // TODO(turnidge): Handle this more gracefully.
1155 Logger.root.severe(result.message); 1151 Logger.root.severe(result.message);
1156 } 1152 }
1157 return isolate.reload();
1158 }); 1153 });
1159 } 1154 }
1160 1155
1161 Future stepInto() { 1156 Future stepInto() {
1162 return invokeRpc('resume', {'step': 'into'}).then((result) { 1157 return invokeRpc('resume', {'step': 'into'}).then((result) {
1163 if (result is DartError) { 1158 if (result is DartError) {
1164 // TODO(turnidge): Handle this more gracefully. 1159 // TODO(turnidge): Handle this more gracefully.
1165 Logger.root.severe(result.message); 1160 Logger.root.severe(result.message);
1166 } 1161 }
1167 return isolate.reload();
1168 }); 1162 });
1169 } 1163 }
1170 1164
1171 Future stepOver() { 1165 Future stepOver() {
1172 return invokeRpc('resume', {'step': 'over'}).then((result) { 1166 return invokeRpc('resume', {'step': 'over'}).then((result) {
1173 if (result is DartError) { 1167 if (result is DartError) {
1174 // TODO(turnidge): Handle this more gracefully. 1168 // TODO(turnidge): Handle this more gracefully.
1175 Logger.root.severe(result.message); 1169 Logger.root.severe(result.message);
1176 } 1170 }
1177 return isolate.reload();
1178 }); 1171 });
1179 } 1172 }
1180 1173
1181 Future stepOut() { 1174 Future stepOut() {
1182 return invokeRpc('resume', {'step': 'out'}).then((result) { 1175 return invokeRpc('resume', {'step': 'out'}).then((result) {
1183 if (result is DartError) { 1176 if (result is DartError) {
1184 // TODO(turnidge): Handle this more gracefully. 1177 // TODO(turnidge): Handle this more gracefully.
1185 Logger.root.severe(result.message); 1178 Logger.root.severe(result.message);
1186 } 1179 }
1187 return isolate.reload();
1188 }); 1180 });
1189 } 1181 }
1190 1182
1191 Future<ServiceMap> getStack() { 1183 Future<ServiceMap> getStack() {
1192 return invokeRpc('getStack', {}).then((result) { 1184 return invokeRpc('getStack', {}).then((result) {
1193 if (result is DartError) { 1185 if (result is DartError) {
1194 // TODO(turnidge): Handle this more gracefully. 1186 // TODO(turnidge): Handle this more gracefully.
1195 Logger.root.severe(result.message); 1187 Logger.root.severe(result.message);
1196 } 1188 }
1197 return result; 1189 return result;
1198 }); 1190 });
1199 } 1191 }
1200 1192
1201 Future<ServiceObject> eval(ServiceObject target, 1193 Future<ServiceObject> eval(ServiceObject target,
1202 String expression) { 1194 String expression) {
1203 Map params = { 1195 Map params = {
1204 'targetId': target.id, 1196 'targetId': target.id,
1205 'expression': expression, 1197 'expression': expression,
1206 }; 1198 };
1207 return invokeRpc('eval', params); 1199 return invokeRpc('eval', params);
1208 } 1200 }
1209 1201
1202 Future<ServiceObject> evalFrame(int framePos,
1203 String expression) {
1204 Map params = {
1205 'frame': framePos,
1206 'expression': expression,
1207 };
1208 return invokeRpc('evalFrame', params);
1209 }
1210
1210 Future<ServiceObject> getRetainedSize(ServiceObject target) { 1211 Future<ServiceObject> getRetainedSize(ServiceObject target) {
1211 Map params = { 1212 Map params = {
1212 'targetId': target.id, 1213 'targetId': target.id,
1213 }; 1214 };
1214 return invokeRpc('getRetainedSize', params); 1215 return invokeRpc('getRetainedSize', params);
1215 } 1216 }
1216 1217
1217 Future<ServiceObject> getRetainingPath(ServiceObject target, var limit) { 1218 Future<ServiceObject> getRetainingPath(ServiceObject target, var limit) {
1218 Map params = { 1219 Map params = {
1219 'targetId': target.id, 1220 'targetId': target.id,
(...skipping 708 matching lines...) Expand 10 before | Expand all | Expand 10 after
1928 "${owningClass.name}.${name}" : 1929 "${owningClass.name}.${name}" :
1929 name; 1930 name;
1930 } else { 1931 } else {
1931 qualifiedName = "${parent.qualifiedName}.${name}"; 1932 qualifiedName = "${parent.qualifiedName}.${name}";
1932 } 1933 }
1933 1934
1934 if (mapIsRef) { 1935 if (mapIsRef) {
1935 return; 1936 return;
1936 } 1937 }
1937 1938
1939 _loaded = true;
1938 isStatic = map['static']; 1940 isStatic = map['static'];
1939 isConst = map['const']; 1941 isConst = map['const'];
1940 parent = map['parent']; 1942 parent = map['parent'];
1941 script = map['script']; 1943 script = map['script'];
1942 tokenPos = map['tokenPos']; 1944 tokenPos = map['tokenPos'];
1943 endTokenPos = map['endTokenPos']; 1945 endTokenPos = map['endTokenPos'];
1944 code = _convertNull(map['code']); 1946 code = _convertNull(map['code']);
1945 unoptimizedCode = _convertNull(map['unoptimizedCode']); 1947 unoptimizedCode = _convertNull(map['unoptimizedCode']);
1946 isOptimizable = map['optimizable']; 1948 isOptimizable = map['optimizable'];
1947 isInlinable = map['inlinable']; 1949 isInlinable = map['inlinable'];
(...skipping 947 matching lines...) Expand 10 before | Expand all | Expand 10 after
2895 var v = list[i]; 2897 var v = list[i];
2896 if ((v is ObservableMap) && _isServiceMap(v)) { 2898 if ((v is ObservableMap) && _isServiceMap(v)) {
2897 list[i] = owner.getFromMap(v); 2899 list[i] = owner.getFromMap(v);
2898 } else if (v is ObservableList) { 2900 } else if (v is ObservableList) {
2899 _upgradeObservableList(v, owner); 2901 _upgradeObservableList(v, owner);
2900 } else if (v is ObservableMap) { 2902 } else if (v is ObservableMap) {
2901 _upgradeObservableMap(v, owner); 2903 _upgradeObservableMap(v, owner);
2902 } 2904 }
2903 } 2905 }
2904 } 2906 }
OLDNEW
« no previous file with comments | « runtime/observatory/lib/src/elements/debugger.html ('k') | runtime/observatory/test/command_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698