diff options
Diffstat (limited to 'lldb/source/DataFormatters/FormatManager.cpp')
-rw-r--r-- | lldb/source/DataFormatters/FormatManager.cpp | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/lldb/source/DataFormatters/FormatManager.cpp b/lldb/source/DataFormatters/FormatManager.cpp index 12838931f2b..2362ba52526 100644 --- a/lldb/source/DataFormatters/FormatManager.cpp +++ b/lldb/source/DataFormatters/FormatManager.cpp @@ -568,7 +568,7 @@ FormatManager::ShouldPrintAsOneLiner (ValueObject& valobj) CompilerType compiler_type(valobj.GetCompilerType()); if (compiler_type.IsValid()) { - switch (compiler_type.ShouldPrintAsOneLiner()) + switch (compiler_type.ShouldPrintAsOneLiner(&valobj)) { case eLazyBoolNo: return false; @@ -590,6 +590,23 @@ FormatManager::ShouldPrintAsOneLiner (ValueObject& valobj) // something is wrong here - bail out if (!child_sp) return false; + + // also ask the child's type if it has any opinion + CompilerType child_compiler_type(child_sp->GetCompilerType()); + if (child_compiler_type.IsValid()) + { + switch (child_compiler_type.ShouldPrintAsOneLiner(child_sp.get())) + { + case eLazyBoolYes: + // an opinion of yes is only binding for the child, so keep going + case eLazyBoolCalculate: + break; + case eLazyBoolNo: + // but if the child says no, then it's a veto on the whole thing + return false; + } + } + // if we decided to define synthetic children for a type, we probably care enough // to show them, but avoid nesting children in children if (child_sp->GetSyntheticChildren().get() != nullptr) |