diff options
Diffstat (limited to 'include/lldb/Core/ValueObject.h')
-rw-r--r-- | include/lldb/Core/ValueObject.h | 88 |
1 files changed, 76 insertions, 12 deletions
diff --git a/include/lldb/Core/ValueObject.h b/include/lldb/Core/ValueObject.h index 6a08ec6507f99..fa96c89899136 100644 --- a/include/lldb/Core/ValueObject.h +++ b/include/lldb/Core/ValueObject.h @@ -14,9 +14,11 @@ // C++ Includes #include <map> #include <vector> + // Other libraries and framework includes -// Project includes +#include "llvm/ADT/SmallVector.h" +// Project includes #include "lldb/lldb-private.h" #include "lldb/Core/DataExtractor.h" #include "lldb/Core/Error.h" @@ -88,6 +90,7 @@ public: { eExpressionPathScanEndReasonEndOfString = 1, // out of data to parse eExpressionPathScanEndReasonNoSuchChild, // child element not found + eExpressionPathScanEndReasonNoSuchSyntheticChild, // (synthetic) child element not found eExpressionPathScanEndReasonEmptyRangeNotAllowed, // [] only allowed for arrays eExpressionPathScanEndReasonDotInsteadOfArrow, // . used when -> should be used eExpressionPathScanEndReasonArrowInsteadOfDot, // -> used when . should be used @@ -129,6 +132,7 @@ public: eClearUserVisibleDataItemsLocation = 1u << 3, eClearUserVisibleDataItemsDescription = 1u << 4, eClearUserVisibleDataItemsSyntheticChildren = 1u << 5, + eClearUserVisibleDataItemsValidator = 1u << 6, eClearUserVisibleDataItemsAllStrings = eClearUserVisibleDataItemsValue | eClearUserVisibleDataItemsSummary | eClearUserVisibleDataItemsLocation | eClearUserVisibleDataItemsDescription, eClearUserVisibleDataItemsAll = 0xFFFF }; @@ -268,12 +272,6 @@ public: m_mod_id = new_id; } - bool - IsFirstEvaluation () const - { - return m_first_update; - } - void SetNeedsUpdate () { @@ -322,7 +320,6 @@ public: ProcessModID m_mod_id; // This is the stop id when this ValueObject was last evaluated. ExecutionContextRef m_exe_ctx_ref; bool m_needs_update; - bool m_first_update; }; const EvaluationPoint & @@ -378,6 +375,9 @@ public: // this vends a TypeImpl that is useful at the SB API layer virtual TypeImpl GetTypeImpl (); + + virtual bool + CanProvideValue (); //------------------------------------------------------------------ // Subclasses must implement the functions below. @@ -607,6 +607,18 @@ public: GetSummaryAsCString (TypeSummaryImpl* summary_ptr, std::string& destination); + bool + GetSummaryAsCString (std::string& destination, + const TypeSummaryOptions& options); + + bool + GetSummaryAsCString (TypeSummaryImpl* summary_ptr, + std::string& destination, + const TypeSummaryOptions& options); + + std::pair<TypeValidatorResult, std::string> + GetValidationStatus (); + const char * GetObjectDescription (); @@ -700,6 +712,10 @@ public: virtual bool IsSynthetic() { return false; } + lldb::ValueObjectSP + GetQualifiedRepresentationIfAvailable (lldb::DynamicValueType dynValue, + bool synthValue); + virtual lldb::ValueObjectSP CreateConstantValue (const ConstString &name); @@ -752,6 +768,18 @@ public: return false; } + virtual bool + DoesProvideSyntheticValue () + { + return false; + } + + bool + IsSyntheticChildrenGenerated (); + + void + SetSyntheticChildrenGenerated (bool b); + virtual SymbolContextScope * GetSymbolContextScope(); @@ -768,11 +796,17 @@ public: const ExecutionContext& exe_ctx); static lldb::ValueObjectSP + CreateValueObjectFromExpression (const char* name, + const char* expression, + const ExecutionContext& exe_ctx, + const EvaluateExpressionOptions& options); + + static lldb::ValueObjectSP CreateValueObjectFromAddress (const char* name, uint64_t address, const ExecutionContext& exe_ctx, ClangASTType type); - + static lldb::ValueObjectSP CreateValueObjectFromData (const char* name, const DataExtractor& data, @@ -787,6 +821,9 @@ public: const DumpValueObjectOptions& options); + lldb::ValueObjectSP + Persist (); + // returns true if this is a char* or a char[] // if it is a char* and check_pointer is true, // it also checks that the pointer is valid @@ -794,7 +831,7 @@ public: IsCStringContainer (bool check_pointer = false); size_t - ReadPointedString (Stream& s, + ReadPointedString (lldb::DataBufferSP& buffer_sp, Error& error, uint32_t max_length = 0, bool honor_array = true, @@ -834,6 +871,10 @@ public: m_format = format; } + + virtual lldb::LanguageType + GetPreferredDisplayLanguage (); + lldb::TypeSummaryImplSP GetSummaryFormat() { @@ -848,6 +889,20 @@ public: ClearUserVisibleData(eClearUserVisibleDataItemsSummary); } + lldb::TypeValidatorImplSP + GetValidator() + { + UpdateFormatsIfNeeded(); + return m_type_validator_sp; + } + + void + SetValidator(lldb::TypeValidatorImplSP format) + { + m_type_validator_sp = format; + ClearUserVisibleData(eClearUserVisibleDataItemsValidator); + } + void SetValueFormat(lldb::TypeFormatImplSP format) { @@ -1018,7 +1073,9 @@ protected: std::string m_summary_str; // Cached summary string that will get cleared if/when the value is updated. std::string m_object_desc_str; // Cached result of the "object printer". This differs from the summary // in that the summary is consed up by us, the object_desc_string is builtin. - + + llvm::Optional<std::pair<TypeValidatorResult, std::string>> m_validation_result; + ClangASTType m_override_type;// If the type of the value object should be overridden, the type to impose. ValueObjectManager *m_manager; // This object is managed by the root object (any ValueObject that gets created @@ -1043,9 +1100,12 @@ protected: lldb::TypeSummaryImplSP m_type_summary_sp; lldb::TypeFormatImplSP m_type_format_sp; lldb::SyntheticChildrenSP m_synthetic_children_sp; + lldb::TypeValidatorImplSP m_type_validator_sp; ProcessModID m_user_id_of_forced_summary; AddressType m_address_type_of_ptr_or_ref_children; + llvm::SmallVector<uint8_t, 16> m_value_checksum; + bool m_value_is_valid:1, m_value_did_change:1, m_children_count_valid:1, @@ -1055,7 +1115,8 @@ protected: m_is_bitfield_for_scalar:1, m_is_child_at_offset:1, m_is_getting_summary:1, - m_did_calculate_complete_objc_class_type:1; + m_did_calculate_complete_objc_class_type:1, + m_is_synthetic_children_generated:1; friend class ClangExpressionDeclMap; // For GetValue friend class ClangExpressionVariable; // For SetName @@ -1150,6 +1211,9 @@ protected: GetLocationAsCStringImpl (const Value& value, const DataExtractor& data); + bool + IsChecksumEmpty (); + private: //------------------------------------------------------------------ // For ValueObject only |