45 m_entry_sp->GetProcessSP()->GetAddressByteSize(),
54 2 *
m_entry_sp->GetProcessSP()->GetAddressByteSize(),
145 while (!left.
null()) {
173namespace formatters {
217 if (m_tree ==
nullptr)
220 ValueObjectSP size_node(m_tree->GetChildMemberWithName(
"__pair3_"));
229 m_count = size_node->GetValueAsUnsigned(0);
234 if (m_element_type.IsValid())
236 m_element_type.Clear();
239 deref = m_root_node->Dereference(
error);
240 if (!deref ||
error.Fail())
242 deref = deref->GetChildMemberWithName(
"__value_");
244 m_element_type = deref->GetCompilerType();
247 deref = m_backend.GetChildAtNamePath({
"__tree_",
"__pair3_"});
250 m_element_type = deref->GetCompilerType()
251 .GetTypeTemplateArgument(1)
252 .GetTypeTemplateArgument(1);
253 if (m_element_type) {
255 uint64_t bit_offset_ptr;
256 uint32_t bitfield_bit_size_ptr;
257 bool is_bitfield_ptr;
258 m_element_type = m_element_type.GetFieldAtIndex(
259 0, name, &bit_offset_ptr, &bitfield_bit_size_ptr, &is_bitfield_ptr);
260 m_element_type = m_element_type.GetTypedefedType();
261 return m_element_type.IsValid();
263 m_element_type = m_backend.GetCompilerType().GetTypeTemplateArgument(0);
264 return m_element_type.IsValid();
278 m_skip_size = bit_offset / 8u;
283 CompilerType tree_node_type = ast_ctx->CreateStructForIdentifier(
289 {
"payload", (m_element_type.GetCompleteType(), m_element_type)}});
290 std::string child_name;
291 uint32_t child_byte_size;
292 int32_t child_byte_offset = 0;
293 uint32_t child_bitfield_bit_size;
294 uint32_t child_bitfield_bit_offset;
295 bool child_is_base_class;
296 bool child_is_deref_of_parent;
297 uint64_t language_flags;
299 .GetChildCompilerTypeAtIndex(
300 nullptr, 4,
true,
true,
true, child_name, child_byte_size,
301 child_byte_offset, child_bitfield_bit_size,
302 child_bitfield_bit_offset, child_is_base_class,
303 child_is_deref_of_parent,
nullptr, language_flags)
305 m_skip_size = (uint32_t)child_byte_offset;
314 uint32_t num_children = CalculateNumChildrenIgnoringErrors();
315 if (idx >= num_children)
317 if (m_tree ==
nullptr || m_root_node ==
nullptr)
322 const bool need_to_skip = (idx > 0);
323 size_t actual_advancde = idx;
325 auto cached_iterator = m_iterators.find(idx - 1);
326 if (cached_iterator != m_iterators.end()) {
327 iterator = cached_iterator->second;
342 iterated_sp = iterated_sp->Dereference(
error);
343 if (!iterated_sp ||
error.Fail()) {
347 GetValueOffset(iterated_sp);
348 auto child_sp = iterated_sp->GetChildMemberWithName(
"__value_");
350 iterated_sp = child_sp;
352 iterated_sp = iterated_sp->GetSyntheticChildAtOffset(
353 m_skip_size, m_element_type,
true);
367 iterated_sp = iterated_sp->GetSyntheticChildAtOffset(
368 m_skip_size, m_element_type,
true);
382 name.
Printf(
"[%" PRIu64
"]", (uint64_t)idx);
384 if (potential_child_sp) {
385 switch (potential_child_sp->GetNumChildrenIgnoringErrors()) {
387 auto child0_sp = potential_child_sp->GetChildAtIndex(0);
389 (child0_sp->GetName() == g_cc_ || child0_sp->GetName() == g_cc))
394 auto child0_sp = potential_child_sp->GetChildAtIndex(0);
395 auto child1_sp = potential_child_sp->GetChildAtIndex(1);
397 (child0_sp->GetName() == g_cc_ || child0_sp->GetName() == g_cc) &&
398 child1_sp && child1_sp->GetName() == g_nc)
404 m_iterators[idx] = iterator;
405 return potential_child_sp;
411 m_tree = m_root_node =
nullptr;
413 m_tree = m_backend.GetChildMemberWithName(
"__tree_").get();
416 m_root_node = m_tree->GetChildMemberWithName(
"__begin_node_").get();
static llvm::raw_ostream & error(Stream &strm)
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.
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