From 14b74fd1534ad271bb72276beb781bef195f9efe Mon Sep 17 00:00:00 2001 From: Enrico Granata Date: Mon, 6 May 2013 18:55:52 +0000 Subject: 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 --- lldb/source/DataFormatters/LibCxx.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'lldb/source/DataFormatters/LibCxx.cpp') 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); +} -- cgit v1.2.3