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

Unified Diff: tools/ddbg.dart

Issue 23067006: Evaluate expression in context of an object (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
« no previous file with comments | « runtime/vm/symbols.h ('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 26326)
+++ tools/ddbg.dart (working copy)
@@ -38,6 +38,7 @@
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
pl <id> <idx> [<len>] Print list element/slice
pc <id> Print class info for given id
ll List loaded libraries
@@ -126,6 +127,14 @@
"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(" ");
+ var cmd = { "id": seqNum,
+ "command": "evaluateExpr",
+ "params": { "isolateId": isolate_id,
+ "objectId": int.parse(args[1]),
+ "expression": expr } };
+ sendCmd(cmd).then((result) => handleEvalResponse(result));
} else if (command == "po" && args.length == 2) {
var cmd = { "id": seqNum,
"command": "getObjectProperties",
@@ -368,6 +377,12 @@
}
+void handleEvalResponse(response) {
+ Map result = response["result"];
+ print(remoteObject(result));
+}
+
+
void handleSetBpResponse(response) {
Map result = response["result"];
var id = result["breakpointId"];
« no previous file with comments | « runtime/vm/symbols.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698