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;
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(uint32_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();
138llvm::Expected<uint32_t>
139LibStdcppUniquePtrSyntheticFrontEnd::CalculateNumChildren() {
145size_t LibStdcppUniquePtrSyntheticFrontEnd::GetIndexOfChildWithName(
147 if (name ==
"ptr" || name ==
"pointer")
149 if (name ==
"del" || name ==
"deleter")
151 if (name ==
"obj" || name ==
"object" || name ==
"$$dereference$$")
156bool LibStdcppUniquePtrSyntheticFrontEnd::GetSummary(
162 uint64_t ptr_value = m_ptr_obj->GetValueAsUnsigned(0, &success);
168 stream.
Printf(
"0x%" PRIx64, ptr_value);
175 return (valobj_sp ?
new LibStdcppUniquePtrSyntheticFrontEnd(valobj_sp)
181 LibStdcppUniquePtrSyntheticFrontEnd formatter(valobj.
GetSP());
182 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 lldb::ValueObjectSP GetChildAtIndex(uint32_t idx)=0
virtual lldb::ChildCacheState Update()=0
This function is assumed to always succeed and if it fails, the front-end should know to deal with it...
virtual bool MightHaveChildren()=0
virtual size_t GetIndexOfChildWithName(ConstString name)=0
virtual llvm::Expected< uint32_t > CalculateNumChildren()=0
lldb::ValueObjectSP GetSP()
A class that represents a running process on the host machine.
ChildCacheState
Specifies if children need to be re-computed after a call to SyntheticChildrenFrontEnd::Update.
@ eRefetch
Children need to be recomputed dynamically.
std::shared_ptr< lldb_private::ValueObject > ValueObjectSP