12#include "llvm/Support/ErrorExtras.h"
22 MsvcStlExpectedFrontend(ValueObject &valobj)
23 : SyntheticChildrenFrontEnd(valobj) {
28 llvm::Expected<size_t> GetIndexOfChildWithName(ConstString name)
override {
30 return llvm::createStringErrorV(
"type has no child named '{0}'", name);
32 if (name ==
"Value" || name ==
"$$dereference$$")
34 }
else if (name ==
"Unexpected") {
37 return llvm::createStringErrorV(
"type has no child named '{0}'", name);
41 return m_active ? 1U : 0U;
45 if (!m_active || idx != 0)
47 return m_active->Clone(m_has_value ?
"Value" :
"Unexpected");
57 ValueObjectSP has_sp = ns->GetChildMemberWithName(
"_Has_value");
61 m_has_value = has_sp->GetValueAsUnsigned(0) != 0;
64 ns->GetChildMemberWithName(m_has_value ?
"_Value" :
"_Unexpected")
70 ValueObject *m_active =
nullptr;
71 bool m_has_value =
false;
77 return valobj_sp->GetChildMemberWithName(
"_Has_value") !=
nullptr;
87 ValueObjectSP has_sp = ns->GetChildMemberWithName(
"_Has_value");
91 stream.
Printf(
" Has Value=%s ",
92 has_sp->GetValueAsUnsigned(0) ?
"true" :
"false");
99 return new MsvcStlExpectedFrontend(*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 ...
A stream class that can stream formatted output to a file.
size_t Printf(const char *format,...) __attribute__((format(printf
Output printf formatted output to the stream.
lldb::TargetSP GetTargetSP() const
virtual lldb::ValueObjectSP GetNonSyntheticValue()
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