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

Side by Side Diff: runtime/bin/dbg_message.cc

Issue 11645046: Fix an issue with newlines and exception text in the debugger wire protocol. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "bin/dbg_connection.h" 5 #include "bin/dbg_connection.h"
6 #include "bin/dbg_message.h" 6 #include "bin/dbg_message.h"
7 #include "bin/dartutils.h" 7 #include "bin/dartutils.h"
8 #include "bin/thread.h" 8 #include "bin/thread.h"
9 #include "bin/utils.h" 9 #include "bin/utils.h"
10 10
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 buf->AddChar('\"'); 119 buf->AddChar('\"');
120 for (int i = 0; i < str_len; i++) { 120 for (int i = 0; i < str_len; i++) {
121 buf->AddEscapedChar(codepoints[i]); 121 buf->AddEscapedChar(codepoints[i]);
122 } 122 }
123 buf->AddChar('\"'); 123 buf->AddChar('\"');
124 free(codepoints); 124 free(codepoints);
125 } 125 }
126 126
127 127
128 static void FormatErrorMsg(dart::TextBuffer* buf, Dart_Handle err) { 128 static void FormatErrorMsg(dart::TextBuffer* buf, Dart_Handle err) {
129 // TODO(hausner): Turn message into Dart string and
130 // properly encode the message.
131 ASSERT(Dart_IsError(err)); 129 ASSERT(Dart_IsError(err));
132 const char* msg = Dart_GetError(err); 130 const char* msg = Dart_GetError(err);
133 buf->Printf("\"%s\"", msg); 131 Dart_Handle str = Dart_NewStringFromCString(msg);
132 FormatEncodedString(buf, str);
134 } 133 }
135 134
136 135
137 static void FormatTextualValue(dart::TextBuffer* buf, Dart_Handle object) { 136 static void FormatTextualValue(dart::TextBuffer* buf, Dart_Handle object) {
138 Dart_Handle text; 137 Dart_Handle text;
139 if (Dart_IsNull(object)) { 138 if (Dart_IsNull(object)) {
140 text = Dart_Null(); 139 text = Dart_Null();
141 } else { 140 } else {
142 Dart_ExceptionPauseInfo savedState = Dart_GetExceptionPauseInfo(); 141 Dart_ExceptionPauseInfo savedState = Dart_GetExceptionPauseInfo();
143 142
(...skipping 948 matching lines...) Expand 10 before | Expand all | Expand 10 after
1092 msg_queue->SendIsolateEvent(isolate_id, kind); 1091 msg_queue->SendIsolateEvent(isolate_id, kind);
1093 if (kind == kInterrupted) { 1092 if (kind == kInterrupted) {
1094 msg_queue->HandleMessages(); 1093 msg_queue->HandleMessages();
1095 } else { 1094 } else {
1096 ASSERT(kind == kShutdown); 1095 ASSERT(kind == kShutdown);
1097 RemoveIsolateMsgQueue(isolate_id); 1096 RemoveIsolateMsgQueue(isolate_id);
1098 } 1097 }
1099 } 1098 }
1100 Dart_ExitScope(); 1099 Dart_ExitScope();
1101 } 1100 }
OLDNEW
« no previous file with comments | « editor/tools/plugins/com.google.dart.tools.debug.core/src/com/google/dart/tools/debug/core/server/VmConnection.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698