12#include "llvm/Support/ErrorExtras.h"
21 ContainerAdaptorFrontEnd(ValueObject &valobj)
22 : SyntheticChildrenFrontEnd(valobj) {
26 llvm::Expected<size_t> GetIndexOfChildWithName(ConstString name)
override {
28 return m_container_sp->GetIndexOfChildWithName(name);
29 return llvm::createStringErrorV(
"type has no child named '{0}'", name);
35 return m_container_sp ? m_container_sp->GetNumChildren() : 0;
39 return m_container_sp ? m_container_sp->GetChildAtIndex(idx) :
nullptr;
48 ValueObject *m_container_sp =
nullptr;
53 m_container_sp =
nullptr;
57 m_container_sp = c_sp->GetSyntheticValue().get();
64 return new ContainerAdaptorFrontEnd(*valobj_sp);
static std::optional< size_t > CalculateNumChildren(CompilerType container_elem_type, uint64_t num_elements, CompilerType element_type)
Calculates the number of elements stored in a container (with element type 'container_elem_type') as ...
virtual lldb::ValueObjectSP GetChildMemberWithName(llvm::StringRef name, bool can_create=true)
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