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

Unified Diff: runtime/bin/dbg_connection.cc

Issue 10801002: Add multibyte string support to debugger (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 5 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 | runtime/platform/json.h » ('j') | runtime/platform/json.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/dbg_connection.cc
===================================================================
--- runtime/bin/dbg_connection.cc (revision 9748)
+++ runtime/bin/dbg_connection.cc (working copy)
@@ -324,18 +324,21 @@
static void FormatEncodedString(dart::TextBuffer* buf, Dart_Handle str) {
- ASSERT(Dart_IsString8(str));
intptr_t str_len = 0;
Dart_Handle res = Dart_StringLength(str, &str_len);
ASSERT_NOT_ERROR(res);
- uint8_t* codepoints = reinterpret_cast<uint8_t*>(malloc(str_len));
+ uint32_t* codepoints =
+ reinterpret_cast<uint32_t*>(malloc(str_len * sizeof(uint32_t)));
ASSERT(codepoints != NULL);
intptr_t actual_len = str_len;
- res = Dart_StringGet8(str, codepoints, &actual_len);
+ res = Dart_StringGet32(str, codepoints, &actual_len);
+ ASSERT_NOT_ERROR(res);
ASSERT(str_len == actual_len);
- buf->Printf("\"");
- buf->PrintJsonString8(codepoints, str_len);
- buf->Printf("\"");
+ buf->AddChar('\"');
+ for (int i = 0; i < str_len; i++) {
+ buf->AddEscapedChar(codepoints[i]);
+ }
+ buf->AddChar('\"');
free(codepoints);
}
« no previous file with comments | « no previous file | runtime/platform/json.h » ('j') | runtime/platform/json.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698