]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/lldb/include/lldb/Core/ValueObjectConstResultImpl.h
Update LLDB snapshot to upstream r225923 (git 2b588ecd)
[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 {
28 public:
29     
30     ValueObjectConstResultImpl (ValueObject* valobj,
31                                 lldb::addr_t live_address = LLDB_INVALID_ADDRESS);
32     
33     virtual
34     ~ValueObjectConstResultImpl()
35     {
36     }
37     
38     lldb::ValueObjectSP
39     Dereference (Error &error);
40     
41     ValueObject *
42     CreateChildAtIndex (size_t idx, bool synthetic_array_member, int32_t synthetic_index);
43     
44     lldb::ValueObjectSP
45     GetSyntheticChildAtOffset (uint32_t offset, const ClangASTType& type, bool can_create);
46     
47     lldb::ValueObjectSP
48     AddressOf (Error &error);
49     
50     lldb::addr_t
51     GetLiveAddress()
52     {
53         return m_live_address;
54     }
55     
56     void
57     SetLiveAddress(lldb::addr_t addr = LLDB_INVALID_ADDRESS,
58                    AddressType address_type = eAddressTypeLoad)
59     {
60         m_live_address = addr;
61         m_live_address_type = address_type;
62     }
63     
64     virtual lldb::addr_t
65     GetAddressOf (bool scalar_is_load_address = true,
66                   AddressType *address_type = NULL);
67     
68     virtual size_t
69     GetPointeeData (DataExtractor& data,
70                     uint32_t item_idx = 0,
71                                         uint32_t item_count = 1);
72     
73 private:
74     
75     ValueObject *m_impl_backend;
76     lldb::addr_t m_live_address;
77     AddressType m_live_address_type;
78     lldb::ValueObjectSP m_load_addr_backend;
79     lldb::ValueObjectSP m_address_of_backend;
80     
81     DISALLOW_COPY_AND_ASSIGN (ValueObjectConstResultImpl);
82 };
83
84 } // namespace lldb_private
85
86 #endif  // liblldb_ValueObjectConstResultImpl_h_