1 //===-- ValueObjectVariable.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_ValueObjectVariable_h_
11 #define liblldb_ValueObjectVariable_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 ValueObject that contains a root variable that may or may not
23 // have children.
24 //----------------------------------------------------------------------
25 class ValueObjectVariable : public ValueObject
26 {
27 public:
28     static lldb::ValueObjectSP
29     Create (ExecutionContextScope *exe_scope, const lldb::VariableSP &var_sp);
30 
31     virtual
32     ~ValueObjectVariable();
33 
34     virtual uint64_t
35     GetByteSize();
36 
37     virtual ConstString
38     GetTypeName();
39 
40     virtual ConstString
41     GetQualifiedTypeName();
42 
43     virtual ConstString
44     GetDisplayTypeName();
45 
46     virtual size_t
47     CalculateNumChildren();
48 
49     virtual lldb::ValueType
50     GetValueType() const;
51 
52     virtual bool
53     IsInScope ();
54 
55     virtual lldb::ModuleSP
56     GetModule();
57 
58     virtual SymbolContextScope *
59     GetSymbolContextScope();
60 
61     virtual bool
62     GetDeclaration (Declaration &decl);
63 
64     virtual const char *
65     GetLocationAsCString ();
66 
67     virtual bool
68     SetValueFromCString (const char *value_str, Error& error);
69 
70     virtual bool
71     SetData (DataExtractor &data, Error &error);
72 
73 protected:
74     virtual bool
75     UpdateValue ();
76 
77     virtual ClangASTType
78     GetClangTypeImpl ();
79 
80     lldb::VariableSP  m_variable_sp;  ///< The variable that this value object is based upon
81     Value m_resolved_value;           ///< The value that DWARFExpression resolves this variable to before we patch it up
82 
83 private:
84     ValueObjectVariable (ExecutionContextScope *exe_scope, const lldb::VariableSP &var_sp);
85     //------------------------------------------------------------------
86     // For ValueObject only
87     //------------------------------------------------------------------
88     DISALLOW_COPY_AND_ASSIGN (ValueObjectVariable);
89 };
90 
91 } // namespace lldb_private
92 
93 #endif  // liblldb_ValueObjectVariable_h_
94