ValueObjectMemory.h revision 36da2aa6dc5ad9994b638ed09eb81c44cc05540b
1//===-- ValueObjectMemory.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_ValueObjectMemory_h_
11#define liblldb_ValueObjectMemory_h_
12
13// C Includes
14// C++ Includes
15// Other libraries and framework includes
16// Project includes
17#include "lldb/Core/ValueObject.h"
18#include "lldb/Symbol/ClangASTType.h"
19
20namespace lldb_private {
21
22//----------------------------------------------------------------------
23// A ValueObject that represents memory at a given address, viewed as some
24// set lldb type.
25//----------------------------------------------------------------------
26class ValueObjectMemory : public ValueObject
27{
28public:
29    static lldb::ValueObjectSP
30    Create (ExecutionContextScope *exe_scope,
31            const char *name,
32            const Address &address,
33            lldb::TypeSP &type_sp);
34
35    static lldb::ValueObjectSP
36    Create (ExecutionContextScope *exe_scope,
37            const char *name,
38            const Address &address,
39            const ClangASTType &ast_type);
40
41    virtual
42    ~ValueObjectMemory();
43
44    virtual size_t
45    GetByteSize();
46
47    virtual ConstString
48    GetTypeName();
49
50    virtual size_t
51    CalculateNumChildren();
52
53    virtual lldb::ValueType
54    GetValueType() const;
55
56    virtual bool
57    IsInScope ();
58
59    virtual lldb::ModuleSP
60    GetModule();
61
62protected:
63    virtual bool
64    UpdateValue ();
65
66    virtual clang::ASTContext *
67    GetClangASTImpl ();
68
69    virtual lldb::clang_type_t
70    GetClangTypeImpl ();
71
72    Address  m_address;  ///< The variable that this value object is based upon
73    lldb::TypeSP m_type_sp;
74    ClangASTType m_clang_type;
75
76private:
77    ValueObjectMemory (ExecutionContextScope *exe_scope,
78                       const char *name,
79                       const Address &address,
80                       lldb::TypeSP &type_sp);
81
82    ValueObjectMemory (ExecutionContextScope *exe_scope,
83                       const char *name,
84                       const Address &address,
85                       const ClangASTType &ast_type);
86    //------------------------------------------------------------------
87    // For ValueObject only
88    //------------------------------------------------------------------
89    DISALLOW_COPY_AND_ASSIGN (ValueObjectMemory);
90};
91
92} // namespace lldb_private
93
94#endif  // liblldb_ValueObjectMemory_h_
95