45 m_entry_sp->GetProcessSP()->GetAddressByteSize(),
54 2 *
m_entry_sp->GetProcessSP()->GetAddressByteSize(),
145 while (!left.
null()) {
173namespace formatters {
216 if (m_tree ==
nullptr)
218 ValueObjectSP m_item(m_tree->GetChildMemberWithName(
"__pair3_"));
222 switch (m_item->GetCompilerType().GetNumDirectBaseClasses()) {
225 m_item = m_item->GetChildMemberWithName(
"__first_");
229 ValueObjectSP first_elem_parent = m_item->GetChildAtIndex(0);
230 m_item = first_elem_parent->GetChildMemberWithName(
"__value_");
239 m_count = m_item->GetValueAsUnsigned(0);
244 if (m_element_type.IsValid())
246 m_element_type.Clear();
249 deref = m_root_node->Dereference(
error);
250 if (!deref ||
error.Fail())
252 deref = deref->GetChildMemberWithName(
"__value_");
254 m_element_type = deref->GetCompilerType();
257 deref = m_backend.GetChildAtNamePath({
"__tree_",
"__pair3_"});
260 m_element_type = deref->GetCompilerType()
261 .GetTypeTemplateArgument(1)
262 .GetTypeTemplateArgument(1);
263 if (m_element_type) {
265 uint64_t bit_offset_ptr;
266 uint32_t bitfield_bit_size_ptr;
267 bool is_bitfield_ptr;
268 m_element_type = m_element_type.GetFieldAtIndex(
269 0, name, &bit_offset_ptr, &bitfield_bit_size_ptr, &is_bitfield_ptr);
270 m_element_type = m_element_type.GetTypedefedType();
271 return m_element_type.IsValid();
273 m_element_type = m_backend.GetCompilerType().GetTypeTemplateArgument(0);
274 return m_element_type.IsValid();
288 m_skip_size = bit_offset / 8u;
293 CompilerType tree_node_type = ast_ctx->CreateStructForIdentifier(
299 {
"payload", (m_element_type.GetCompleteType(), m_element_type)}});
300 std::string child_name;
301 uint32_t child_byte_size;
302 int32_t child_byte_offset = 0;
303 uint32_t child_bitfield_bit_size;
304 uint32_t child_bitfield_bit_offset;
305 bool child_is_base_class;
306 bool child_is_deref_of_parent;
307 uint64_t language_flags;
309 .GetChildCompilerTypeAtIndex(
310 nullptr, 4,
true,
true,
true, child_name, child_byte_size,
311 child_byte_offset, child_bitfield_bit_size,
312 child_bitfield_bit_offset, child_is_base_class,
313 child_is_deref_of_parent,
nullptr, language_flags)
315 m_skip_size = (uint32_t)child_byte_offset;
327 if (m_tree ==
nullptr || m_root_node ==
nullptr)
332 const bool need_to_skip = (idx > 0);
333 size_t actual_advancde = idx;
335 auto cached_iterator = m_iterators.find(idx - 1);
336 if (cached_iterator != m_iterators.end()) {
337 iterator = cached_iterator->second;
352 iterated_sp = iterated_sp->Dereference(
error);
353 if (!iterated_sp ||
error.Fail()) {
357 GetValueOffset(iterated_sp);
358 auto child_sp = iterated_sp->GetChildMemberWithName(
"__value_");
360 iterated_sp = child_sp;
362 iterated_sp = iterated_sp->GetSyntheticChildAtOffset(
363 m_skip_size, m_element_type,
true);
377 iterated_sp = iterated_sp->GetSyntheticChildAtOffset(
378 m_skip_size, m_element_type,
true);
392 name.
Printf(
"[%" PRIu64
"]", (uint64_t)idx);
394 if (potential_child_sp) {
395 switch (potential_child_sp->GetNumChildren()) {
397 auto child0_sp = potential_child_sp->GetChildAtIndex(0);
399 (child0_sp->GetName() == g_cc_ || child0_sp->GetName() == g_cc))
404 auto child0_sp = potential_child_sp->GetChildAtIndex(0);
405 auto child1_sp = potential_child_sp->GetChildAtIndex(1);
407 (child0_sp->GetName() == g_cc_ || child0_sp->GetName() == g_cc) &&
408 child1_sp && child1_sp->GetName() == g_nc)
414 m_iterators[idx] = iterator;
415 return potential_child_sp;
420 m_tree = m_root_node =
nullptr;
422 m_tree = m_backend.GetChildMemberWithName(
"__tree_").get();
425 m_root_node = m_tree->GetChildMemberWithName(
"__begin_node_").get();
static llvm::raw_ostream & error(Stream &strm)
static std::optional< size_t > CalculateNumChildren(CompilerType container_elem_type, uint64_t num_elements, CompilerType element_type)
Calculates the number of elements stored in a container (with element type 'container_elem_type') as ...
ValueObjectSP right() const
ValueObjectSP left() const
MapEntry(ValueObject *entry)
ValueObjectSP parent() const
void SetEntry(ValueObjectSP entry)
ValueObjectSP GetEntry() const
bool operator==(const MapEntry &rhs) const
MapEntry(ValueObjectSP entry_sp)
ValueObjectSP advance(size_t count)
MapIterator(ValueObjectSP entry, size_t depth=0)
MapIterator(ValueObject *entry, size_t depth=0)
MapIterator & operator=(const MapIterator &)=default
MapIterator(MapEntry entry, size_t depth=0)
MapIterator(const MapIterator &rhs)
bool is_left_child(const MapEntry &x)
MapEntry tree_min(MapEntry x)
std::shared_ptr< TypeSystemType > dyn_cast_or_null()
Return a shared_ptr<TypeSystemType> if dyn_cast succeeds.
Generic representation of a type in a programming language.
TypeSystemSPWrapper GetTypeSystem() const
Accessors.
uint32_t GetIndexOfFieldWithName(const char *name, CompilerType *field_compiler_type=nullptr, uint64_t *bit_offset_ptr=nullptr, uint32_t *bitfield_bit_size_ptr=nullptr, bool *is_bitfield_ptr=nullptr) const
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 TypeSystem implementation based on Clang.
A class that represents a running process on the host machine.
std::shared_ptr< lldb_private::ValueObject > ValueObjectSP