21#include "llvm/ADT/StringRef.h"
67 return m_num_elements;
73 if (scratch.consume_front(
"__") && std::isalnum(scratch[0])) {
74 scratch = scratch.drop_while([](
char c) {
return std::isalnum(c); });
75 if (scratch.consume_front(
"::")) {
85 if (name.consume_front(
"std::"))
87 return name.consume_front(type) && name.starts_with(
"<");
97 if (idx >= CalculateNumChildrenIgnoringErrors())
99 if (m_tree ==
nullptr)
102 while (idx >= m_elements_cache.size()) {
103 if (m_next_element ==
nullptr)
108 if (!node_sp ||
error.Fail())
111 ValueObjectSP value_sp = node_sp->GetChildMemberWithName(
"__value_");
112 ValueObjectSP hash_sp = node_sp->GetChildMemberWithName(
"__hash_");
113 if (!hash_sp || !value_sp) {
114 if (!m_element_type) {
115 auto p1_sp = m_backend.GetChildAtNamePath({
"__table_",
"__p1_"});
123 m_element_type = first_sp->GetCompilerType();
124 m_element_type = m_element_type.GetTypeTemplateArgument(0);
125 m_element_type = m_element_type.GetPointeeType();
126 m_node_type = m_element_type;
127 m_element_type = m_element_type.GetTypeTemplateArgument(0);
137 0, name,
nullptr,
nullptr,
nullptr);
140 m_element_type = actual_type;
145 node_sp = m_next_element->Cast(m_node_type.GetPointerType())
146 ->Dereference(
error);
147 if (!node_sp ||
error.Fail())
150 hash_sp = node_sp->GetChildMemberWithName(
"__hash_");
154 value_sp = node_sp->GetChildMemberWithName(
"__value_");
163 auto anon_union_sp = node_sp->GetChildAtIndex(2);
167 value_sp = anon_union_sp->GetChildMemberWithName(
"__value_");
172 m_elements_cache.push_back(
173 {value_sp.get(), hash_sp->GetValueAsUnsigned(0)});
174 m_next_element = node_sp->GetChildMemberWithName(
"__next_").get();
175 if (!m_next_element || m_next_element->GetValueAsUnsigned(0) == 0)
176 m_next_element =
nullptr;
179 std::pair<ValueObject *, uint64_t> val_hash = m_elements_cache[idx];
183 stream.
Printf(
"[%" PRIu64
"]", (uint64_t)idx);
186 val_hash.first->GetData(data,
error);
189 const bool thread_and_frame_only_if_stopped =
true;
191 thread_and_frame_only_if_stopped);
192 return CreateValueObjectFromData(stream.
GetString(), data, exe_ctx,
199 m_next_element =
nullptr;
200 m_elements_cache.clear();
201 ValueObjectSP table_sp = m_backend.GetChildMemberWithName(
"__table_");
205 ValueObjectSP p2_sp = table_sp->GetChildMemberWithName(
"__p2_");
210 if (!num_elements_sp)
213 ValueObjectSP p1_sp = table_sp->GetChildMemberWithName(
"__p1_");
221 m_tree = value_sp->GetChildMemberWithName(
"__next_").get();
222 if (m_tree ==
nullptr)
225 m_num_elements = num_elements_sp->GetValueAsUnsigned(0);
227 if (m_num_elements > 0)
228 m_next_element = m_tree;
static llvm::raw_ostream & error(Stream &strm)
static bool isStdTemplate(ConstString type_name, llvm::StringRef type)
static bool isUnorderedMap(ConstString type_name)
static void consumeInlineNamespace(llvm::StringRef &name)
Generic representation of a type in a programming language.
CompilerType GetFieldAtIndex(size_t idx, std::string &name, uint64_t *bit_offset_ptr, uint32_t *bitfield_bit_size_ptr, bool *is_bitfield_ptr) const
ConstString GetTypeName(bool BaseOnly=false) const
CompilerType GetTypedefedType() const
If the current object represents a typedef type, get the underlying type.
A uniqued constant string class.
llvm::StringRef GetStringRef() const
Get the string value as a llvm::StringRef.
const char * GetCString() const
Get the string value as a C string.
"lldb/Target/ExecutionContext.h" A class that contains an execution context.
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