summaryrefslogtreecommitdiffstats
path: root/lldb/source/DataFormatters/ValueObjectPrinter.cpp
diff options
context:
space:
mode:
authorSiva Chandra <sivachandra@google.com>2015-07-24 21:30:58 +0000
committerSiva Chandra <sivachandra@google.com>2015-07-24 21:30:58 +0000
commitd26eb907bc5970c12d096b3d668909134502f102 (patch)
treec77c9e58c928a45629dbd54e06fe5574abd435de /lldb/source/DataFormatters/ValueObjectPrinter.cpp
parentfd4dfdcea1c9f52f4fc75c5c6d3d4acc078eb9f2 (diff)
downloadbcm5719-llvm-d26eb907bc5970c12d096b3d668909134502f102.tar.gz
bcm5719-llvm-d26eb907bc5970c12d096b3d668909134502f102.zip
Add option eTypeOptionHideEmptyAggregates.
Summary: For certain data structures, when the synthetic child provider returns zero children, a summary like "Empty instance of <typename>" could be more appropriate than something like "size=0 {}". This new option helps hide the trailing "{}". This is also exposed with a -h option for the command "type summary add". Reviewers: granata.enrico Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D11473 llvm-svn: 243166
Diffstat (limited to 'lldb/source/DataFormatters/ValueObjectPrinter.cpp')
-rw-r--r--lldb/source/DataFormatters/ValueObjectPrinter.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/lldb/source/DataFormatters/ValueObjectPrinter.cpp b/lldb/source/DataFormatters/ValueObjectPrinter.cpp
index 7c794ee2dda..7fca7a3f0af 100644
--- a/lldb/source/DataFormatters/ValueObjectPrinter.cpp
+++ b/lldb/source/DataFormatters/ValueObjectPrinter.cpp
@@ -480,6 +480,17 @@ ValueObjectPrinter::ShouldPrintChildren (bool is_failed_description,
return false;
}
+bool
+ValueObjectPrinter::ShouldExpandEmptyAggregates ()
+{
+ TypeSummaryImpl* entry = GetSummaryFormatter();
+
+ if (!entry)
+ return true;
+
+ return entry->DoesPrintEmptyAggregates();
+}
+
ValueObject*
ValueObjectPrinter::GetValueObjectForChildrenGeneration ()
{
@@ -582,7 +593,7 @@ ValueObjectPrinter::PrintChildren (uint32_t curr_ptr_depth)
if (ShouldPrintValueObject())
{
// if it has a synthetic value, then don't print {}, the synthetic children are probably only being used to vend a value
- if (m_valobj->DoesProvideSyntheticValue())
+ if (m_valobj->DoesProvideSyntheticValue() || !ShouldExpandEmptyAggregates())
m_stream->PutCString( "\n");
else
m_stream->PutCString(" {}\n");
OpenPOWER on IntegriCloud