21 stream.
Printf(
" Has Value=%s ",
37 GenericOptionalFrontend(
ValueObject &valobj, StdLib stdlib);
40 if (name ==
"$$dereference$$")
47 return m_has_value ? 1U : 0U;
54 bool m_has_value =
false;
60GenericOptionalFrontend::GenericOptionalFrontend(
ValueObject &valobj,
63 if (
auto target_sp = m_backend.GetTargetSP()) {
71 if (m_stdlib == StdLib::LibCxx)
72 engaged_sp = m_backend.GetChildMemberWithName(
"__engaged_");
73 else if (m_stdlib == StdLib::LibStdcpp)
74 engaged_sp = m_backend.GetChildMemberWithName(
"_M_payload")
75 ->GetChildMemberWithName(
"_M_engaged");
83 m_has_value = engaged_sp->GetValueAsUnsigned(0) != 0;
88ValueObjectSP GenericOptionalFrontend::GetChildAtIndex(uint32_t _idx) {
94 if (m_stdlib == StdLib::LibCxx)
99 val_sp = m_backend.GetChildMemberWithName(
"__engaged_")
102 ->GetChildMemberWithName(
"__val_");
103 else if (m_stdlib == StdLib::LibStdcpp) {
104 val_sp = m_backend.GetChildMemberWithName(
"_M_payload")
105 ->GetChildMemberWithName(
"_M_payload");
109 ValueObjectSP candidate = val_sp->GetChildMemberWithName(
"_M_value");
129 return new GenericOptionalFrontend(
130 *valobj_sp, GenericOptionalFrontend::StdLib::LibStdcpp);
137 return new GenericOptionalFrontend(*valobj_sp,
138 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