diff options
Diffstat (limited to 'lldb/source')
| -rw-r--r-- | lldb/source/Commands/CommandObjectExpression.cpp | 3 | ||||
| -rw-r--r-- | lldb/source/Core/ValueObject.cpp | 13 |
2 files changed, 12 insertions, 4 deletions
diff --git a/lldb/source/Commands/CommandObjectExpression.cpp b/lldb/source/Commands/CommandObjectExpression.cpp index 72cb131aea1..35d372ddd56 100644 --- a/lldb/source/Commands/CommandObjectExpression.cpp +++ b/lldb/source/Commands/CommandObjectExpression.cpp @@ -360,7 +360,8 @@ CommandObjectExpression::EvaluateExpression .SetIgnoreCap(false) .SetFormat(format) .SetSummary() - .SetShowSummary(!m_command_options.print_object); + .SetShowSummary(!m_command_options.print_object) + .SetHideRootType(m_command_options.print_object); ValueObject::DumpValueObject (*(output_stream), result_valobj_sp.get(), // Variable object to dump diff --git a/lldb/source/Core/ValueObject.cpp b/lldb/source/Core/ValueObject.cpp index 4dc22f02039..127152e3bb4 100644 --- a/lldb/source/Core/ValueObject.cpp +++ b/lldb/source/Core/ValueObject.cpp @@ -3191,9 +3191,16 @@ DumpValueObject_Impl (Stream &s, } s.Indent(); - - // Always show the type for the top level items. - if (options.m_show_types || (curr_depth == 0 && !options.m_flat_output)) + + bool show_type = true; + // if we are at the root-level and been asked to hide the root's type, then hide it + if (curr_depth == 0 && options.m_hide_root_type) + show_type = false; + else + // otherwise decide according to the usual rules (asked to show types - always at the root level) + show_type = options.m_show_types || (curr_depth == 0 && !options.m_flat_output); + + if (show_type) { const char* typeName = valobj->GetQualifiedTypeName().AsCString("<invalid type>"); //const char* typeName = valobj->GetTypeName().AsCString("<invalid type>"); |

