30 :
m_entry_sp(entry ? entry->GetSP() : ValueObjectSP()) {}
32 ValueObjectSP
left()
const {
45 m_entry_sp->GetProcessSP()->GetAddressByteSize(),
54 2 *
m_entry_sp->GetProcessSP()->GetAddressByteSize(),
145 while (!left.
null()) {
173namespace formatters {
220 if (m_tree ==
nullptr)
222 ValueObjectSP m_item(m_tree->GetChildMemberWithName(g_pair3_,
true));
226 switch (m_item->GetCompilerType().GetNumDirectBaseClasses()) {
229 m_item = m_item->GetChildMemberWithName(g_first_,
true);
233 ValueObjectSP first_elem_parent = m_item->GetChildAtIndex(0,
true);
234 m_item = first_elem_parent->GetChildMemberWithName(g_value_,
true);
243 m_count = m_item->GetValueAsUnsigned(0);
252 if (m_element_type.IsValid())
254 m_element_type.Clear();
257 deref = m_root_node->Dereference(
error);
258 if (!deref ||
error.Fail())
260 deref = deref->GetChildMemberWithName(g_value_,
true);
262 m_element_type = deref->GetCompilerType();
265 deref = m_backend.GetChildAtNamePath({g_tree_, g_pair3});
268 m_element_type = deref->GetCompilerType()
269 .GetTypeTemplateArgument(1)
270 .GetTypeTemplateArgument(1);
271 if (m_element_type) {
273 uint64_t bit_offset_ptr;
275 bool is_bitfield_ptr;
276 m_element_type = m_element_type.GetFieldAtIndex(
277 0, name, &bit_offset_ptr, &bitfield_bit_size_ptr, &is_bitfield_ptr);
278 m_element_type = m_element_type.GetTypedefedType();
279 return m_element_type.IsValid();
281 m_element_type = m_backend.GetCompilerType().GetTypeTemplateArgument(0);
282 return m_element_type.IsValid();
287 const lldb::ValueObjectSP &node) {
296 m_skip_size = bit_offset / 8u;
301 CompilerType tree_node_type = ast_ctx->CreateStructForIdentifier(
307 {
"payload", (m_element_type.GetCompleteType(), m_element_type)}});
308 std::string child_name;
310 int32_t child_byte_offset = 0;
313 bool child_is_base_class;
314 bool child_is_deref_of_parent;
315 uint64_t language_flags;
317 .GetChildCompilerTypeAtIndex(
318 nullptr, 4,
true,
true,
true, child_name, child_byte_size,
319 child_byte_offset, child_bitfield_bit_size,
320 child_bitfield_bit_offset, child_is_base_class,
321 child_is_deref_of_parent,
nullptr, language_flags)
323 m_skip_size = (
uint32_t)child_byte_offset;
335 return lldb::ValueObjectSP();
336 if (m_tree ==
nullptr || m_root_node ==
nullptr)
337 return lldb::ValueObjectSP();
341 const bool need_to_skip = (idx > 0);
342 size_t actual_advancde = idx;
344 auto cached_iterator = m_iterators.find(idx - 1);
345 if (cached_iterator != m_iterators.end()) {
346 iterator = cached_iterator->second;
351 ValueObjectSP iterated_sp(iterator.
advance(actual_advancde));
361 iterated_sp = iterated_sp->Dereference(
error);
362 if (!iterated_sp ||
error.Fail()) {
364 return lldb::ValueObjectSP();
366 GetValueOffset(iterated_sp);
367 auto child_sp = iterated_sp->GetChildMemberWithName(g_value_,
true);
369 iterated_sp = child_sp;
371 iterated_sp = iterated_sp->GetSyntheticChildAtOffset(
372 m_skip_size, m_element_type,
true);
375 return lldb::ValueObjectSP();
384 return lldb::ValueObjectSP();
386 iterated_sp = iterated_sp->GetSyntheticChildAtOffset(
387 m_skip_size, m_element_type,
true);
390 return lldb::ValueObjectSP();
395 return lldb::ValueObjectSP();
401 name.
Printf(
"[%" PRIu64
"]", (uint64_t)idx);
403 if (potential_child_sp) {
404 switch (potential_child_sp->GetNumChildren()) {
406 auto child0_sp = potential_child_sp->GetChildAtIndex(0,
true);
408 (child0_sp->GetName() == g_cc_ || child0_sp->GetName() == g_cc))
413 auto child0_sp = potential_child_sp->GetChildAtIndex(0,
true);
414 auto child1_sp = potential_child_sp->GetChildAtIndex(1,
true);
416 (child0_sp->GetName() == g_cc_ || child0_sp->GetName() == g_cc) &&
417 child1_sp && child1_sp->GetName() == g_nc)
423 m_iterators[idx] = iterator;
424 return potential_child_sp;
431 m_tree = m_root_node =
nullptr;
433 m_tree = m_backend.GetChildMemberWithName(g_tree_,
true).get();
436 m_root_node = m_tree->GetChildMemberWithName(g_begin_node_,
true).get();
static llvm::raw_ostream & error(Stream &strm)
static size_t CalculateNumChildren(CompilerType container_type, CompilerType element_type, lldb_private::ExecutionContextScope *exe_scope=nullptr)
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.