45 std::vector<ValueObject*> m_members;
50LibStdcppTupleSyntheticFrontEnd::LibStdcppTupleSyntheticFrontEnd(
60 if (!valobj_backend_sp)
63 ValueObjectSP next_child_sp = valobj_backend_sp->GetNonSyntheticValue();
64 while (next_child_sp !=
nullptr) {
66 next_child_sp =
nullptr;
68 size_t child_count = current_child->GetNumChildrenIgnoringErrors();
69 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());
89bool LibStdcppTupleSyntheticFrontEnd::MightHaveChildren() {
return true; }
92LibStdcppTupleSyntheticFrontEnd::GetChildAtIndex(uint32_t idx) {
93 if (idx < m_members.size() && m_members[idx])
94 return m_members[idx]->GetSP();
98llvm::Expected<uint32_t>
99LibStdcppTupleSyntheticFrontEnd::CalculateNumChildren() {
100 return m_members.size();
103size_t LibStdcppTupleSyntheticFrontEnd::GetIndexOfChildWithName(
111 return (valobj_sp ?
new LibStdcppTupleSyntheticFrontEnd(valobj_sp) :
nullptr);
A uniqued constant string class.
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.
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
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