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

Unified Diff: tools/ddbg.dart

Issue 23102019: Evaluate expression in the context of a class (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 4 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
« runtime/vm/object.h ('K') | « runtime/vm/object.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/ddbg.dart
===================================================================
--- tools/ddbg.dart (revision 26604)
+++ tools/ddbg.dart (working copy)
@@ -5,6 +5,7 @@
// Simple interactive debugger shell that connects to the Dart VM's debugger
// connection port.
+import "dart:convert";
import "dart:io";
import "dart:json" as json;
import "dart:utf";
@@ -38,7 +39,8 @@
sbp [<file>] <line> Set breakpoint
rbp <id> Remove breakpoint with given id
po <id> Print object info for given id
- eval <id> <expr> Evaluate expr on object id
+ eval obj <id> <expr> Evaluate expr on object id
+ eval cls <id> <expr> Evaluate expr on class id
pl <id> <idx> [<len>] Print list element/slice
pc <id> Print class info for given id
ll List loaded libraries
@@ -74,8 +76,16 @@
return completer.future;
}
+void huh() {
+}
+
void processCommand(String cmdLine) {
+
+ void huh() {
+ print("'$cmdLine' not understood, try h for help");
+ }
+
seqNum++;
var args = cmdLine.split(' ');
if (args.length == 0) {
@@ -127,13 +137,23 @@
"params": { "isolateId" : isolate_id,
"libraryId": int.parse(args[1]) } };
sendCmd(cmd).then((result) => handleGetScriptsResponse(result));
- } else if (command == "eval" && args.length > 2) {
- var expr = args.getRange(2, args.length).join(" ");
+ } else if (command == "eval" && args.length > 3) {
+ var expr = args.getRange(3, args.length).join(" ");
+ var target = args[1];
+ if (target == "obj") {
+ target = "objectId";
+ } else if (target == "cls") {
+ target = "classId";
+ } else {
+ huh();
+ return;
+ }
var cmd = { "id": seqNum,
"command": "evaluateExpr",
"params": { "isolateId": isolate_id,
- "objectId": int.parse(args[1]),
+ target: int.parse(args[2]),
"expression": expr } };
+
sendCmd(cmd).then((result) => handleEvalResponse(result));
} else if (command == "po" && args.length == 2) {
var cmd = { "id": seqNum,
@@ -216,7 +236,7 @@
} else if (command == "h") {
printHelp();
} else {
- print("command '$command' not understood, try h for help");
+ huh();
}
}
@@ -605,7 +625,7 @@
quitShell();
});
stdinSubscription = stdin.transform(new StringDecoder())
- .transform(new LineTransformer())
+ .transform(new LineSplitter())
.listen((String line) => processCommand(line));
});
}
« runtime/vm/object.h ('K') | « runtime/vm/object.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698