<rdar://problem/11669154>

Make a summary format for libc++ STL containers that shows the number of items as before, but also shows the pointer value for pointer-to-container

llvm-svn: 181236
diff --git a/lldb/source/DataFormatters/LibCxx.cpp b/lldb/source/DataFormatters/LibCxx.cpp
index a8be80a..237fc7c 100644
--- a/lldb/source/DataFormatters/LibCxx.cpp
+++ b/lldb/source/DataFormatters/LibCxx.cpp
@@ -12,6 +12,7 @@
 #include "lldb/DataFormatters/CXXFormatterFunctions.h"
 
 #include "lldb/Core/DataBufferHeap.h"
+#include "lldb/Core/Debugger.h"
 #include "lldb/Core/Error.h"
 #include "lldb/Core/Stream.h"
 #include "lldb/Core/ValueObject.h"
@@ -504,3 +505,16 @@
         return NULL;
     return (new LibcxxStdVectorSyntheticFrontEnd(valobj_sp));
 }
+
+bool
+lldb_private::formatters::LibcxxContainerSummaryProvider (ValueObject& valobj, Stream& stream)
+{
+    if (valobj.IsPointerType())
+    {
+        uint64_t value = valobj.GetValueAsUnsigned(0);
+        if (!value)
+            return false;
+        stream.Printf("0x%016llx ", value);
+    }
+    return Debugger::FormatPrompt("size=${svar%#}", NULL, NULL, NULL, stream, NULL, &valobj);
+}