ValueObjectConstResult.h revision b01000fd063629facd45044f137446fb748ee179
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
19namespace lldb_private {
20
21//----------------------------------------------------------------------
22// A child of another ValueObject.
23//----------------------------------------------------------------------
24class ValueObjectConstResult : public ValueObject
25{
26public:
27    ValueObjectConstResult (lldb::ByteOrder byte_order,
28                            uint32_t addr_byte_size);
29
30    ValueObjectConstResult (clang::ASTContext *clang_ast,
31                            void *clang_type,
32                            const ConstString &name,
33                            const DataExtractor &data);
34
35    ValueObjectConstResult (clang::ASTContext *clang_ast,
36                            void *clang_type,
37                            const ConstString &name,
38                            const lldb::DataBufferSP &result_data_sp,
39                            lldb::ByteOrder byte_order,
40                            uint8_t addr_size);
41
42    ValueObjectConstResult (clang::ASTContext *clang_ast,
43                            void *clang_type,
44                            const ConstString &name,
45                            lldb::addr_t address,
46                            lldb::AddressType address_type,
47                            uint8_t addr_byte_size);
48
49    // When an expression fails to evaluate, we return an error
50    ValueObjectConstResult (const Error& error);
51
52    virtual ~ValueObjectConstResult();
53
54    virtual size_t
55    GetByteSize();
56
57    virtual clang::ASTContext *
58    GetClangAST ();
59
60    virtual lldb::clang_type_t
61    GetClangType ();
62
63    virtual lldb::ValueType
64    GetValueType() const;
65
66    virtual uint32_t
67    CalculateNumChildren();
68
69    virtual ConstString
70    GetTypeName();
71
72    virtual void
73    UpdateValue (ExecutionContextScope *exe_scope);
74
75    virtual bool
76    IsInScope (StackFrame *frame);
77
78    virtual bool
79    SetClangAST (clang::ASTContext *ast)
80    {
81        m_clang_ast = ast;
82        return true;
83    }
84
85    void
86    SetByteSize (size_t size);
87
88protected:
89    clang::ASTContext *m_clang_ast; // The clang AST that the clang type comes from
90    ConstString m_type_name;
91    uint32_t m_byte_size;
92
93private:
94    DISALLOW_COPY_AND_ASSIGN (ValueObjectConstResult);
95};
96
97} // namespace lldb_private
98
99#endif  // liblldb_ValueObjectConstResult_h_
100