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,
167 return (
m_flags & lldb::eTypeOptionCascade) == lldb::eTypeOptionCascade;
172 m_flags |= lldb::eTypeOptionCascade;
179 return (
m_flags & lldb::eTypeOptionSkipPointers) ==
180 lldb::eTypeOptionSkipPointers;
185 m_flags |= lldb::eTypeOptionSkipPointers;
192 return (
m_flags & lldb::eTypeOptionSkipReferences) ==
193 lldb::eTypeOptionSkipReferences;
198 m_flags |= lldb::eTypeOptionSkipReferences;
205 return (
m_flags & lldb::eTypeOptionNonCacheable) ==
206 lldb::eTypeOptionNonCacheable;
211 m_flags |= lldb::eTypeOptionNonCacheable;
218 return (
m_flags & lldb::eTypeOptionFrontEndWantsDereference) ==
219 lldb::eTypeOptionFrontEndWantsDereference;
224 m_flags |= lldb::eTypeOptionFrontEndWantsDereference;
292 const std::initializer_list<const char *> items)
294 for (
auto path : items)
404 const char *pclass,
const char *pcode =
nullptr)
466 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
std::function< SyntheticChildrenFrontEnd *(CXXSyntheticChildren *, lldb::ValueObjectSP)> CreateFrontEndCallback
Generic representation of a type in a programming language.
A uniqued constant string class.
"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
lldb::ValueObjectSP GetChildAtIndex(uint32_t idx) override
ScriptInterpreter * m_interpreter
std::shared_ptr< SyntheticChildrenFrontEnd > SharedPointer
lldb::ValueObjectSP GetSyntheticValue() override
size_t GetIndexOfChildWithName(ConstString name) 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 bool MightHaveChildren()=0
virtual llvm::Expected< uint32_t > CalculateNumChildren(uint32_t max)
virtual size_t GetIndexOfChildWithName(ConstString name)=0
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()
SyntheticChildrenFrontEnd(const SyntheticChildrenFrontEnd &)=delete
SyntheticChildrenFrontEnd(ValueObject &backend)
void SetValid(bool valid)
lldb::ValueObjectSP CreateValueObjectFromAddress(llvm::StringRef name, uint64_t address, const ExecutionContext &exe_ctx, CompilerType type)
const SyntheticChildrenFrontEnd & operator=(const SyntheticChildrenFrontEnd &)=delete
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 SetOptions(uint32_t value)
bool WantsDereference() const
void SetNonCacheable(bool value)
SyntheticChildren(const SyntheticChildren &)=delete
bool SkipsReferences() const
std::shared_ptr< SyntheticChildren > SharedPointer
virtual ~SyntheticChildren()
virtual bool IsScripted()=0
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...
size_t GetIndexOfChildWithName(ConstString name) override
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
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()
lldb::ValueObjectSP GetSyntheticExpressionPathChild(const char *expression, bool can_create)
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