86 if (!m_start || !m_finish)
88 uint64_t start_val = m_start->GetValueAsUnsigned(0);
89 uint64_t finish_val = m_finish->GetValueAsUnsigned(0);
91 if (start_val == 0 || finish_val == 0)
94 if (start_val >= finish_val)
97 size_t num_children = (finish_val - start_val);
98 if (num_children % m_element_size_size_t)
100 return num_children / m_element_size_size_t;
109 uint64_t offset = idx * m_element_size_size_t;
110 offset = offset + m_start->GetValueAsUnsigned(0);
113 "", offset, m_backend.GetExecutionContextRef(), m_element_type_size_t);
117 const size_t value = indirect->GetValueAsUnsigned(0);
121 offset = value * m_element_size;
122 offset = offset + m_base->GetValueAsUnsigned(0);
125 name.
Printf(
"[%" PRIu64
"] -> [%zu]", (uint64_t)idx, value);
126 return CreateValueObjectFromAddress(name.
GetString(), offset,
127 m_backend.GetExecutionContextRef(),
139 return ChildCacheState::eRefetch;
142 if (std::optional<uint64_t> size = m_element_type.GetByteSize(
nullptr))
143 m_element_size = *size;
145 if (m_element_size == 0)
146 return ChildCacheState::eRefetch;
148 ValueObjectSP vector = m_backend.GetChildMemberWithName(
"__1d_");
150 return ChildCacheState::eRefetch;
152 type = vector->GetCompilerType();
154 return ChildCacheState::eRefetch;
157 if (std::optional<uint64_t> size = m_element_type_size_t.GetByteSize(
nullptr))
158 m_element_size_size_t = *size;
160 if (m_element_size_size_t == 0)
161 return ChildCacheState::eRefetch;
163 ValueObjectSP base = m_backend.GetChildMemberWithName(
"__vp_");
164 ValueObjectSP start = vector->GetChildMemberWithName(
"__begin_");
165 ValueObjectSP finish = vector->GetChildMemberWithName(
"__end_");
166 if (!base || !start || !finish)
167 return ChildCacheState::eRefetch;
170 m_start = start.get();
171 m_finish = finish.get();
173 return ChildCacheState::eRefetch;
184 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