Shuffle APIs around a little bit, so that if you pass custom summary options, we don't end up caching the summary hence obtained. You may want to obtain an uncapped summary, but this should not be reflected in the summary we cache. The drawback is that we don't cache as aggressively as we could, but at least you get to have different summaries with different options without having to reset formatters or the SBValue at each step

llvm-svn: 222280
diff --git a/lldb/source/API/SBValue.cpp b/lldb/source/API/SBValue.cpp
index 1b7c48c..f56013a 100644
--- a/lldb/source/API/SBValue.cpp
+++ b/lldb/source/API/SBValue.cpp
@@ -642,16 +642,19 @@
 }
 
 const char *
-SBValue::GetSummary (lldb::SBTypeSummaryOptions& options)
+SBValue::GetSummary (lldb::SBStream& stream,
+                     lldb::SBTypeSummaryOptions& options)
 {
     Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-    const char *cstr = NULL;
     ValueLocker locker;
     lldb::ValueObjectSP value_sp(GetSP(locker));
     if (value_sp)
     {
-        cstr = value_sp->GetSummaryAsCString(options.ref());
+        std::string buffer;
+        if (value_sp->GetSummaryAsCString(buffer,options.ref()) && !buffer.empty())
+            stream.Printf("%s",buffer.c_str());
     }
+    const char* cstr = stream.GetData();
     if (log)
     {
         if (cstr)