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)
108 return lldb::ValueObjectSP();
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(),
120 m_start = m_finish =
nullptr;
121 ValueObjectSP data_type_finder_sp(
122 m_backend.GetChildMemberWithName(
ConstString(
"__end_cap_"),
true));
123 if (!data_type_finder_sp)
126 switch (data_type_finder_sp->GetCompilerType().GetNumDirectBaseClasses()) {
129 data_type_finder_sp = data_type_finder_sp->GetChildMemberWithName(
134 ValueObjectSP first_elem_parent_sp =
135 data_type_finder_sp->GetChildAtIndex(0,
true);
136 data_type_finder_sp = first_elem_parent_sp->GetChildMemberWithName(
144 if (!data_type_finder_sp)
146 m_element_type = data_type_finder_sp->GetCompilerType().GetPointeeType();
147 if (std::optional<uint64_t> size = m_element_type.GetByteSize(
nullptr)) {
148 m_element_size = *size;
150 if (m_element_size > 0) {
153 m_backend.GetChildMemberWithName(
ConstString(
"__begin_"),
true).get();
155 m_backend.GetChildMemberWithName(
ConstString(
"__end_"),
true).get();
168 if (!m_start || !m_finish)
192 auto iter = m_children.find(idx), end = m_children.end();
197 if (m_base_data_address == 0 || m_count == 0)
201 size_t byte_idx = (idx >> 3);
202 size_t bit_index = (idx & 7);
203 lldb::addr_t byte_location = m_base_data_address + byte_idx;
204 ProcessSP process_sp(m_exe_ctx_ref.GetProcessSP());
210 size_t bytes_read = process_sp->ReadMemory(byte_location, &
byte, 1, err);
211 if (err.
Fail() || bytes_read == 0)
213 mask = 1 << bit_index;
214 bool bit_set = ((
byte & mask) != 0);
215 std::optional<uint64_t> size = m_bool_type.GetByteSize(
nullptr);
219 if (bit_set && buffer_sp && buffer_sp->GetBytes()) {
221 *(buffer_sp->GetBytes()) = 1;
224 name.
Printf(
"[%" PRIu64
"]", (uint64_t)idx);
225 ValueObjectSP retval_sp(CreateValueObjectFromData(
228 process_sp->GetAddressByteSize()),
229 m_exe_ctx_ref, m_bool_type));
231 m_children[idx] = retval_sp;
248 ValueObjectSP valobj_sp = m_backend.GetSP();
251 m_exe_ctx_ref = valobj_sp->GetExecutionContextRef();
252 ValueObjectSP size_sp(
253 valobj_sp->GetChildMemberWithName(
ConstString(
"__size_"),
true));
256 m_count = size_sp->GetValueAsUnsigned(0);
259 ValueObjectSP begin_sp(
260 valobj_sp->GetChildMemberWithName(
ConstString(
"__begin_"),
true));
265 m_base_data_address = begin_sp->GetValueAsUnsigned(0);
266 if (!m_base_data_address) {
275 if (!m_count || !m_base_data_address)
static size_t CalculateNumChildren(CompilerType container_type, CompilerType element_type, lldb_private::ExecutionContextScope *exe_scope=nullptr)
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.