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

Unified Diff: runtime/bin/dbg_connection.cc

Issue 10383122: Eliminate need for va_copy in json.cc (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 7 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_connection.h ('k') | runtime/platform/json.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/dbg_connection.cc
===================================================================
--- runtime/bin/dbg_connection.cc (revision 7522)
+++ runtime/bin/dbg_connection.cc (working copy)
@@ -166,14 +166,9 @@
void DebuggerConnectionHandler::SendError(int msg_id,
- const char* format, ...) {
+ const char* err_msg) {
dart::TextBuffer msg(64);
- msg.Printf("{\"id\": %d, \"error\": \"", msg_id);
- va_list args;
- va_start(args, format);
- msg.Printf(format, args);
- va_end(args);
- msg.Printf("\"}");
+ msg.Printf("{\"id\": %d, \"error\": \"Error: %s\"}", msg_id, err_msg);
Socket::Write(debugger_fd_, msg.buf(), msg.length());
// TODO(hausner): Error checking. Probably just shut down the debugger
// session if we there is an error while writing.
@@ -226,7 +221,7 @@
ASSERT_NOT_ERROR(lib_url);
Dart_Handle urls = Dart_GetScriptURLs(lib_url);
if (Dart_IsError(urls)) {
- SendError(msg_id, "Error: '%s'.", Dart_GetError(urls));
+ SendError(msg_id, Dart_GetError(urls));
return;
}
ASSERT(Dart_IsList(urls));
« no previous file with comments | « runtime/bin/dbg_connection.h ('k') | runtime/platform/json.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698