]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/lldb/include/lldb/Core/ValueObjectConstResultImpl.h
Merge llvm, clang, lld and lldb trunk r291274, and resolve conflicts.
[FreeBSD/FreeBSD.git] / contrib / llvm / tools / lldb / include / lldb / Core / ValueObjectConstResultImpl.h
1 //===-- ValueObjectConstResultImpl.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_ValueObjectConstResultImpl_h_
11 #define liblldb_ValueObjectConstResultImpl_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 class wrapping common implementation details for operations in
23 // ValueObjectConstResult ( & Child ) that may need to jump from the host
24 // memory space into the target's memory space
25 //----------------------------------------------------------------------
26 class ValueObjectConstResultImpl {
27 public:
28   ValueObjectConstResultImpl(ValueObject *valobj,
29                              lldb::addr_t live_address = LLDB_INVALID_ADDRESS);
30
31   virtual ~ValueObjectConstResultImpl() = default;
32
33   lldb::ValueObjectSP Dereference(Error &error);
34
35   ValueObject *CreateChildAtIndex(size_t idx, bool synthetic_array_member,
36                                   int32_t synthetic_index);
37
38   lldb::ValueObjectSP
39   GetSyntheticChildAtOffset(uint32_t offset, const CompilerType &type,
40                             bool can_create,
41                             ConstString name_const_str = ConstString());
42
43   lldb::ValueObjectSP AddressOf(Error &error);
44
45   lldb::addr_t GetLiveAddress() { return m_live_address; }
46
47   lldb::ValueObjectSP Cast(const CompilerType &compiler_type);
48
49   void SetLiveAddress(lldb::addr_t addr = LLDB_INVALID_ADDRESS,
50                       AddressType address_type = eAddressTypeLoad) {
51     m_live_address = addr;
52     m_live_address_type = address_type;
53   }
54
55   virtual lldb::addr_t GetAddressOf(bool scalar_is_load_address = true,
56                                     AddressType *address_type = nullptr);
57
58   virtual size_t GetPointeeData(DataExtractor &data, uint32_t item_idx = 0,
59                                 uint32_t item_count = 1);
60
61 private:
62   ValueObject *m_impl_backend;
63   lldb::addr_t m_live_address;
64   AddressType m_live_address_type;
65   lldb::ValueObjectSP m_load_addr_backend;
66   lldb::ValueObjectSP m_address_of_backend;
67
68   DISALLOW_COPY_AND_ASSIGN(ValueObjectConstResultImpl);
69 };
70
71 } // namespace lldb_private
72
73 #endif // liblldb_ValueObjectConstResultImpl_h_