19#include "llvm/ADT/STLExtras.h"
45 bool Update()
override {
return false; }
49 lldb::SyntheticChildrenSP filter)
50 :
ValueObject(parent), m_synth_sp(std::move(filter)), m_children_byindex(),
51 m_name_toindex(), m_synthetic_children_cache(),
53 m_parent_type_name(parent.GetTypeName()),
94 "[ValueObjectSynthetic::CalculateNumChildren] for VO of name "
95 "%s and type %s, the filter returned %zu child values",
102 "[ValueObjectSynthetic::CalculateNumChildren] for VO of name "
103 "%s and type %s, the filter returned %zu child values",
112 return lldb::ValueObjectSP();
143 valobj_for_frontend = deref_sp.get();
170 "[ValueObjectSynthetic::UpdateValue] name=%s, type changed "
171 "from %s to %s, recomputing synthetic filter",
181 "[ValueObjectSynthetic::UpdateValue] name=%s, synthetic "
182 "filter said caches are stale - clearing",
203 "[ValueObjectSynthetic::UpdateValue] name=%s, synthetic "
204 "filter said caches are still valid",
212 if (synth_val && synth_val->CanProvideValue()) {
214 "[ValueObjectSynthetic::UpdateValue] name=%s, synthetic "
215 "filter said it can provide a value",
222 "[ValueObjectSynthetic::UpdateValue] name=%s, synthetic "
223 "filter said it will not provide a value",
241 "[ValueObjectSynthetic::GetChildAtIndex] name=%s, retrieving "
242 "child at index %zu",
248 bool child_is_cached;
254 valobj = cached_child_it->second;
257 if (!child_is_cached) {
260 "[ValueObjectSynthetic::GetChildAtIndex] name=%s, child at "
261 "index %zu not cached and will be created",
268 "[ValueObjectSynthetic::GetChildAtIndex] name=%s, child at index "
269 "%zu created as %p (is "
271 GetName().AsCString(), idx,
static_cast<void *
>(synth_guy.get()),
273 ? (synth_guy->IsSyntheticChildrenGenerated() ?
"yes" :
"no")
281 if (synth_guy->IsSyntheticChildrenGenerated())
285 synth_guy->SetPreferredDisplayLanguageIfNeeded(
290 "[ValueObjectSynthetic::GetChildAtIndex] name=%s, child at "
291 "index %zu not cached and cannot "
292 "be created (can_create = %s, synth_filter = %p)",
293 GetName().AsCString(), idx, can_create ?
"yes" :
"no",
296 return lldb::ValueObjectSP();
300 "[ValueObjectSynthetic::GetChildAtIndex] name=%s, child at "
301 "index %zu cached as %p",
302 GetName().AsCString(), idx,
static_cast<void *
>(valobj));
304 return valobj->
GetSP();
316 return lldb::ValueObjectSP();
331 found_index = name_to_index->second;
static llvm::raw_ostream & error(Stream &strm)
#define LLDB_LOGF(log,...)
size_t GetIndexOfChildWithName(ConstString name) override
bool MightHaveChildren() override
DummySyntheticFrontEnd(ValueObject &backend)
lldb::ValueObjectSP GetChildAtIndex(size_t idx) override
size_t CalculateNumChildren() override
Generic representation of a type in a programming language.
bool IsCompleteType() const
bool IsPointerOrReferenceType(CompilerType *pointee_type=nullptr) const
A uniqued constant string class.
const char * AsCString(const char *value_if_empty=nullptr) const
Get the string value as a C string.
const char * GetCString() const
Get the string value as a C string.
A class that describes the declaration location of a lldb object.
"lldb/Target/ExecutionContext.h" A class that contains an execution context.
void Clear()
Clear the object state.
bool Fail() const
Test for error condition.
virtual lldb::DynamicValueType GetDynamicValueType()
bool CanProvideValue() override
lldb::ValueObjectSP GetChildMemberWithName(ConstString name, bool can_create) override
bool SetValueFromCString(const char *value_str, Status &error) override
uint32_t m_synthetic_children_count
size_t CalculateNumChildren(uint32_t max) override
Should only be called by ValueObject::GetNumChildren().
bool UpdateValue() override
lldb::ValueType GetValueType() const override
LazyBool m_provides_value
bool IsSyntheticChildrenGenerated() override
lldb::LanguageType GetPreferredDisplayLanguage() override
ConstString GetTypeName() override
void SetFormat(lldb::Format format) override
void CopyValueData(ValueObject *source)
NameToIndexMap m_name_toindex
Guarded by m_child_mutex;.
lldb::ValueObjectSP GetChildAtIndex(size_t idx, bool can_create) override
ByIndexMap m_children_byindex
Guarded by m_child_mutex;.
std::unique_ptr< SyntheticChildrenFrontEnd > m_synth_filter_up
lldb::SyntheticChildrenSP m_synth_sp
lldb::ValueObjectSP GetDynamicValue(lldb::DynamicValueType valueType) override
void SetSyntheticChildrenGenerated(bool b) override
void SetPreferredDisplayLanguage(lldb::LanguageType)
ConstString GetDisplayTypeName() override
~ValueObjectSynthetic() override
lldb::ValueObjectSP GetNonSyntheticValue() override
SyntheticChildrenCache m_synthetic_children_cache
Guarded by m_child_mutex;.
std::optional< uint64_t > GetByteSize() override
ConstString m_parent_type_name
bool IsDynamic() override
bool GetDeclaration(Declaration &decl) override
bool MightHaveChildren() override
Find out if a ValueObject might have children.
virtual void CreateSynthFilter()
size_t GetIndexOfChildWithName(ConstString name) override
ConstString GetQualifiedTypeName() override
uint64_t GetLanguageFlags() override
LazyBool m_might_have_children
ValueObjectSynthetic(ValueObject &parent, lldb::SyntheticChildrenSP filter)
CompilerType GetCompilerTypeImpl() override
void SetLanguageFlags(uint64_t flags) override
bool IsInScope() override
void SetValueIsValid(bool valid)
virtual lldb::ValueObjectSP GetChildAtIndex(size_t idx, bool can_create)
void ClearUserVisibleData(uint32_t items=ValueObject::eClearUserVisibleDataItemsAllStrings)
size_t GetNumChildren(uint32_t max=UINT32_MAX)
CompilerType GetCompilerType()
void SetPreferredDisplayLanguage(lldb::LanguageType lt)
struct lldb_private::ValueObject::Bitflags m_flags
lldb::ValueObjectSP GetSP()
virtual void SetLanguageFlags(uint64_t flags)
Status m_error
An error object that can describe any errors that occur when updating values.
virtual uint64_t GetLanguageFlags()
virtual void SetSyntheticChildrenGenerated(bool b)
virtual std::optional< uint64_t > GetByteSize()=0
DataExtractor m_data
A data extractor that can be used to extract the value.
virtual size_t GetIndexOfChildWithName(ConstString name)
virtual lldb::ValueType GetValueType() const =0
virtual ConstString GetTypeName()
@ eClearUserVisibleDataItemsAll
virtual lldb::ModuleSP GetModule()
Return the module associated with this value object in case the value is from an executable file and ...
virtual lldb::ValueObjectSP GetDynamicValue(lldb::DynamicValueType valueType)
virtual ConstString GetDisplayTypeName()
lldb::LanguageType m_preferred_display_language
ValueObject * m_parent
The parent value object, or nullptr if this has no parent.
virtual bool GetDeclaration(Declaration &decl)
virtual bool IsSyntheticChildrenGenerated()
bool UpdateValueIfNeeded(bool update_format=true)
void SetName(ConstString name)
Change the name of the current ValueObject.
const Status & GetError()
virtual lldb::ValueObjectSP Dereference(Status &error)
ConstString GetName() const
virtual bool SetValueFromCString(const char *value_str, Status &error)
virtual ConstString GetQualifiedTypeName()
virtual void SetFormat(lldb::Format format)
const ExecutionContextRef & GetExecutionContextRef() const
virtual bool CanProvideValue()
const Value & GetValue() const
virtual lldb::LanguageType GetPreferredDisplayLanguage()
Status GetValueAsData(ExecutionContext *exe_ctx, DataExtractor &data, Module *module)
A class that represents a running process on the host machine.
Log * GetLog(Cat mask)
Retrieve the Log object for the channel associated with the given log enum.
Format
Display format definitions.
LanguageType
Programming language type.
@ eLanguageTypeUnknown
Unknown or invalid language value.
bool m_children_count_valid