1 //===-- ValueObjectVariable.h -----------------------------------*- C++ -*-===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 #ifndef liblldb_ValueObjectVariable_h_
10 #define liblldb_ValueObjectVariable_h_
12 #include "lldb/Core/ValueObject.h"
14 #include "lldb/Core/Value.h"
15 #include "lldb/Symbol/CompilerType.h"
16 #include "lldb/Utility/ConstString.h"
17 #include "lldb/lldb-defines.h"
18 #include "lldb/lldb-enumerations.h"
19 #include "lldb/lldb-forward.h"
24 namespace lldb_private {
28 class ExecutionContextScope;
29 class SymbolContextScope;
31 // A ValueObject that contains a root variable that may or may not
33 class ValueObjectVariable : public ValueObject {
35 ~ValueObjectVariable() override;
37 static lldb::ValueObjectSP Create(ExecutionContextScope *exe_scope,
38 const lldb::VariableSP &var_sp);
40 uint64_t GetByteSize() override;
42 ConstString GetTypeName() override;
44 ConstString GetQualifiedTypeName() override;
46 ConstString GetDisplayTypeName() override;
48 size_t CalculateNumChildren(uint32_t max) override;
50 lldb::ValueType GetValueType() const override;
52 bool IsInScope() override;
54 lldb::ModuleSP GetModule() override;
56 SymbolContextScope *GetSymbolContextScope() override;
58 bool GetDeclaration(Declaration &decl) override;
60 const char *GetLocationAsCString() override;
62 bool SetValueFromCString(const char *value_str, Status &error) override;
64 bool SetData(DataExtractor &data, Status &error) override;
66 lldb::VariableSP GetVariable() override { return m_variable_sp; }
69 bool UpdateValue() override;
71 CompilerType GetCompilerTypeImpl() override;
74 m_variable_sp; ///< The variable that this value object is based upon
75 Value m_resolved_value; ///< The value that DWARFExpression resolves this
76 ///variable to before we patch it up
79 ValueObjectVariable(ExecutionContextScope *exe_scope,
80 const lldb::VariableSP &var_sp);
81 // For ValueObject only
82 DISALLOW_COPY_AND_ASSIGN(ValueObjectVariable);
85 } // namespace lldb_private
87 #endif // liblldb_ValueObjectVariable_h_