ValueObjectChild.h revision 24943d2ee8bfaa7cf5893e4709143924157a5c1e
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#include "clang/AST/Type.h"
17// Project includes
18#include "lldb/Core/ValueObject.h"
19
20namespace lldb_private {
21
22//----------------------------------------------------------------------
23// A child of another ValueObject.
24//----------------------------------------------------------------------
25class ValueObjectChild : public ValueObject
26{
27public:
28    ValueObjectChild (ValueObject *parent,
29                      clang::ASTContext *clang_ast,
30                      void *clang_type,
31                      const ConstString &name,
32                      uint32_t byte_size,
33                      int32_t byte_offset,
34                      uint32_t bitfield_bit_size,
35                      uint32_t bitfield_bit_offset);
36
37
38    virtual ~ValueObjectChild();
39
40    virtual size_t
41    GetByteSize();
42
43    virtual off_t
44    GetByteOffset();
45
46    virtual uint32_t
47    GetBitfieldBitSize();
48
49    virtual uint32_t
50    GetBitfieldBitOffset();
51
52    virtual clang::ASTContext *
53    GetClangAST ();
54
55    virtual void *
56    GetOpaqueClangQualType ();
57
58    virtual lldb::ValueType
59    GetValueType() const;
60
61    virtual uint32_t
62    CalculateNumChildren();
63
64    virtual ConstString
65    GetTypeName();
66
67    virtual void
68    UpdateValue (ExecutionContextScope *exe_scope);
69
70    virtual bool
71    IsInScope (StackFrame *frame);
72
73protected:
74    ValueObject* m_parent;  // The parent value object of which this is a child of.
75    clang::ASTContext *m_clang_ast; // The clang AST that the clang type comes from
76    void *m_clang_type; // The type of the child in question within the parent (m_parent_sp)
77    ConstString m_type_name;
78    uint32_t m_byte_size;
79    int32_t m_byte_offset;
80    uint32_t m_bitfield_bit_size;
81    uint32_t m_bitfield_bit_offset;
82
83    uint32_t
84    GetByteOffset() const;
85//
86//  void
87//  ReadValueFromMemory (ValueObject* parent, lldb::addr_t address);
88
89private:
90    DISALLOW_COPY_AND_ASSIGN (ValueObjectChild);
91};
92
93} // namespace lldb_private
94
95#endif  // liblldb_ValueObjectChild_h_
96