35 llvm::Expected<size_t> GetIndexOfChildWithName(ConstString name)
override;
37 bool GetSummary(Stream &stream,
const TypeSummaryOptions &options);
45 ValueObject *m_ptr_obj =
nullptr;
46 ValueObject* m_del_obj =
nullptr;
53LibStdcppUniquePtrSyntheticFrontEnd::LibStdcppUniquePtrSyntheticFrontEnd(
59ValueObjectSP LibStdcppUniquePtrSyntheticFrontEnd::GetTuple() {
62 if (!valobj_backend_sp)
65 ValueObjectSP valobj_sp = valobj_backend_sp->GetNonSyntheticValue();
69 ValueObjectSP obj_child_sp = valobj_sp->GetChildMemberWithName(
"_M_t");
73 ValueObjectSP obj_subchild_sp = obj_child_sp->GetChildMemberWithName(
"_M_t");
77 if (obj_subchild_sp) {
78 return obj_subchild_sp;
90 std::unique_ptr<SyntheticChildrenFrontEnd> tuple_frontend(
95 m_ptr_obj = ptr_obj->
Clone(ConstString(
"pointer")).get();
103 if (llvm::expectedToOptional(tuple_sp->GetByteSize()).value_or(0) >
104 llvm::expectedToOptional(ptr_obj->GetByteSize()).value_or(0)) {
107 m_del_obj = del_obj->
Clone(ConstString(
"deleter")).get();
114LibStdcppUniquePtrSyntheticFrontEnd::GetChildAtIndex(uint32_t idx) {
115 if (idx == 0 && m_ptr_obj)
116 return m_ptr_obj->
GetSP();
117 if (idx == 1 && m_del_obj)
118 return m_del_obj->
GetSP();
131llvm::Expected<uint32_t>
132LibStdcppUniquePtrSyntheticFrontEnd::CalculateNumChildren() {
138llvm::Expected<size_t>
139LibStdcppUniquePtrSyntheticFrontEnd::GetIndexOfChildWithName(ConstString name) {
140 if (name ==
"ptr" || name ==
"pointer")
142 if (name ==
"del" || name ==
"deleter")
144 if (name ==
"obj" || name ==
"object" || name ==
"$$dereference$$")
146 return llvm::createStringError(
"Type has no child named '%s'",
150bool LibStdcppUniquePtrSyntheticFrontEnd::GetSummary(
151 Stream &stream,
const TypeSummaryOptions &options) {
160SyntheticChildrenFrontEnd *
163 return (valobj_sp ?
new LibStdcppUniquePtrSyntheticFrontEnd(valobj_sp)
169 LibStdcppUniquePtrSyntheticFrontEnd formatter(valobj.
GetSP());
170 return formatter.GetSummary(stream, options);
static std::optional< size_t > CalculateNumChildren(CompilerType container_elem_type, uint64_t num_elements, CompilerType element_type)
Calculates the number of elements stored in a container (with element type 'container_elem_type') as ...
const char * AsCString(const char *value_if_empty=nullptr) const
Get the string value as a C string.
bool Success() const
Test for success condition.
A stream class that can stream formatted output to a file.
lldb::ValueObjectSP GetSP()
virtual lldb::ValueObjectSP Clone(ConstString new_name)
Creates a copy of the ValueObject with a new name and setting the current ValueObject as its parent.
virtual lldb::ValueObjectSP Dereference(Status &error)
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