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