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

Unified Diff: runtime/bin/dbg_message.cc

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 | « no previous file | tools/ddbg.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/dbg_message.cc
===================================================================
--- runtime/bin/dbg_message.cc (revision 21218)
+++ runtime/bin/dbg_message.cc (working copy)
@@ -390,7 +390,8 @@
static void FormatLocationFromTrace(dart::TextBuffer* msg,
- Dart_StackTrace trace) {
+ Dart_StackTrace trace,
+ const char* prefix) {
intptr_t trace_len = 0;
Dart_Handle res = Dart_StackTraceLength(trace, &trace_len);
ASSERT_NOT_ERROR(res);
@@ -410,11 +411,11 @@
ASSERT_NOT_ERROR(res);
if (!Dart_IsNull(script_url)) {
ASSERT(Dart_IsString(script_url));
- msg->Printf("\"location\": { \"url\":");
+ msg->Printf("%s\"location\": { \"url\":", prefix);
FormatEncodedString(msg, script_url);
msg->Printf(",\"libraryId\":%"Pd",", library_id);
msg->Printf("\"tokenOffset\":%"Pd",", token_number);
- msg->Printf("\"lineNumber\":%"Pd"},", line_number);
+ msg->Printf("\"lineNumber\":%"Pd"}", line_number);
}
}
@@ -1007,9 +1008,8 @@
dart::TextBuffer msg(128);
msg.Printf("{ \"event\": \"paused\", \"params\": { ");
msg.Printf("\"reason\": \"breakpoint\", ");
- msg.Printf("\"id\": %"Pd64", ", isolate_id_);
- FormatLocationFromTrace(&msg, trace);
- FormatCallFrames(&msg, trace);
+ msg.Printf("\"isolateId\": %"Pd64"", isolate_id_);
+ FormatLocationFromTrace(&msg, trace, ", ");
msg.Printf("}}");
DebuggerConnectionHandler::BroadcastMsg(&msg);
}
@@ -1024,12 +1024,10 @@
dart::TextBuffer msg(128);
msg.Printf("{ \"event\": \"paused\", \"params\": {");
msg.Printf("\"reason\": \"exception\", ");
- msg.Printf("\"id\": %"Pd64", ", isolate_id_);
+ msg.Printf("\"isolateId\": %"Pd64", ", isolate_id_);
msg.Printf("\"exception\":");
FormatRemoteObj(&msg, exception);
- msg.Printf(", ");
- FormatLocationFromTrace(&msg, stack_trace);
- FormatCallFrames(&msg, stack_trace);
+ FormatLocationFromTrace(&msg, stack_trace, ", ");
msg.Printf("}}");
DebuggerConnectionHandler::BroadcastMsg(&msg);
}
@@ -1046,9 +1044,8 @@
ASSERT_NOT_ERROR(res);
msg.Printf("{ \"event\": \"paused\", \"params\": { ");
msg.Printf("\"reason\": \"interrupted\", ");
- msg.Printf("\"id\": %"Pd64", ", isolate_id);
- FormatLocationFromTrace(&msg, trace);
- FormatCallFrames(&msg, trace);
+ msg.Printf("\"isolateId\": %"Pd64"", isolate_id);
+ FormatLocationFromTrace(&msg, trace, ", ");
msg.Printf("}}");
} else {
msg.Printf("{ \"event\": \"isolate\", \"params\": { ");
« no previous file with comments | « no previous file | tools/ddbg.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698