12#include "llvm/Support/ErrorExtras.h"
36 explicit GenericErrorCodeFrontend(ValueObject &valobj)
37 : SyntheticChildrenFrontEnd(valobj) {
41 llvm::Expected<size_t> GetIndexOfChildWithName(ConstString name)
override {
42 if (name ==
"Category" && m_category)
44 return llvm::createStringErrorV(
"type has no child named '{0}'", name);
48 return m_category ? 1U : 0U;
52 if (idx != 0 || !m_category)
54 return m_category->Clone(ConstString(
"Category"));
58 m_category = GetCategory(m_backend).get();
65 ValueObject *m_category =
nullptr;
80 const char *value = value_sp->GetValueAsCString();
84 stream.
Printf(
"value=%s", value);
93 return new GenericErrorCodeFrontend(*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.
virtual lldb::ValueObjectSP GetChildMemberWithName(llvm::StringRef name, bool can_create=true)
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