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

Unified Diff: runtime/bin/dbg_message.cc

Issue 27397002: Handle recursive list structures in debugger (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 2 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 | no next file » | 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 28671)
+++ runtime/bin/dbg_message.cc (working copy)
@@ -167,7 +167,8 @@
static void FormatTextualValue(dart::TextBuffer* buf,
Dart_Handle object,
- intptr_t max_chars);
+ intptr_t max_chars,
+ bool expand_list);
static void FormatTextualListValue(dart::TextBuffer* buf,
@@ -186,7 +187,7 @@
}
Dart_Handle elem = Dart_ListGetAt(list, i);
const intptr_t max_element_chars = 50;
- FormatTextualValue(buf, elem, max_element_chars);
+ FormatTextualValue(buf, elem, max_element_chars, false);
if (buf->length() > max_buffer_length) {
buf->Printf(", ...");
break;
@@ -198,9 +199,14 @@
static void FormatTextualValue(dart::TextBuffer* buf,
Dart_Handle object,
- intptr_t max_chars) {
+ intptr_t max_chars,
+ bool expand_list) {
if (Dart_IsList(object)) {
- FormatTextualListValue(buf, object, max_chars);
+ if (expand_list) {
+ FormatTextualListValue(buf, object, max_chars);
+ } else {
+ buf->Printf("[...]");
+ }
} else if (Dart_IsNull(object)) {
buf->Printf("null");
} else if (Dart_IsString(object)) {
@@ -242,7 +248,7 @@
}
buf->Printf("\"text\":\"");
const intptr_t max_chars = 250;
- FormatTextualValue(buf, object, max_chars);
+ FormatTextualValue(buf, object, max_chars, true);
buf->Printf("\"");
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698