19 TupleFrontEnd(ValueObject &valobj) : SyntheticChildrenFrontEnd(valobj) {
23 llvm::Expected<size_t> GetIndexOfChildWithName(ConstString name)
override {
26 return llvm::createStringError(
"Type has no child named '%s'",
34 return m_elements.size();
44 std::vector<ValueObject *> m_elements;
52 size_t n_elements = 0;
53 for (CompilerType ty = m_backend.GetCompilerType();
54 ty.GetNumDirectBaseClasses() > 0;
55 ty = ty.GetDirectBaseClassAtIndex(0,
nullptr))
58 m_elements.assign(n_elements,
nullptr);
63 if (idx >= m_elements.size())
66 return m_elements[idx]->GetSP();
68 CompilerType holder_ty = m_backend.GetCompilerType();
69 for (uint32_t i = 0; i < idx; i++) {
78 holder_sp = holder_sp->GetChildMemberWithName(
"_Myfirst");
83 ValueObjectSP val_sp = holder_sp->GetChildMemberWithName(
"_Val");
88 val_sp->Clone(ConstString(llvm::formatv(
"[{0}]", idx).str())).get();
89 return m_elements[idx]->GetSP();
96 return valobj_sp->GetChildMemberWithName(
"_Myfirst") !=
nullptr;
103 return new TupleFrontEnd(*valobj_sp);
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 ...
CompilerType GetDirectBaseClassAtIndex(size_t idx, uint32_t *bit_offset_ptr) const
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.
virtual lldb::ValueObjectSP GetNonSyntheticValue()
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