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

Unified Diff: tools/ddbg.dart

Issue 11028040: - Add support to interrupt a running isolate (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 2 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/debugger.cc ('K') | « runtime/vm/debugger_api_impl_test.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 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)) {
« runtime/vm/debugger.cc ('K') | « runtime/vm/debugger_api_impl_test.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698