diff --git a/lldb/source/DataFormatters/ValueObjectPrinter.cpp b/lldb/source/DataFormatters/ValueObjectPrinter.cpp --- a/lldb/source/DataFormatters/ValueObjectPrinter.cpp +++ b/lldb/source/DataFormatters/ValueObjectPrinter.cpp @@ -590,7 +590,7 @@ void ValueObjectPrinter::PrintChild( ValueObjectSP child_sp, const DumpValueObjectOptions::PointerDepth &curr_ptr_depth) { - const uint32_t consumed_depth = (!m_options.m_pointer_as_array) ? 1 : 0; + const uint32_t consumed_depth = m_options.m_pointer_as_array ? 0 : 1; const bool does_consume_ptr_depth = ((IsPtr() && !m_options.m_pointer_as_array) || IsRef()); @@ -611,7 +611,7 @@ ValueObjectPrinter child_printer( child_sp.get(), m_stream, child_options, does_consume_ptr_depth ? --curr_ptr_depth : curr_ptr_depth, - m_curr_depth + consumed_depth, m_printed_instance_pointers); + m_curr_depth + 1, m_printed_instance_pointers); child_printer.PrintValueObject(); } }