87 if (!m_start || !m_finish)
89 uint64_t start_val = m_start->GetValueAsUnsigned(0);
90 uint64_t finish_val = m_finish->GetValueAsUnsigned(0);
92 if (start_val == 0 || finish_val == 0)
95 if (start_val >= finish_val)
98 size_t num_children = (finish_val - start_val);
99 if (num_children % m_element_size)
101 return num_children / m_element_size;
107 if (!m_start || !m_finish)
110 uint64_t offset = idx * m_element_size;
111 offset = offset + m_start->GetValueAsUnsigned(0);
113 name.
Printf(
"[%" PRIu64
"]", (uint64_t)idx);
114 return CreateValueObjectFromAddress(name.
GetString(), offset,
115 m_backend.GetExecutionContextRef(),
121 m_start = m_finish =
nullptr;
123 m_backend.GetChildMemberWithName(
"__end_cap_"));
124 if (!data_type_finder_sp)
127 data_type_finder_sp =
129 if (!data_type_finder_sp)
132 m_element_type = data_type_finder_sp->GetCompilerType().GetPointeeType();
133 if (std::optional<uint64_t> size = m_element_type.GetByteSize(
nullptr)) {
134 m_element_size = *size;
136 if (m_element_size > 0) {
138 m_start = m_backend.GetChildMemberWithName(
"__begin_").get();
139 m_finish = m_backend.GetChildMemberWithName(
"__end_").get();
152 if (!m_start || !m_finish)
176 auto iter = m_children.find(idx), end = m_children.end();
181 if (m_base_data_address == 0 || m_count == 0)
185 size_t byte_idx = (idx >> 3);
186 size_t bit_index = (idx & 7);
187 lldb::addr_t byte_location = m_base_data_address + byte_idx;
188 ProcessSP process_sp(m_exe_ctx_ref.GetProcessSP());
194 size_t bytes_read = process_sp->ReadMemory(byte_location, &
byte, 1, err);
195 if (err.
Fail() || bytes_read == 0)
197 mask = 1 << bit_index;
198 bool bit_set = ((
byte & mask) != 0);
199 std::optional<uint64_t> size = m_bool_type.GetByteSize(
nullptr);
203 if (bit_set && buffer_sp && buffer_sp->GetBytes()) {
205 *(buffer_sp->GetBytes()) = 1;
208 name.
Printf(
"[%" PRIu64
"]", (uint64_t)idx);
212 process_sp->GetAddressByteSize()),
213 m_exe_ctx_ref, m_bool_type));
215 m_children[idx] = retval_sp;
236 m_exe_ctx_ref = valobj_sp->GetExecutionContextRef();
237 ValueObjectSP size_sp(valobj_sp->GetChildMemberWithName(
"__size_"));
240 m_count = size_sp->GetValueAsUnsigned(0);
243 ValueObjectSP begin_sp(valobj_sp->GetChildMemberWithName(
"__begin_"));
248 m_base_data_address = begin_sp->GetValueAsUnsigned(0);
249 if (!m_base_data_address) {
258 if (!m_count || !m_base_data_address)
262 if (idx < UINT32_MAX && idx >= CalculateNumChildrenIgnoringErrors())
Generic representation of a type in a programming language.
CompilerType GetTypeTemplateArgument(size_t idx, bool expand_pack=false) const
CompilerType GetBasicTypeFromAST(lldb::BasicType basic_type) const
Create related types using the current type's AST.
size_t GetNumTemplateArguments(bool expand_pack=false) const
Return the number of template arguments the type has.
ConstString GetTypeName(bool BaseOnly=false) const
A uniqued constant string class.
const char * GetCString() const
Get the string value as a C string.
A subclass of DataBuffer that stores a data buffer on the heap.
Execution context objects refer to objects in the execution of the program that is being debugged.
bool Fail() const
Test for error condition.
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.
@ eReuse
Children did not change and don't need to be recomputed; re-use what we computed the last time we cal...
std::shared_ptr< lldb_private::ValueObject > ValueObjectSP
std::shared_ptr< lldb_private::Process > ProcessSP
std::shared_ptr< lldb_private::WritableDataBuffer > WritableDataBufferSP