35 llvm::Expected<size_t> GetIndexOfChildWithName(ConstString name)
override;
43 std::vector<ValueObject*> m_members;
48LibStdcppTupleSyntheticFrontEnd::LibStdcppTupleSyntheticFrontEnd(
58 if (!valobj_backend_sp)
61 ValueObjectSP next_child_sp = valobj_backend_sp->GetNonSyntheticValue();
62 while (next_child_sp !=
nullptr) {
64 next_child_sp =
nullptr;
66 size_t child_count = current_child->GetNumChildrenIgnoringErrors();
67 for (
size_t i = 0; i < child_count; ++i) {
69 llvm::StringRef name_str = child_sp->GetName().GetStringRef();
70 if (name_str.starts_with(
"std::_Tuple_impl<")) {
71 next_child_sp = child_sp;
72 }
else if (name_str.starts_with(
"std::_Head_base<")) {
74 child_sp->GetChildMemberWithName(
"_M_head_impl");
77 name.
Printf(
"[%zd]", m_members.size());
78 m_members.push_back(value_sp->Clone(ConstString(name.
GetString())).get());
88LibStdcppTupleSyntheticFrontEnd::GetChildAtIndex(uint32_t idx) {
89 if (idx < m_members.size() && m_members[idx])
90 return m_members[idx]->GetSP();
94llvm::Expected<uint32_t>
95LibStdcppTupleSyntheticFrontEnd::CalculateNumChildren() {
96 return m_members.size();
100LibStdcppTupleSyntheticFrontEnd::GetIndexOfChildWithName(ConstString name) {
103 return llvm::createStringError(
"Type has no child named '%s'",
106 return *optional_idx;
109SyntheticChildrenFrontEnd *
112 return (valobj_sp ?
new LibStdcppTupleSyntheticFrontEnd(valobj_sp) :
nullptr);
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.
const char * GetCString() const
Get the string value as a C string.
llvm::StringRef GetString() const
size_t Printf(const char *format,...) __attribute__((format(printf
Output printf formatted output to the stream.
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