65 m_entry_sp->GetProcessSP()->GetAddressByteSize(),
73 2 *
m_entry_sp->GetProcessSP()->GetAddressByteSize(),
159 while (!left.
null()) {
187namespace formatters {
262 if (m_tree ==
nullptr)
265 ValueObjectSP size_node(m_tree->GetChildMemberWithName(
"__pair3_"));
274 m_count = size_node->GetValueAsUnsigned(0);
280 size_t idx,
size_t max_depth) {
283 size_t advance_by = idx;
287 auto cached_iterator = m_iterators.find(idx - 1);
288 if (cached_iterator != m_iterators.end()) {
289 iterator = cached_iterator->second;
299 if (!m_node_ptr_type.IsValid())
304 auto value_type_sp = iterated_sp->Cast(m_node_ptr_type);
309 value_type_sp = value_type_sp->GetChildMemberWithName(
"__value_");
313 m_iterators[idx] = iterator;
315 return value_type_sp;
323 uint32_t num_children = CalculateNumChildrenIgnoringErrors();
324 if (idx >= num_children)
327 if (m_tree ==
nullptr || m_root_node ==
nullptr)
330 ValueObjectSP key_val_sp = GetKeyValuePair(idx, num_children);
341 name.
Printf(
"[%" PRIu64
"]", (uint64_t)idx);
343 if (potential_child_sp) {
344 switch (potential_child_sp->GetNumChildrenIgnoringErrors()) {
346 auto child0_sp = potential_child_sp->GetChildAtIndex(0);
348 (child0_sp->GetName() == g_cc_ || child0_sp->GetName() == g_cc))
353 auto child0_sp = potential_child_sp->GetChildAtIndex(0);
354 auto child1_sp = potential_child_sp->GetChildAtIndex(1);
356 (child0_sp->GetName() == g_cc_ || child0_sp->GetName() == g_cc) &&
357 child1_sp && child1_sp->GetName() == g_nc)
363 return potential_child_sp;
369 m_tree = m_root_node =
nullptr;
371 m_tree = m_backend.GetChildMemberWithName(
"__tree_").get();
374 m_root_node = m_tree->GetChildMemberWithName(
"__begin_node_").get();
376 m_tree->GetCompilerType().GetDirectNestedTypeWithName(
"__node_pointer");
412 TargetSP target_sp(valobj_sp->GetTargetSP());
420 auto tree_iter_sp = valobj_sp->GetChildMemberWithName(
"__i_");
426 auto node_pointer_type =
427 tree_iter_sp->GetCompilerType().GetDirectNestedTypeWithName(
429 if (!node_pointer_type.IsValid())
433 auto iter_pointer_sp = tree_iter_sp->GetChildMemberWithName(
"__ptr_");
434 if (!iter_pointer_sp)
439 auto node_pointer_sp = iter_pointer_sp->Cast(node_pointer_type);
440 if (!node_pointer_sp)
443 auto key_value_sp = node_pointer_sp->GetChildMemberWithName(
"__value_");
454 key_value_sp = key_value_sp->Clone(
ConstString(
"pair"));
455 if (key_value_sp->GetNumChildrenIgnoringErrors() == 1) {
456 auto child0_sp = key_value_sp->GetChildAtIndex(0);
458 (child0_sp->GetName() ==
"__cc_" || child0_sp->GetName() ==
"__cc"))
459 key_value_sp = child0_sp->Clone(
ConstString(
"pair"));
462 m_pair_sp = key_value_sp;
478 return m_pair_sp->GetChildAtIndex(idx);
491 return m_pair_sp->GetIndexOfChildWithName(name);
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(ValueObject *entry, size_t depth=0)
void next()
Mimicks libc++'s __tree_next algorithm, which libc++ uses in its __tree_iteartor::operator++.
bool is_left_child(const MapEntry &x)
MapEntry tree_min(MapEntry x)
Mimicks libc++'s __tree_min algorithm.
Generic representation of a type in a programming language.
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.
@ eRefetch
Children need to be recomputed dynamically.
std::shared_ptr< lldb_private::ValueObject > ValueObjectSP
std::shared_ptr< lldb_private::Target > TargetSP