65 m_entry_sp->GetProcessSP()->GetAddressByteSize(),
73 2 *
m_entry_sp->GetProcessSP()->GetAddressByteSize(),
159 while (!left.
null()) {
187namespace formatters {
259llvm::Expected<uint32_t>
262 ValueObjectSP node_sp(m_tree->GetChildMemberWithName(
"__pair3_"));
267 return llvm::createStringError(
"Unexpected std::map layout: expected "
268 "old __compressed_pair layout.");
275 m_count = node_sp->GetValueAsUnsigned(0);
285 if (m_tree ==
nullptr)
288 if (
auto node_sp = m_tree->GetChildMemberWithName(
"__size_")) {
289 m_count = node_sp->GetValueAsUnsigned(0);
293 return CalculateNumChildrenForOldCompressedPairLayout();
298 size_t idx,
size_t max_depth) {
301 size_t advance_by = idx;
305 auto cached_iterator = m_iterators.find(idx - 1);
306 if (cached_iterator != m_iterators.end()) {
307 iterator = cached_iterator->second;
317 if (!m_node_ptr_type.IsValid())
322 auto value_type_sp = iterated_sp->Cast(m_node_ptr_type);
327 value_type_sp = value_type_sp->GetChildMemberWithName(
"__value_");
331 m_iterators[idx] = iterator;
333 return value_type_sp;
341 uint32_t num_children = CalculateNumChildrenIgnoringErrors();
342 if (idx >= num_children)
345 if (m_tree ==
nullptr || m_root_node ==
nullptr)
348 ValueObjectSP key_val_sp = GetKeyValuePair(idx, num_children);
359 name.
Printf(
"[%" PRIu64
"]", (uint64_t)idx);
361 if (potential_child_sp) {
362 switch (potential_child_sp->GetNumChildrenIgnoringErrors()) {
364 auto child0_sp = potential_child_sp->GetChildAtIndex(0);
366 (child0_sp->GetName() == g_cc_ || child0_sp->GetName() == g_cc))
371 auto child0_sp = potential_child_sp->GetChildAtIndex(0);
372 auto child1_sp = potential_child_sp->GetChildAtIndex(1);
374 (child0_sp->GetName() == g_cc_ || child0_sp->GetName() == g_cc) &&
375 child1_sp && child1_sp->GetName() == g_nc)
381 return potential_child_sp;
387 m_tree = m_root_node =
nullptr;
389 m_tree = m_backend.GetChildMemberWithName(
"__tree_").get();
393 m_root_node = m_tree->GetChildMemberWithName(
"__begin_node_").get();
395 m_tree->GetCompilerType().GetDirectNestedTypeWithName(
"__node_pointer");
431 TargetSP target_sp(valobj_sp->GetTargetSP());
439 auto tree_iter_sp = valobj_sp->GetChildMemberWithName(
"__i_");
445 auto node_pointer_type =
446 tree_iter_sp->GetCompilerType().GetDirectNestedTypeWithName(
448 if (!node_pointer_type.IsValid())
452 auto iter_pointer_sp = tree_iter_sp->GetChildMemberWithName(
"__ptr_");
453 if (!iter_pointer_sp)
458 auto node_pointer_sp = iter_pointer_sp->Cast(node_pointer_type);
459 if (!node_pointer_sp)
462 auto key_value_sp = node_pointer_sp->GetChildMemberWithName(
"__value_");
473 key_value_sp = key_value_sp->Clone(
ConstString(
"pair"));
474 if (key_value_sp->GetNumChildrenIgnoringErrors() == 1) {
475 auto child0_sp = key_value_sp->GetChildAtIndex(0);
477 (child0_sp->GetName() ==
"__cc_" || child0_sp->GetName() ==
"__cc"))
478 key_value_sp = child0_sp->Clone(
ConstString(
"pair"));
481 m_pair_sp = key_value_sp;
497 return m_pair_sp->GetChildAtIndex(idx);
510 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