1 //===-- ValueObjectChild.h --------------------------------------*- C++ -*-===// 2 // 3 // The LLVM Compiler Infrastructure 4 // 5 // This file is distributed under the University of Illinois Open Source 6 // License. See LICENSE.TXT for details. 7 // 8 //===----------------------------------------------------------------------===// 9 10 #ifndef liblldb_ValueObjectChild_h_ 11 #define liblldb_ValueObjectChild_h_ 12 13 // C Includes 14 // C++ Includes 15 // Other libraries and framework includes 16 // Project includes 17 #include "lldb/Core/ValueObject.h" 18 19 namespace lldb_private { 20 21 //---------------------------------------------------------------------- 22 // A child of another ValueObject. 23 //---------------------------------------------------------------------- 24 class ValueObjectChild : public ValueObject 25 { 26 public: 27 virtual ~ValueObjectChild(); 28 29 virtual uint64_t 30 GetByteSize() 31 { 32 return m_byte_size; 33 } 34 35 virtual off_t 36 GetByteOffset() 37 { 38 return m_byte_offset; 39 } 40 41 virtual uint32_t 42 GetBitfieldBitSize() 43 { 44 return m_bitfield_bit_size; 45 } 46 47 virtual uint32_t 48 GetBitfieldBitOffset() 49 { 50 return m_bitfield_bit_offset; 51 } 52 53 virtual lldb::ValueType 54 GetValueType() const; 55 56 virtual size_t 57 CalculateNumChildren(); 58 59 virtual ConstString 60 GetTypeName(); 61 62 virtual ConstString 63 GetQualifiedTypeName(); 64 65 virtual bool 66 IsInScope (); 67 68 virtual bool 69 IsBaseClass () 70 { 71 return m_is_base_class; 72 } 73 74 virtual bool 75 IsDereferenceOfParent () 76 { 77 return m_is_deref_of_parent; 78 } 79 80 protected: 81 virtual bool 82 UpdateValue (); 83 84 virtual ClangASTType 85 GetClangTypeImpl () 86 { 87 return m_clang_type; 88 } 89 90 ClangASTType m_clang_type; 91 ConstString m_type_name; 92 uint64_t m_byte_size; 93 int32_t m_byte_offset; 94 uint8_t m_bitfield_bit_size; 95 uint8_t m_bitfield_bit_offset; 96 bool m_is_base_class; 97 bool m_is_deref_of_parent; 98 99 // 100 // void 101 // ReadValueFromMemory (ValueObject* parent, lldb::addr_t address); 102 103 protected: 104 friend class ValueObject; 105 friend class ValueObjectConstResult; 106 ValueObjectChild (ValueObject &parent, 107 const ClangASTType &clang_type, 108 const ConstString &name, 109 uint64_t byte_size, 110 int32_t byte_offset, 111 uint32_t bitfield_bit_size, 112 uint32_t bitfield_bit_offset, 113 bool is_base_class, 114 bool is_deref_of_parent, 115 AddressType child_ptr_or_ref_addr_type); 116 117 DISALLOW_COPY_AND_ASSIGN (ValueObjectChild); 118 }; 119 120 } // namespace lldb_private 121 122 #endif // liblldb_ValueObjectChild_h_ 123