lldb::Format m_format;
lldb::TypeSummaryImplSP m_summary_sp;
std::string m_root_valobj_name;
+ bool m_hide_root_type;
DumpValueObjectOptions() :
m_max_ptr_depth(0),
m_ignore_cap(false),
m_format (lldb::eFormatDefault),
m_summary_sp(),
- m_root_valobj_name()
+ m_root_valobj_name(),
+ m_hide_root_type(false) // <rdar://problem/11505459> provide a special compact display for "po",
{}
static const DumpValueObjectOptions
m_ignore_cap(rhs.m_ignore_cap),
m_format(rhs.m_format),
m_summary_sp(rhs.m_summary_sp),
- m_root_valobj_name(rhs.m_root_valobj_name)
+ m_root_valobj_name(rhs.m_root_valobj_name),
+ m_hide_root_type(rhs.m_hide_root_type)
{}
DumpValueObjectOptions&
m_root_valobj_name.clear();
return *this;
}
+
+ DumpValueObjectOptions&
+ SetHideRootType (bool hide_root_type = false)
+ {
+ m_hide_root_type = hide_root_type;
+ return *this;
+ }
};
.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
}
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>");
self.runCmd("run", RUN_SUCCEEDED)
self.expect("po [NSError errorWithDomain:@\"Hello\" code:35 userInfo:nil]",
- patterns = ["\(id\) \$.* = ", "Error Domain=Hello", "Code=35", "be completed."])
+ substrs = ["$", "= 0x", "Error Domain=Hello", "Code=35", "be completed."])
self.runCmd("process continue")
def NSError_p(self):
break
self.expect("po lock_me", OBJECT_PRINTED_CORRECTLY,
- substrs = ['LockMe *', 'I am pretty special.'])
+ substrs = ['I am pretty special.'])
if __name__ == '__main__':