diff options
Diffstat (limited to 'include/lldb/Core/ValueObject.h')
-rw-r--r-- | include/lldb/Core/ValueObject.h | 64 |
1 files changed, 13 insertions, 51 deletions
diff --git a/include/lldb/Core/ValueObject.h b/include/lldb/Core/ValueObject.h index cb6de7b41807..0808b86c67a1 100644 --- a/include/lldb/Core/ValueObject.h +++ b/include/lldb/Core/ValueObject.h @@ -1,9 +1,8 @@ //===-- ValueObject.h -------------------------------------------*- C++ -*-===// // -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// @@ -40,40 +39,19 @@ #include <stddef.h> #include <stdint.h> + namespace lldb_private { class Declaration; -} -namespace lldb_private { class DumpValueObjectOptions; -} -namespace lldb_private { class EvaluateExpressionOptions; -} -namespace lldb_private { class ExecutionContextScope; -} -namespace lldb_private { class Log; -} -namespace lldb_private { class Scalar; -} -namespace lldb_private { class Stream; -} -namespace lldb_private { class SymbolContextScope; -} -namespace lldb_private { class TypeFormatImpl; -} -namespace lldb_private { class TypeSummaryImpl; -} -namespace lldb_private { class TypeSummaryOptions; -} -namespace lldb_private { /// ValueObject: /// @@ -380,16 +358,12 @@ public: virtual bool CanProvideValue(); - //------------------------------------------------------------------ // Subclasses must implement the functions below. - //------------------------------------------------------------------ virtual uint64_t GetByteSize() = 0; virtual lldb::ValueType GetValueType() const = 0; - //------------------------------------------------------------------ // Subclasses can implement the functions below. - //------------------------------------------------------------------ virtual ConstString GetTypeName(); virtual ConstString GetDisplayTypeName(); @@ -479,12 +453,10 @@ public: virtual bool GetDeclaration(Declaration &decl); - //------------------------------------------------------------------ // The functions below should NOT be modified by subclasses - //------------------------------------------------------------------ const Status &GetError(); - const ConstString &GetName() const; + ConstString GetName() const; virtual lldb::ValueObjectSP GetChildAtIndex(size_t idx, bool can_create); @@ -504,10 +476,10 @@ public: GetChildAtNamePath(llvm::ArrayRef<std::pair<ConstString, bool>> names, ConstString *name_of_error = nullptr); - virtual lldb::ValueObjectSP GetChildMemberWithName(const ConstString &name, + virtual lldb::ValueObjectSP GetChildMemberWithName(ConstString name, bool can_create); - virtual size_t GetIndexOfChildWithName(const ConstString &name); + virtual size_t GetIndexOfChildWithName(ConstString name); size_t GetNumChildren(uint32_t max = UINT32_MAX); @@ -574,14 +546,14 @@ public: // Change the name of the current ValueObject. Should *not* be used from a // synthetic child provider as it would change the name of the non synthetic // child as well. - void SetName(const ConstString &name); + void SetName(ConstString name); virtual lldb::addr_t GetAddressOf(bool scalar_is_load_address = true, AddressType *address_type = nullptr); lldb::addr_t GetPointerValue(AddressType *address_type = nullptr); - lldb::ValueObjectSP GetSyntheticChild(const ConstString &key) const; + lldb::ValueObjectSP GetSyntheticChild(ConstString key) const; lldb::ValueObjectSP GetSyntheticArrayMember(size_t index, bool can_create); @@ -618,7 +590,7 @@ public: GetQualifiedRepresentationIfAvailable(lldb::DynamicValueType dynValue, bool synthValue); - virtual lldb::ValueObjectSP CreateConstantValue(const ConstString &name); + virtual lldb::ValueObjectSP CreateConstantValue(ConstString name); virtual lldb::ValueObjectSP Dereference(Status &error); @@ -626,7 +598,7 @@ public: // ValueObject as its parent. It should be used when we want to change the // name of a ValueObject without modifying the actual ValueObject itself // (e.g. sythetic child provider). - virtual lldb::ValueObjectSP Clone(const ConstString &new_name); + virtual lldb::ValueObjectSP Clone(ConstString new_name); virtual lldb::ValueObjectSP AddressOf(Status &error); @@ -789,7 +761,6 @@ public: void SetHasCompleteType() { m_did_calculate_complete_objc_class_type = true; } - //------------------------------------------------------------------ /// Find out if a ValueObject might have children. /// /// This call is much more efficient than CalculateNumChildren() as @@ -801,10 +772,9 @@ public: /// pointers, references, arrays and more. Again, it does so without /// doing any expensive type completion. /// - /// @return + /// \return /// Returns \b true if the ValueObject might have children, or \b /// false otherwise. - //------------------------------------------------------------------ virtual bool MightHaveChildren(); virtual lldb::VariableSP GetVariable() { return nullptr; } @@ -859,9 +829,7 @@ protected: size_t m_children_count; }; - //------------------------------------------------------------------ // Classes that inherit from ValueObject can see and modify these - //------------------------------------------------------------------ ValueObject *m_parent; // The parent value object, or nullptr if this has no parent ValueObject *m_root; // The root of the hierarchy for this ValueObject (or @@ -944,9 +912,7 @@ protected: friend class ValueObjectConstResultImpl; friend class ValueObjectSynthetic; // For ClearUserVisibleData - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ // Use the no-argument constructor to make a constant variable object (with // no ExecutionContextScope.) @@ -1000,15 +966,13 @@ protected: void ClearUserVisibleData( uint32_t items = ValueObject::eClearUserVisibleDataItemsAllStrings); - void AddSyntheticChild(const ConstString &key, ValueObject *valobj); + void AddSyntheticChild(ConstString key, ValueObject *valobj); DataExtractor &GetDataExtractor(); void ClearDynamicTypeInformation(); - //------------------------------------------------------------------ // Subclasses must implement the functions below. - //------------------------------------------------------------------ virtual CompilerType GetCompilerTypeImpl() = 0; @@ -1032,14 +996,12 @@ private: DISALLOW_COPY_AND_ASSIGN(ValueObject); }; -//------------------------------------------------------------------------------ // A value object manager class that is seeded with the static variable value // and it vends the user facing value object. If the type is dynamic it can // vend the dynamic type. If this user type also has a synthetic type // associated with it, it will vend the synthetic type. The class watches the // process' stop // ID and will update the user type when needed. -//------------------------------------------------------------------------------ class ValueObjectManager { // The root value object is the static typed variable object. lldb::ValueObjectSP m_root_valobj_sp; |