56LibStdcppUniquePtrSyntheticFrontEnd::LibStdcppUniquePtrSyntheticFrontEnd(
62ValueObjectSP LibStdcppUniquePtrSyntheticFrontEnd::GetTuple() {
65 if (!valobj_backend_sp)
68 ValueObjectSP valobj_sp = valobj_backend_sp->GetNonSyntheticValue();
72 ValueObjectSP obj_child_sp = valobj_sp->GetChildMemberWithName(
"_M_t");
76 ValueObjectSP obj_subchild_sp = obj_child_sp->GetChildMemberWithName(
"_M_t");
80 if (obj_subchild_sp) {
81 return obj_subchild_sp;
87bool LibStdcppUniquePtrSyntheticFrontEnd::Update() {
93 std::unique_ptr<SyntheticChildrenFrontEnd> tuple_frontend(
98 m_ptr_obj = ptr_obj->Clone(
ConstString(
"pointer")).get();
106 if (tuple_sp->GetByteSize() > ptr_obj->GetByteSize()) {
109 m_del_obj = del_obj->Clone(
ConstString(
"deleter")).get();
116bool LibStdcppUniquePtrSyntheticFrontEnd::MightHaveChildren() {
return true; }
119LibStdcppUniquePtrSyntheticFrontEnd::GetChildAtIndex(
size_t idx) {
120 if (idx == 0 && m_ptr_obj)
121 return m_ptr_obj->GetSP();
122 if (idx == 1 && m_del_obj)
123 return m_del_obj->GetSP();
125 if (m_ptr_obj && !m_obj_obj) {
128 if (
error.Success()) {
129 m_obj_obj = obj_obj->Clone(
ConstString(
"object")).get();
133 return m_obj_obj->GetSP();
138size_t LibStdcppUniquePtrSyntheticFrontEnd::CalculateNumChildren() {
144size_t LibStdcppUniquePtrSyntheticFrontEnd::GetIndexOfChildWithName(
146 if (name ==
"ptr" || name ==
"pointer")
148 if (name ==
"del" || name ==
"deleter")
150 if (name ==
"obj" || name ==
"object" || name ==
"$$dereference$$")
155bool LibStdcppUniquePtrSyntheticFrontEnd::GetSummary(
161 uint64_t ptr_value = m_ptr_obj->GetValueAsUnsigned(0, &success);
167 stream.
Printf(
"0x%" PRIx64, ptr_value);
174 return (valobj_sp ?
new LibStdcppUniquePtrSyntheticFrontEnd(valobj_sp)
180 LibStdcppUniquePtrSyntheticFrontEnd formatter(valobj.
GetSP());
181 return formatter.GetSummary(stream, options);
static llvm::raw_ostream & error(Stream &strm)
A uniqued constant string class.
A stream class that can stream formatted output to a file.
size_t Printf(const char *format,...) __attribute__((format(printf
Output printf formatted output to the stream.
virtual size_t CalculateNumChildren()=0
virtual bool MightHaveChildren()=0
virtual size_t GetIndexOfChildWithName(ConstString name)=0
virtual lldb::ValueObjectSP GetChildAtIndex(size_t idx)=0
lldb::ValueObjectSP GetSP()
A class that represents a running process on the host machine.
std::shared_ptr< lldb_private::ValueObject > ValueObjectSP