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

Unified Diff: tools/ddbg.dart

Issue 14105003: Debugger wire protocol cleanups (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 8 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/bin/dbg_message.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 21218)
+++ tools/ddbg.dart (working copy)
@@ -23,14 +23,10 @@
final verbose = false;
final printMessages = false;
-// The current stack trace, while the VM is paused. It's a list
-// of activation frames.
-List stackTrace;
+// The location of the last paused event.
+Map pausedLocation = null;
-// The current activation frame, while the VM is paused.
-Map curFrame;
-
void printHelp() {
print("""
q Quit debugger shell
@@ -91,7 +87,6 @@
"command": simple_commands[command],
"params": { "isolateId" : isolate_id } };
sendCmd(cmd).then((result) => handleGenericResponse(result));
- stackTrace = curFrame = null;
} else if (command == "bt") {
var cmd = { "id": seqNum,
"command": "getStackTrace",
@@ -104,8 +99,9 @@
sendCmd(cmd).then((result) => handleGetLibraryResponse(result));
} else if (command == "sbp" && args.length >= 2) {
var url, line;
- if (args.length == 2) {
- url = stackTrace[0]["location"]["url"];
+ if (args.length == 2 && pausedLocation != null) {
+ url = pausedLocation["url"];
+ assert(url != null);
line = int.parse(args[1]);
} else {
url = args[1];
@@ -408,13 +404,13 @@
void handlePausedEvent(msg) {
assert(msg["params"] != null);
var reason = msg["params"]["reason"];
- isolate_id = msg["params"]["id"];
- stackTrace = msg["params"]["callFrames"];
- assert(stackTrace != null);
- assert(stackTrace.length >= 1);
- curFrame = stackTrace[0];
+ isolate_id = msg["params"]["isolateId"];
+ assert(isolate_id != null);
+ pausedLocation = msg["params"]["location"];
+ assert(pausedLocation != null);
if (reason == "breakpoint") {
print("Isolate $isolate_id paused on breakpoint");
+ print("location: $pausedLocation");
} else if (reason == "interrupted") {
print("Isolate $isolate_id paused due to an interrupt");
} else {
@@ -423,8 +419,6 @@
print("Isolate $isolate_id paused on exception");
print(remoteObject(excObj));
}
- print("Stack trace:");
- printStackTrace(stackTrace);
}
« no previous file with comments | « runtime/bin/dbg_message.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698