]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - include/lldb/Core/ValueObjectConstResult.h
Vendor import of lldb trunk r290819:
[FreeBSD/FreeBSD.git] / include / lldb / Core / ValueObjectConstResult.h
1 //===-- ValueObjectConstResult.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_ValueObjectConstResult_h_
11 #define liblldb_ValueObjectConstResult_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 #include "lldb/Core/ValueObjectConstResultImpl.h"
20
21 namespace lldb_private {
22
23 //----------------------------------------------------------------------
24 // A frozen ValueObject copied into host memory
25 //----------------------------------------------------------------------
26 class ValueObjectConstResult : public ValueObject {
27 public:
28   ~ValueObjectConstResult() override;
29
30   static lldb::ValueObjectSP
31   Create(ExecutionContextScope *exe_scope, lldb::ByteOrder byte_order,
32          uint32_t addr_byte_size, lldb::addr_t address = LLDB_INVALID_ADDRESS);
33
34   static lldb::ValueObjectSP
35   Create(ExecutionContextScope *exe_scope, const CompilerType &compiler_type,
36          const ConstString &name, const DataExtractor &data,
37          lldb::addr_t address = LLDB_INVALID_ADDRESS);
38
39   static lldb::ValueObjectSP
40   Create(ExecutionContextScope *exe_scope, const CompilerType &compiler_type,
41          const ConstString &name, const lldb::DataBufferSP &result_data_sp,
42          lldb::ByteOrder byte_order, uint32_t addr_size,
43          lldb::addr_t address = LLDB_INVALID_ADDRESS);
44
45   static lldb::ValueObjectSP
46   Create(ExecutionContextScope *exe_scope, const CompilerType &compiler_type,
47          const ConstString &name, lldb::addr_t address,
48          AddressType address_type, uint32_t addr_byte_size);
49
50   static lldb::ValueObjectSP Create(ExecutionContextScope *exe_scope,
51                                     Value &value, const ConstString &name,
52                                     Module *module = nullptr);
53
54   // When an expression fails to evaluate, we return an error
55   static lldb::ValueObjectSP Create(ExecutionContextScope *exe_scope,
56                                     const Error &error);
57
58   uint64_t GetByteSize() override;
59
60   lldb::ValueType GetValueType() const override;
61
62   size_t CalculateNumChildren(uint32_t max) override;
63
64   ConstString GetTypeName() override;
65
66   ConstString GetDisplayTypeName() override;
67
68   bool IsInScope() override;
69
70   void SetByteSize(size_t size);
71
72   lldb::ValueObjectSP Dereference(Error &error) override;
73
74   ValueObject *CreateChildAtIndex(size_t idx, bool synthetic_array_member,
75                                   int32_t synthetic_index) override;
76
77   lldb::ValueObjectSP GetSyntheticChildAtOffset(
78       uint32_t offset, const CompilerType &type, bool can_create,
79       ConstString name_const_str = ConstString()) override;
80
81   lldb::ValueObjectSP AddressOf(Error &error) override;
82
83   lldb::addr_t GetAddressOf(bool scalar_is_load_address = true,
84                             AddressType *address_type = nullptr) override;
85
86   size_t GetPointeeData(DataExtractor &data, uint32_t item_idx = 0,
87                         uint32_t item_count = 1) override;
88
89   lldb::addr_t GetLiveAddress() override { return m_impl.GetLiveAddress(); }
90
91   void SetLiveAddress(lldb::addr_t addr = LLDB_INVALID_ADDRESS,
92                       AddressType address_type = eAddressTypeLoad) override {
93     m_impl.SetLiveAddress(addr, address_type);
94   }
95
96   lldb::ValueObjectSP
97   GetDynamicValue(lldb::DynamicValueType valueType) override;
98
99   lldb::LanguageType GetPreferredDisplayLanguage() override;
100
101   lldb::ValueObjectSP Cast(const CompilerType &compiler_type) override;
102
103 protected:
104   bool UpdateValue() override;
105
106   CompilerType GetCompilerTypeImpl() override;
107
108   ConstString m_type_name;
109   uint64_t m_byte_size;
110
111   ValueObjectConstResultImpl m_impl;
112
113 private:
114   friend class ValueObjectConstResultImpl;
115
116   ValueObjectConstResult(ExecutionContextScope *exe_scope,
117                          lldb::ByteOrder byte_order, uint32_t addr_byte_size,
118                          lldb::addr_t address);
119
120   ValueObjectConstResult(ExecutionContextScope *exe_scope,
121                          const CompilerType &compiler_type,
122                          const ConstString &name, const DataExtractor &data,
123                          lldb::addr_t address);
124
125   ValueObjectConstResult(ExecutionContextScope *exe_scope,
126                          const CompilerType &compiler_type,
127                          const ConstString &name,
128                          const lldb::DataBufferSP &result_data_sp,
129                          lldb::ByteOrder byte_order, uint32_t addr_size,
130                          lldb::addr_t address);
131
132   ValueObjectConstResult(ExecutionContextScope *exe_scope,
133                          const CompilerType &compiler_type,
134                          const ConstString &name, lldb::addr_t address,
135                          AddressType address_type, uint32_t addr_byte_size);
136
137   ValueObjectConstResult(ExecutionContextScope *exe_scope, const Value &value,
138                          const ConstString &name, Module *module = nullptr);
139
140   ValueObjectConstResult(ExecutionContextScope *exe_scope, const Error &error);
141
142   DISALLOW_COPY_AND_ASSIGN(ValueObjectConstResult);
143 };
144
145 } // namespace lldb_private
146
147 #endif // liblldb_ValueObjectConstResult_h_