summaryrefslogtreecommitdiffstats
path: root/lldb/source/DataFormatters/LibCxx.cpp
diff options
context:
space:
mode:
authorEnrico Granata <egranata@apple.com>2013-05-06 18:55:52 +0000
committerEnrico Granata <egranata@apple.com>2013-05-06 18:55:52 +0000
commit14b74fd1534ad271bb72276beb781bef195f9efe (patch)
tree56394f1d6bca7c8fd8db271b3b7cb9af39ee16af /lldb/source/DataFormatters/LibCxx.cpp
parent84c471029b4de0674a2d633e4a1291ccabaeadea (diff)
downloadbcm5719-llvm-14b74fd1534ad271bb72276beb781bef195f9efe.tar.gz
bcm5719-llvm-14b74fd1534ad271bb72276beb781bef195f9efe.zip
<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
Diffstat (limited to 'lldb/source/DataFormatters/LibCxx.cpp')
-rw-r--r--lldb/source/DataFormatters/LibCxx.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/lldb/source/DataFormatters/LibCxx.cpp b/lldb/source/DataFormatters/LibCxx.cpp
index a8be80a2526..237fc7c0d51 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 @@ lldb_private::formatters::LibcxxStdVectorSyntheticFrontEndCreator (CXXSyntheticC
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);
+}
OpenPOWER on IntegriCloud