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

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
Index: runtime/bin/dbg_connection.cc
===================================================================
--- runtime/bin/dbg_connection.cc (revision 9716)
+++ runtime/bin/dbg_connection.cc (working copy)
@@ -323,7 +323,27 @@
}
+static void FormatEncodedString32(dart::TextBuffer* buf, Dart_Handle str) {
+ intptr_t str_len = 0;
+ Dart_Handle res = Dart_StringLength(str, &str_len);
+ ASSERT_NOT_ERROR(res);
+ uint32_t* codepoints =
+ reinterpret_cast<uint32_t*>(malloc(str_len * sizeof(uint32_t)));
+ ASSERT(codepoints != NULL);
+ intptr_t actual_len = str_len;
+ res = Dart_StringGet32(str, codepoints, &actual_len);
siva 2012/07/18 17:11:31 ASSERT_NOT_ERROR(res);
hausner 2012/07/18 22:20:36 Done.
+ ASSERT(str_len == actual_len);
+ buf->Printf("\"");
+ buf->PrintJsonString32(codepoints, str_len);
+ buf->Printf("\"");
+ free(codepoints);
+}
+
+
static void FormatEncodedString(dart::TextBuffer* buf, Dart_Handle str) {
+ if (!Dart_IsString8(str)) {
+ return FormatEncodedString32(buf, str);
+ }
ASSERT(Dart_IsString8(str));
intptr_t str_len = 0;
Dart_Handle res = Dart_StringLength(str, &str_len);

Powered by Google App Engine
This is Rietveld 408576698