68 if (!m_start || !m_finish)
70 uint64_t start_val = m_start->GetValueAsUnsigned(0);
71 uint64_t finish_val = m_finish->GetValueAsUnsigned(0);
73 if (start_val == 0 || finish_val == 0)
76 if (start_val >= finish_val)
79 size_t num_children = (finish_val - start_val);
80 if (num_children % m_element_size)
82 return num_children / m_element_size;
88 if (!m_start || !m_finish)
91 uint64_t offset = idx * m_element_size;
92 offset = offset + m_start->GetValueAsUnsigned(0);
94 name.
Printf(
"[%" PRIu64
"]", (uint64_t)idx);
95 return CreateValueObjectFromAddress(name.
GetString(), offset,
96 m_backend.GetExecutionContextRef(),
102 m_start = m_finish =
nullptr;
106 return ChildCacheState::eRefetch;
109 if (std::optional<uint64_t> size = m_element_type.GetByteSize(
nullptr))
110 m_element_size = *size;
112 if (m_element_size == 0)
113 return ChildCacheState::eRefetch;
115 ValueObjectSP start = m_backend.GetChildMemberWithName(
"__begin_");
116 ValueObjectSP finish = m_backend.GetChildMemberWithName(
"__end_");
118 if (!start || !finish)
119 return ChildCacheState::eRefetch;
121 m_start = start.get();
122 m_finish = finish.get();
124 return ChildCacheState::eRefetch;
134 if (!m_start || !m_finish)
135 return std::numeric_limits<size_t>::max();
Generic representation of a type in a programming language.
CompilerType GetTypeTemplateArgument(size_t idx, bool expand_pack=false) const
size_t GetNumTemplateArguments(bool expand_pack=false) const
Return the number of template arguments the type has.
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.
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.
std::shared_ptr< lldb_private::ValueObject > ValueObjectSP