Index: tools/ddbg.dart |
=================================================================== |
--- tools/ddbg.dart (revision 8218) |
+++ tools/ddbg.dart (working copy) |
@@ -39,6 +39,7 @@ |
ll List loaded libraries |
pl <id> Print dlibrary info for given id |
ls <libname> List loaded scripts in library |
+ gs <lib_id> <script_url> Get source text of script in library |
h Print help |
"""); |
} |
@@ -117,6 +118,11 @@ |
var cmd = { "id": seqNum, "command": "getLibraryProperties", |
"params": {"libraryId": Math.parseInt(args[1]) }}; |
sendCmd(cmd).then((result) => handleGetLibraryPropsResponse(result)); |
+ } else if (command == "gs" && args.length == 3) { |
+ var cmd = { "id": seqNum, "command": "getScriptSource", |
+ "params": { "libraryId": Math.parseInt(args[1]), |
+ "url": args[2] }}; |
+ sendCmd(cmd).then((result) => handleGetSourceResponse(result)); |
} else if (command == "q") { |
quitShell(); |
} else if (command == "h") { |
@@ -197,6 +203,13 @@ |
} |
+handleGetSourceResponse(response) { |
+ Map result = response["result"]; |
+ String source = result["text"]; |
+ print("Source text:\n$source\n--------"); |
+} |
+ |
+ |
void handleGetLibraryResponse(response) { |
Map result = response["result"]; |
List libs = result["libraries"]; |