Make StructureData objects dump themselves with correct indentation.

llvm-svn: 238279
diff --git a/lldb/source/Core/StructuredData.cpp b/lldb/source/Core/StructuredData.cpp
index 7b1e3d9..9286c3a 100644
--- a/lldb/source/Core/StructuredData.cpp
+++ b/lldb/source/Core/StructuredData.cpp
@@ -356,20 +356,28 @@
 {
     StreamString stream;
     Dump(stream);
-    printf("%s", stream.GetString().c_str());
+    printf("%s\n", stream.GetString().c_str());
 }
 
 void
 StructuredData::Array::Dump(Stream &s) const
 {
-    s << "[";
-    const size_t arrsize = m_items.size();
-    for (size_t i = 0; i < arrsize; ++i)
+    bool first = true;
+    s << "[\n";
+    s.IndentMore();
+    for (const auto &item_sp : m_items)
     {
-        m_items[i]->Dump(s);
-        if (i + 1 < arrsize)
-            s << ",";
+        if (first)
+            first = false;
+        else
+            s << ",\n";
+
+        s.Indent();
+        item_sp->Dump(s);
     }
+    s.IndentLess();
+    s.EOL();
+    s.Indent();
     s << "]";
 }
 
@@ -414,21 +422,22 @@
 void
 StructuredData::Dictionary::Dump (Stream &s) const
 {
-    bool have_printed_one_elem = false;
-    s << "{";
-    for (collection::const_iterator iter = m_dict.begin(); iter != m_dict.end(); ++iter)
+    bool first = true;
+    s << "{\n";
+    s.IndentMore();
+    for (const auto &pair : m_dict)
     {
-        if (have_printed_one_elem == false)
-        {
-            have_printed_one_elem = true;
-        }
+        if (first)
+            first = false;
         else
-        {
-            s << ",";
-        }
-        s << "\"" << iter->first.AsCString() << "\":";
-        iter->second->Dump(s);
+            s << ",\n";
+        s.Indent();
+        s << "\"" << pair.first.AsCString() << "\" : ";
+        pair.second->Dump(s);
     }
+    s.IndentLess();
+    s.EOL();
+    s.Indent();
     s << "}";
 }