<rdar://problem/12042982>

This radar extends the notion of one-liner summaries to automagically apply in a few interesting cases

More specifically, this checkin changes the printout of ValueObjects to print on one-line (as if type summary add -c had been applied) iff:
this ValueObject does not have a summary
its children have no synthetic children
its children are not a non-empty base class without a summary
its children do not have a summary that asks for children to show up
the aggregate length of all the names of all the children is <= 50 characters
you did not ask to see the types during a printout
your pointer depth is 0

This is meant to simplify the way LLDB shows data on screen for small structs and similarly compact data types (e.g. std::pair<int,int> anyone?)

Feedback is especially welcome on how the feature feels and corner cases where we should apply this printout and don't (or viceversa, we are applying it when we shouldn't be)

llvm-svn: 191996
This commit is contained in:
Enrico Granata
2013-10-04 23:14:13 +00:00
parent 1f4f5d7b84
commit a29cb0bada
19 changed files with 188 additions and 92 deletions

View File

@@ -40,6 +40,12 @@ DataVisualization::GetCurrentRevision ()
return GetFormatManager().GetCurrentRevision();
}
bool
DataVisualization::ShouldPrintAsOneLiner (ValueObject& valobj)
{
return GetFormatManager().ShouldPrintAsOneLiner(valobj);
}
lldb::TypeFormatImplSP
DataVisualization::ValueFormats::GetFormat (ValueObject& valobj, lldb::DynamicValueType use_dynamic)
{