21 stream.
Printf(
" Has Value=%s ",
37 GenericOptionalFrontend(
ValueObject &valobj, StdLib stdlib);
45 return m_has_value ? 1U : 0U;
52 bool m_has_value =
false;
58GenericOptionalFrontend::GenericOptionalFrontend(
ValueObject &valobj,
61 if (
auto target_sp = m_backend.GetTargetSP()) {
69 if (m_stdlib == StdLib::LibCxx)
70 engaged_sp = m_backend.GetChildMemberWithName(
"__engaged_");
71 else if (m_stdlib == StdLib::LibStdcpp)
72 engaged_sp = m_backend.GetChildMemberWithName(
"_M_payload")
73 ->GetChildMemberWithName(
"_M_engaged");
81 m_has_value = engaged_sp->GetValueAsUnsigned(0) != 0;
86ValueObjectSP GenericOptionalFrontend::GetChildAtIndex(uint32_t _idx) {
92 if (m_stdlib == StdLib::LibCxx)
97 val_sp = m_backend.GetChildMemberWithName(
"__engaged_")
100 ->GetChildMemberWithName(
"__val_");
101 else if (m_stdlib == StdLib::LibStdcpp) {
102 val_sp = m_backend.GetChildMemberWithName(
"_M_payload")
103 ->GetChildMemberWithName(
"_M_payload");
107 ValueObjectSP candidate = val_sp->GetChildMemberWithName(
"_M_value");
127 return new GenericOptionalFrontend(
128 *valobj_sp, GenericOptionalFrontend::StdLib::LibStdcpp);
135 return new GenericOptionalFrontend(*valobj_sp,
136 GenericOptionalFrontend::StdLib::LibCxx);
Generic representation of a type in a programming language.
A uniqued constant string class.
const char * GetCString() const
Get the string value as a C string.
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.
virtual lldb::ValueObjectSP GetChildAtIndex(uint32_t idx)=0
virtual lldb::ChildCacheState Update()=0
This function is assumed to always succeed and if it fails, the front-end should know to deal with it...
virtual bool MightHaveChildren()=0
virtual size_t GetIndexOfChildWithName(ConstString name)=0
virtual llvm::Expected< uint32_t > CalculateNumChildren()=0
uint32_t GetNumChildrenIgnoringErrors(uint32_t max=UINT32_MAX)
Like GetNumChildren but returns 0 on error.
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