39 explicit MapEntry(ValueObject *entry)
53 2 *
m_entry_sp->GetProcessSP()->GetAddressByteSize(),
61 m_entry_sp->GetProcessSP()->GetAddressByteSize(),
65 uint64_t
value()
const {
74 auto isnil_sp =
m_entry_sp->GetChildMemberWithName(
"_Isnil");
77 return isnil_sp->GetValueAsUnsigned(1) != 0;
86 bool is_nullptr()
const {
return (
value() == 0); }
128 MapEntry right(
m_entry.right());
129 if (!right.is_nil()) {
134 MapEntry pnode(
m_entry.parent());
135 while (!pnode.is_nil() &&
136 m_entry.value() == MapEntry(pnode.right()).value()) {
143 pnode.SetEntry(
m_entry.parent());
151 if (pnode.is_nullptr())
153 MapEntry left(pnode.
left());
155 while (!left.is_nil()) {
232 return llvm::createStringError(
"There are no children.");
233 return m_inner_sp->GetIndexOfChildWithName(name);
252llvm::Expected<uint32_t>
260 if (
auto node_sp =
m_tree->GetChildMemberWithName(
"_Mysize")) {
261 m_count = node_sp->GetValueAsUnsigned(0);
265 return llvm::createStringError(
"Failed to read size.");
270 size_t idx,
size_t max_depth) {
273 size_t advance_by = idx;
279 iterator = cached_iterator->second;
289 ValueObjectSP value_sp = iterated_sp->GetChildMemberWithName(
"_Myval");
302 if (idx >= num_children)
319 name.
Printf(
"[%" PRIu64
"]", (uint64_t)idx);
329 m_backend.GetChildAtNamePath({
"_Mypair",
"_Myval2",
"_Myval2"}).get();
338llvm::Expected<size_t>
343 return llvm::createStringError(
"Type has no child named '%s'",
346 return *optional_idx;
351 auto node_sp =
m_backend.GetChildMemberWithName(
"_Ptr");
355 MapEntry entry(node_sp.get());
359 m_inner_sp = node_sp->GetChildMemberWithName(
"_Myval");
372 auto node_sp = valobj_sp->GetChildMemberWithName(
"_Ptr");
376 MapEntry entry(node_sp.get());
377 if (entry.is_nil()) {
382 auto value_sp = node_sp->GetChildMemberWithName(
"_Myval");
386 auto *summary = value_sp->GetSummaryAsCString();
ValueObjectSP right() const
ValueObjectSP left() const
ValueObjectSP parent() const
void SetEntry(ValueObjectSP entry)
ValueObjectSP GetEntry() const
bool operator==(const MapEntry &rhs) const
ValueObjectSP advance(size_t count)
void next()
Mimicks libc++'s __tree_next algorithm, which libc++ uses in its __tree_iteartor::operator++.
MapEntry tree_min(MapEntry x)
Mimicks libc++'s __tree_min algorithm.
A uniqued constant string class.
const char * AsCString(const char *value_if_empty=nullptr) const
Get the string value as a C string.
const char * GetCString() const
Get the string value as a C string.
llvm::StringRef GetString() const
A stream class that can stream formatted output to a file.
size_t Printf(const char *format,...) __attribute__((format(printf
Output printf formatted output to the stream.
uint32_t CalculateNumChildrenIgnoringErrors(uint32_t max=UINT32_MAX)
SyntheticChildrenFrontEnd(ValueObject &backend)
virtual lldb::ValueObjectSP GetChildMemberWithName(llvm::StringRef name, bool can_create=true)
virtual lldb::ValueObjectSP GetNonSyntheticValue()
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