]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/lldb/include/lldb/Core/ValueObjectMemory.h
MFV r308954:
[FreeBSD/FreeBSD.git] / contrib / llvm / tools / lldb / include / lldb / Core / ValueObjectMemory.h
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/CompilerType.h"
19
20 namespace lldb_private {
21
22 //----------------------------------------------------------------------
23 // A ValueObject that represents memory at a given address, viewed as some 
24 // set lldb type.
25 //----------------------------------------------------------------------
26 class ValueObjectMemory : public ValueObject
27 {
28 public:
29     ~ValueObjectMemory() override;
30
31     static lldb::ValueObjectSP
32     Create (ExecutionContextScope *exe_scope, 
33             const char *name,
34             const Address &address, 
35             lldb::TypeSP &type_sp);
36
37     static lldb::ValueObjectSP
38     Create (ExecutionContextScope *exe_scope, 
39             const char *name,
40             const Address &address, 
41             const CompilerType &ast_type);
42
43     uint64_t
44     GetByteSize() override;
45
46     ConstString
47     GetTypeName() override;
48
49     ConstString
50     GetDisplayTypeName() override;
51     
52     size_t
53     CalculateNumChildren(uint32_t max) override;
54
55     lldb::ValueType
56     GetValueType() const override;
57
58     bool
59     IsInScope() override;
60
61     lldb::ModuleSP
62     GetModule() override;
63
64 protected:
65     bool
66     UpdateValue() override;
67     
68     CompilerType
69     GetCompilerTypeImpl() override;
70
71     Address  m_address;  ///< The variable that this value object is based upon
72     lldb::TypeSP m_type_sp;
73     CompilerType m_compiler_type;
74
75 private:
76     ValueObjectMemory (ExecutionContextScope *exe_scope, 
77                        const char *name,
78                        const Address &address, 
79                        lldb::TypeSP &type_sp);
80
81     ValueObjectMemory (ExecutionContextScope *exe_scope,
82                        const char *name, 
83                        const Address &address,
84                        const CompilerType &ast_type);
85     //------------------------------------------------------------------
86     // For ValueObject only
87     //------------------------------------------------------------------
88     DISALLOW_COPY_AND_ASSIGN (ValueObjectMemory);
89 };
90
91 } // namespace lldb_private
92
93 #endif // liblldb_ValueObjectMemory_h_