9#ifndef LLDB_DATAFORMATTERS_TYPESYNTHETIC_H
10#define LLDB_DATAFORMATTERS_TYPESYNTHETIC_H
15#include <initializer_list>
47 return *count <= max ? *count : max;
84 typedef std::unique_ptr<SyntheticChildrenFrontEnd>
AutoPointer;
89 llvm::StringRef expression,
121 return llvm::createStringError(
"Type has no child named '%s'",
168 return (
m_flags & lldb::eTypeOptionCascade) == lldb::eTypeOptionCascade;
173 m_flags |= lldb::eTypeOptionCascade;
180 return (
m_flags & lldb::eTypeOptionSkipPointers) ==
181 lldb::eTypeOptionSkipPointers;
186 m_flags |= lldb::eTypeOptionSkipPointers;
193 return (
m_flags & lldb::eTypeOptionSkipReferences) ==
194 lldb::eTypeOptionSkipReferences;
199 m_flags |= lldb::eTypeOptionSkipReferences;
206 return (
m_flags & lldb::eTypeOptionNonCacheable) ==
207 lldb::eTypeOptionNonCacheable;
212 m_flags |= lldb::eTypeOptionNonCacheable;
219 return (
m_flags & lldb::eTypeOptionFrontEndWantsDereference) ==
220 lldb::eTypeOptionFrontEndWantsDereference;
225 m_flags |= lldb::eTypeOptionFrontEndWantsDereference;
298 const std::initializer_list<const char *> items)
300 for (
auto path : items)
336 return filter->GetCount();
340 if (idx >=
filter->GetCount())
342 return m_backend.GetSyntheticExpressionPathChild(
343 filter->GetExpressionPathAtIndex(idx),
true);
410 const char *pclass,
const char *pcode =
nullptr)
472 if (synth_ptr && ((
FrontEnd *)synth_ptr.get())->IsValid())
bool IsScripted() override
CXXSyntheticChildren(const CXXSyntheticChildren &)=delete
const CXXSyntheticChildren & operator=(const CXXSyntheticChildren &)=delete
CreateFrontEndCallback m_create_callback
virtual ~CXXSyntheticChildren()
std::string m_description
std::string GetDescription() override
SyntheticChildrenFrontEnd::AutoPointer GetFrontEnd(ValueObject &backend) override
CXXSyntheticChildren(const SyntheticChildren::Flags &flags, const char *description, CreateFrontEndCallback callback)
std::function< SyntheticChildrenFrontEnd *(CXXSyntheticChildren *, lldb::ValueObjectSP)> CreateFrontEndCallback
Generic representation of a type in a programming language.
A uniqued constant string class.
const char * AsCString(const char *value_if_empty=nullptr) const
Get the string value as a C string.
"lldb/Target/ExecutionContext.h" A class that contains an execution context.
lldb::ChildCacheState Update() override
This function is assumed to always succeed and if it fails, the front-end should know to deal with it...
std::string m_python_class
llvm::Expected< size_t > GetIndexOfChildWithName(ConstString name) override
lldb::ValueObjectSP GetChildAtIndex(uint32_t idx) override
ScriptInterpreter * m_interpreter
std::shared_ptr< SyntheticChildrenFrontEnd > SharedPointer
FrontEnd(std::string pclass, ValueObject &backend)
lldb::ValueObjectSP GetSyntheticValue() override
llvm::Expected< uint32_t > CalculateNumChildren() override
ConstString GetSyntheticTypeName() override
FrontEnd(const FrontEnd &)=delete
StructuredData::ObjectSP m_wrapper_sp
const FrontEnd & operator=(const FrontEnd &)=delete
bool MightHaveChildren() override
bool IsScripted() override
std::string GetDescription() override
SyntheticChildrenFrontEnd::AutoPointer GetFrontEnd(ValueObject &backend) override
std::string m_python_class
const char * GetPythonClassName()
void SetPythonClassName(const char *fname)
std::string m_python_code
ScriptedSyntheticChildren(const SyntheticChildren::Flags &flags, const char *pclass, const char *pcode=nullptr)
const ScriptedSyntheticChildren & operator=(const ScriptedSyntheticChildren &)=delete
void SetPythonCode(const char *script)
const char * GetPythonCode()
ScriptedSyntheticChildren(const ScriptedSyntheticChildren &)=delete
std::shared_ptr< Object > ObjectSP
uint32_t CalculateNumChildrenIgnoringErrors(uint32_t max=UINT32_MAX)
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...
lldb::ValueObjectSP CreateValueObjectFromExpression(llvm::StringRef name, llvm::StringRef expression, const ExecutionContext &exe_ctx)
virtual ~SyntheticChildrenFrontEnd()=default
virtual lldb::ValueObjectSP GetSyntheticValue()
virtual llvm::Expected< uint32_t > CalculateNumChildren(uint32_t max)
std::unique_ptr< SyntheticChildrenFrontEnd > AutoPointer
lldb::ValueObjectSP CreateValueObjectFromData(llvm::StringRef name, const DataExtractor &data, const ExecutionContext &exe_ctx, CompilerType type)
std::shared_ptr< SyntheticChildrenFrontEnd > SharedPointer
virtual llvm::Expected< uint32_t > CalculateNumChildren()=0
virtual ConstString GetSyntheticTypeName()
virtual bool MightHaveChildren()
SyntheticChildrenFrontEnd(const SyntheticChildrenFrontEnd &)=delete
virtual llvm::Expected< size_t > GetIndexOfChildWithName(ConstString name)=0
SyntheticChildrenFrontEnd(ValueObject &backend)
void SetValid(bool valid)
const SyntheticChildrenFrontEnd & operator=(const SyntheticChildrenFrontEnd &)=delete
lldb::ValueObjectSP CreateValueObjectFromAddress(llvm::StringRef name, uint64_t address, const ExecutionContext &exe_ctx, CompilerType type, bool do_deref=true)
Flags & SetSkipReferences(bool value=true)
Flags & SetFrontEndWantsDereference(bool value=true)
bool GetNonCacheable() const
bool GetSkipReferences() const
void SetValue(uint32_t value)
bool GetFrontEndWantsDereference() const
Flags & operator=(const uint32_t &rhs)
Flags(const Flags &other)
Flags & SetSkipPointers(bool value=true)
Flags & SetCascades(bool value=true)
bool GetSkipPointers() const
Flags & SetNonCacheable(bool value=true)
Flags & operator=(const Flags &rhs)
void SetSkipsPointers(bool value)
const SyntheticChildren & operator=(const SyntheticChildren &)=delete
virtual std::string GetDescription()=0
bool SkipsPointers() const
virtual SyntheticChildrenFrontEnd::AutoPointer GetFrontEnd(ValueObject &backend)=0
void SetCascades(bool value)
bool NonCacheable() const
void SetSkipsReferences(bool value)
void SetPtrMatchDepth(uint32_t value)
uint32_t m_ptr_match_depth
SyntheticChildren(const Flags &flags)
void SetOptions(uint32_t value)
bool WantsDereference() const
uint32_t GetPtrMatchDepth()
void SetNonCacheable(bool value)
SyntheticChildren(const SyntheticChildren &)=delete
bool SkipsReferences() const
std::shared_ptr< SyntheticChildren > SharedPointer
virtual ~SyntheticChildren()
virtual bool IsScripted()=0
llvm::Expected< size_t > GetIndexOfChildWithName(ConstString name) override
lldb::ValueObjectSP GetChildAtIndex(uint32_t idx) override
~SyntheticValueProviderFrontEnd() override=default
lldb::ChildCacheState Update() override
This function is assumed to always succeed and if it fails, the front-end should know to deal with it...
bool MightHaveChildren() override
SyntheticValueProviderFrontEnd(ValueObject &backend)
llvm::Expected< uint32_t > CalculateNumChildren() override
SyntheticValueProviderFrontEnd(const SyntheticValueProviderFrontEnd &)=delete
lldb::ValueObjectSP GetSyntheticValue() override=0
const SyntheticValueProviderFrontEnd & operator=(const SyntheticValueProviderFrontEnd &)=delete
lldb::ChildCacheState Update() override
This function is assumed to always succeed and if it fails, the front-end should know to deal with it...
FrontEnd(const FrontEnd &)=delete
~FrontEnd() override=default
llvm::Expected< size_t > GetIndexOfChildWithName(ConstString name) override
llvm::Expected< uint32_t > CalculateNumChildren() override
FrontEnd(TypeFilterImpl *flt, ValueObject &backend)
const FrontEnd & operator=(const FrontEnd &)=delete
bool MightHaveChildren() override
std::shared_ptr< SyntheticChildrenFrontEnd > SharedPointer
lldb::ValueObjectSP GetChildAtIndex(uint32_t idx) override
std::shared_ptr< TypeFilterImpl > SharedPointer
bool SetExpressionPathAtIndex(size_t i, const char *path)
const char * GetExpressionPathAtIndex(size_t i) const
TypeFilterImpl(const SyntheticChildren::Flags &flags, const std::initializer_list< const char * > items)
void AddExpressionPath(const char *path)
std::string GetDescription() override
bool IsScripted() override
SyntheticChildrenFrontEnd::AutoPointer GetFrontEnd(ValueObject &backend) override
TypeFilterImpl(const SyntheticChildren::Flags &flags)
std::vector< std::string > m_expression_paths
const TypeFilterImpl & operator=(const TypeFilterImpl &)=delete
TypeFilterImpl(const TypeFilterImpl &)=delete
lldb::ValueObjectSP GetSP()
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