21#include "llvm/ADT/StringRef.h"
22#include "llvm/Support/Error.h"
134 auto table_sp =
m_backend.GetChildMemberWithName(
"__table_");
139 *table_sp, 1,
"__first_node_",
"__p1_");
140 if (is_compressed_pair)
146 return node_sp->GetCompilerType().GetTypeTemplateArgument(0).GetPointeeType();
162 if (!node_sp ||
error.Fail())
165 ValueObjectSP value_sp = node_sp->GetChildMemberWithName(
"__value_");
166 ValueObjectSP hash_sp = node_sp->GetChildMemberWithName(
"__hash_");
167 if (!hash_sp || !value_sp) {
169 ->Dereference(
error);
170 if (!node_sp ||
error.Fail())
173 hash_sp = node_sp->GetChildMemberWithName(
"__hash_");
177 value_sp = node_sp->GetChildMemberWithName(
"__value_");
186 auto anon_union_sp = node_sp->GetChildAtIndex(2);
190 value_sp = anon_union_sp->GetChildMemberWithName(
"__value_");
196 m_next_element = node_sp->GetChildMemberWithName(
"__next_").get();
205 stream.
Printf(
"[%" PRIu64
"]", (uint64_t)idx);
211 const bool thread_and_frame_only_if_stopped =
true;
218llvm::Expected<size_t>
222 table, 2,
"__size_",
"__p2_");
223 if (!is_compressed_pair && size_sp)
224 return size_sp->GetValueAsUnsigned(0);
226 if (!is_compressed_pair)
227 return llvm::createStringError(
"Unsupported std::unordered_map layout.");
231 if (!num_elements_sp)
232 return llvm::createStringError(
233 "Unexpected std::unordered_map layout: failed to retrieve first member "
234 "in old __compressed_pair layout.");
236 return num_elements_sp->GetValueAsUnsigned(0);
241 table, 1,
"__first_node_",
"__p1_");
242 if (is_compressed_pair)
248 return tree_sp->GetChildMemberWithName(
"__next_");
278 num_elems_or_err.takeError(),
"{0}");
288llvm::Expected<size_t>
293 return llvm::createStringError(
"Type has no child named '%s'",
296 return *optional_idx;
321 TargetSP target_sp(valobj_sp->GetTargetSP());
332 auto hash_iter_sp = valobj_sp->GetChildMemberWithName(
"__i_");
337 auto hash_iter_type = hash_iter_sp->GetCompilerType();
338 if (!hash_iter_type.IsValid())
342 auto node_pointer_type = hash_iter_type.GetTypeTemplateArgument(0);
343 if (!node_pointer_type.IsValid())
348 auto hash_node_sp = hash_iter_sp->Cast(node_pointer_type);
352 auto key_value_sp = hash_node_sp->GetChildMemberWithName(
"__value_");
361 auto anon_union_sp = hash_node_sp->GetChildAtIndex(2);
365 key_value_sp = anon_union_sp->GetChildMemberWithName(
"__value_");
377 auto potential_child_sp = key_value_sp->Clone(
ConstString(
"pair"));
378 if (potential_child_sp)
379 if (potential_child_sp->GetNumChildrenIgnoringErrors() == 1)
380 if (
auto child0_sp = potential_child_sp->GetChildAtIndex(0);
381 child0_sp->GetName() ==
"__cc_" || child0_sp->GetName() ==
"__cc")
382 potential_child_sp = child0_sp->Clone(
ConstString(
"pair"));
401llvm::Expected<size_t>
406 if (name ==
"second")
408 return llvm::createStringError(
"Type has no child named '%s'",
static llvm::raw_ostream & error(Stream &strm)
static ValueObjectSP GetTreePointer(ValueObject &table)
static bool isUnorderedMap(ConstString type_name)
#define LLDB_LOG_ERRORV(log, error,...)
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
CompilerType GetDirectNestedTypeWithName(llvm::StringRef name) const
ConstString GetTypeName(bool BaseOnly=false) const
CompilerType GetTypedefedType() const
If the current object represents a typedef type, get the underlying type.
CompilerType GetPointeeType() const
If this type is a pointer type, return the type that the pointer points to, else return an invalid ty...
CompilerType GetCanonicalType() const
bool IsPointerOrReferenceType(CompilerType *pointee_type=nullptr) const
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.
ExecutionContext Lock(bool thread_and_frame_only_if_stopped) const
Create an ExecutionContext object from this object.
"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.
uint32_t CalculateNumChildrenIgnoringErrors(uint32_t max=UINT32_MAX)
lldb::ValueObjectSP CreateValueObjectFromData(llvm::StringRef name, const DataExtractor &data, const ExecutionContext &exe_ctx, CompilerType type)
SyntheticChildrenFrontEnd(ValueObject &backend)
virtual uint64_t GetData(DataExtractor &data, Status &error)
const ExecutionContextRef & GetExecutionContextRef() const
A class that represents a running process on the host machine.
Log * GetLog(Cat mask)
Retrieve the Log object for the channel associated with the given log enum.
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