1 //===-- ValueObjectVariable.h -----------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef liblldb_ValueObjectVariable_h_
11 #define liblldb_ValueObjectVariable_h_
13 #include "lldb/Core/ValueObject.h"
15 #include "lldb/Core/Value.h" // for Value
16 #include "lldb/Symbol/CompilerType.h" // for CompilerType
17 #include "lldb/Utility/ConstString.h" // for ConstString
18 #include "lldb/lldb-defines.h" // for DISALLOW_COPY_AND_ASSIGN
19 #include "lldb/lldb-enumerations.h" // for ValueType
20 #include "lldb/lldb-forward.h" // for VariableSP, ModuleSP, ValueObj...
22 #include <stddef.h> // for size_t
23 #include <stdint.h> // for uint32_t, uint64_t
25 namespace lldb_private {
28 namespace lldb_private {
31 namespace lldb_private {
34 namespace lldb_private {
35 class ExecutionContextScope;
37 namespace lldb_private {
38 class SymbolContextScope;
41 namespace lldb_private {
43 //----------------------------------------------------------------------
44 // A ValueObject that contains a root variable that may or may not
46 //----------------------------------------------------------------------
47 class ValueObjectVariable : public ValueObject {
49 ~ValueObjectVariable() override;
51 static lldb::ValueObjectSP Create(ExecutionContextScope *exe_scope,
52 const lldb::VariableSP &var_sp);
54 uint64_t GetByteSize() override;
56 ConstString GetTypeName() override;
58 ConstString GetQualifiedTypeName() override;
60 ConstString GetDisplayTypeName() override;
62 size_t CalculateNumChildren(uint32_t max) override;
64 lldb::ValueType GetValueType() const override;
66 bool IsInScope() override;
68 lldb::ModuleSP GetModule() override;
70 SymbolContextScope *GetSymbolContextScope() override;
72 bool GetDeclaration(Declaration &decl) override;
74 const char *GetLocationAsCString() override;
76 bool SetValueFromCString(const char *value_str, Status &error) override;
78 bool SetData(DataExtractor &data, Status &error) override;
80 virtual lldb::VariableSP GetVariable() override { return m_variable_sp; }
83 bool UpdateValue() override;
85 CompilerType GetCompilerTypeImpl() override;
88 m_variable_sp; ///< The variable that this value object is based upon
89 Value m_resolved_value; ///< The value that DWARFExpression resolves this
90 ///variable to before we patch it up
93 ValueObjectVariable(ExecutionContextScope *exe_scope,
94 const lldb::VariableSP &var_sp);
95 //------------------------------------------------------------------
96 // For ValueObject only
97 //------------------------------------------------------------------
98 DISALLOW_COPY_AND_ASSIGN(ValueObjectVariable);
101 } // namespace lldb_private
103 #endif // liblldb_ValueObjectVariable_h_