12#include "llvm/Support/ErrorExtras.h"
22 MsvcStlExpectedFrontend(ValueObject &valobj)
23 : SyntheticChildrenFrontEnd(valobj) {
28 llvm::Expected<size_t>
29 GetIndexOfChildWithName(llvm::StringRef name)
override {
31 return llvm::createStringErrorV(
"type has no child named '{0}'", name);
33 if (name ==
"Value" || name ==
"$$dereference$$")
35 }
else if (name ==
"Unexpected") {
38 return llvm::createStringErrorV(
"type has no child named '{0}'", name);
42 return m_active ? 1U : 0U;
46 if (!m_active || idx != 0)
48 return m_active->Clone(m_has_value ?
"Value" :
"Unexpected");
58 ValueObjectSP has_sp = ns->GetChildMemberWithName(
"_Has_value");
62 m_has_value = has_sp->GetValueAsUnsigned(0) != 0;
65 ns->GetChildMemberWithName(m_has_value ?
"_Value" :
"_Unexpected")
71 ValueObject *m_active =
nullptr;
72 bool m_has_value =
false;
78 return valobj_sp->GetChildMemberWithName(
"_Has_value") !=
nullptr;
88 ValueObjectSP has_sp = ns->GetChildMemberWithName(
"_Has_value");
92 stream.
Printf(
" Has Value=%s ",
93 has_sp->GetValueAsUnsigned(0) ?
"true" :
"false");
100 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