89 if (!m_start || !m_finish)
91 uint64_t start_val = m_start->GetValueAsUnsigned(0);
92 uint64_t finish_val = m_finish->GetValueAsUnsigned(0);
94 if (start_val == 0 || finish_val == 0)
97 if (start_val >= finish_val)
100 size_t num_children = (finish_val - start_val);
101 if (num_children % m_element_size)
103 return num_children / m_element_size;
109 if (!m_start || !m_finish)
112 uint64_t offset = idx * m_element_size;
113 offset = offset + m_start->GetValueAsUnsigned(0);
115 name.
Printf(
"[%" PRIu64
"]", (uint64_t)idx);
116 return CreateValueObjectFromAddress(name.
GetString(), offset,
117 m_backend.GetExecutionContextRef(),
137 m_start = m_finish =
nullptr;
143 m_element_type = data_sp->GetCompilerType().GetPointeeType();
144 if (std::optional<uint64_t> size = m_element_type.GetByteSize(
nullptr)) {
145 m_element_size = *size;
147 if (m_element_size > 0) {
149 m_start = m_backend.GetChildMemberWithName(
"__begin_").get();
150 m_finish = m_backend.GetChildMemberWithName(
"__end_").get();
163 if (!m_start || !m_finish)
187 auto iter = m_children.find(idx), end = m_children.end();
192 if (m_base_data_address == 0 || m_count == 0)
196 size_t byte_idx = (idx >> 3);
197 size_t bit_index = (idx & 7);
198 lldb::addr_t byte_location = m_base_data_address + byte_idx;
199 ProcessSP process_sp(m_exe_ctx_ref.GetProcessSP());
205 size_t bytes_read = process_sp->ReadMemory(byte_location, &
byte, 1, err);
206 if (err.
Fail() || bytes_read == 0)
208 mask = 1 << bit_index;
209 bool bit_set = ((
byte & mask) != 0);
210 std::optional<uint64_t> size = m_bool_type.GetByteSize(
nullptr);
214 if (bit_set && buffer_sp && buffer_sp->GetBytes()) {
216 *(buffer_sp->GetBytes()) = 1;
219 name.
Printf(
"[%" PRIu64
"]", (uint64_t)idx);
223 process_sp->GetAddressByteSize()),
224 m_exe_ctx_ref, m_bool_type));
226 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())
static ValueObjectSP GetDataPointer(ValueObject &root)
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.
virtual lldb::ValueObjectSP GetChildMemberWithName(llvm::StringRef name, bool can_create=true)
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