Index: tools/ddbg.dart |
=================================================================== |
--- tools/ddbg.dart (revision 13208) |
+++ tools/ddbg.dart (working copy) |
@@ -48,6 +48,7 @@ |
ls <lib_id> List loaded scripts in library |
gs <lib_id> <script_url> Get source text of script in library |
epi <none|all|unhandled> Set exception pause info |
+ i <id> Interrupt execution of given isolate id |
hausner
2012/10/05 18:06:34
Don't you also want/need a command to list isolate
siva
2012/10/05 22:35:06
Yes, but I haven't added that yet. That is the nex
|
h Print help |
"""); |
} |
@@ -157,6 +158,10 @@ |
var cmd = { "id": seqNum, "command": "setPauseOnException", |
"params": { "exceptions": args[1] }}; |
sendCmd(cmd).then((result) => handleGenericResponse(result)); |
+ } else if (command == "i" && args.length == 2) { |
+ var cmd = { "id": seqNum, "command": "interrupt", |
+ "params": {"isolateId": Math.parseInt(args[1]) }}; |
+ sendCmd(cmd).then((result) => handleGenericResponse(result)); |
} else if (command == "q") { |
quitShell(); |
} else if (command == "h") { |
@@ -356,16 +361,19 @@ |
void handlePausedEvent(msg) { |
assert(msg["params"] != null); |
var reason = msg["params"]["reason"]; |
+ var id = msg["params"]["id"]; |
stackTrace = msg["params"]["callFrames"]; |
assert(stackTrace != null); |
assert(stackTrace.length >= 1); |
curFrame = stackTrace[0]; |
if (reason == "breakpoint") { |
- print("VM paused on breakpoint"); |
+ print("Isolate $id paused on breakpoint"); |
+ } else if (reason == "interrupted") { |
+ print("Isolate $id paused due to an interrupt"); |
} else { |
assert(reason == "exception"); |
var excObj = msg["params"]["exception"]; |
- print("VM paused on exception"); |
+ print("Isolate $id paused on exception"); |
print(remoteObject(excObj)); |
} |
print("Stack trace:"); |
@@ -390,6 +398,12 @@ |
"set at line ${params["line"]}."); |
return; |
} |
+ if (event == "isolate") { |
+ Map params = msg["params"]; |
+ assert(params != null); |
+ print("Isolate ${params["id"]} has been ${params["reason"]}."); |
+ return; |
+ } |
if (msg["id"] != null) { |
var id = msg["id"]; |
if (outstandingCommands.containsKey(id)) { |