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) {
71 llvm::StringRef name_str = child_sp->GetName().GetStringRef();
72 if (name_str.starts_with(
"std::_Tuple_impl<")) {
73 next_child_sp = child_sp;
74 }
else if (name_str.starts_with(
"std::_Head_base<")) {
76 child_sp->GetChildMemberWithName(
"_M_head_impl");
79 name.
Printf(
"[%zd]", m_members.size());
80 m_members.push_back(value_sp->Clone(ConstString(name.
GetString())).get());
90LibStdcppTupleSyntheticFrontEnd::GetChildAtIndex(uint32_t idx) {
91 if (idx < m_members.size() && m_members[idx])
92 return m_members[idx]->GetSP();
96llvm::Expected<uint32_t>
97LibStdcppTupleSyntheticFrontEnd::CalculateNumChildren() {
98 return m_members.size();
101llvm::Expected<size_t>
102LibStdcppTupleSyntheticFrontEnd::GetIndexOfChildWithName(ConstString name) {
105 return llvm::createStringError(
"Type has no child named '%s'",
108 return *optional_idx;
111SyntheticChildrenFrontEnd *
114 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