LLDB  mainline
ValueObjectVariable.h
Go to the documentation of this file.
1 //===-- ValueObjectVariable.h -----------------------------------*- C++ -*-===//
2 //
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
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #ifndef liblldb_ValueObjectVariable_h_
10 #define liblldb_ValueObjectVariable_h_
11 
12 #include "lldb/Core/ValueObject.h"
13 
14 #include "lldb/Core/Value.h"
17 #include "lldb/lldb-defines.h"
18 #include "lldb/lldb-enumerations.h"
19 #include "lldb/lldb-forward.h"
20 
21 #include <stddef.h>
22 #include <stdint.h>
23 
24 namespace lldb_private {
25 class DataExtractor;
26 }
27 namespace lldb_private {
28 class Declaration;
29 }
30 namespace lldb_private {
31 class Status;
32 }
33 namespace lldb_private {
34 class ExecutionContextScope;
35 }
36 namespace lldb_private {
37 class SymbolContextScope;
38 }
39 
40 namespace lldb_private {
41 
42 // A ValueObject that contains a root variable that may or may not
43 // have children.
45 public:
46  ~ValueObjectVariable() override;
47 
48  static lldb::ValueObjectSP Create(ExecutionContextScope *exe_scope,
49  const lldb::VariableSP &var_sp);
50 
51  uint64_t GetByteSize() override;
52 
53  ConstString GetTypeName() override;
54 
56 
58 
59  size_t CalculateNumChildren(uint32_t max) override;
60 
61  lldb::ValueType GetValueType() const override;
62 
63  bool IsInScope() override;
64 
65  lldb::ModuleSP GetModule() override;
66 
68 
69  bool GetDeclaration(Declaration &decl) override;
70 
71  const char *GetLocationAsCString() override;
72 
73  bool SetValueFromCString(const char *value_str, Status &error) override;
74 
75  bool SetData(DataExtractor &data, Status &error) override;
76 
77  lldb::VariableSP GetVariable() override { return m_variable_sp; }
78 
79 protected:
80  bool UpdateValue() override;
81 
83 
84  lldb::VariableSP
85  m_variable_sp; ///< The variable that this value object is based upon
86  Value m_resolved_value; ///< The value that DWARFExpression resolves this
87  ///variable to before we patch it up
88 
89 private:
91  const lldb::VariableSP &var_sp);
92  // For ValueObject only
93  DISALLOW_COPY_AND_ASSIGN(ValueObjectVariable);
94 };
95 
96 } // namespace lldb_private
97 
98 #endif // liblldb_ValueObjectVariable_h_
lldb::VariableSP m_variable_sp
The variable that this value object is based upon.
An data extractor class.
Definition: DataExtractor.h:47
Enumerations for broadcasting.
Definition: SBLaunchInfo.h:14
bool SetValueFromCString(const char *value_str, Status &error) override
ConstString GetDisplayTypeName() override
SymbolContextScope * GetSymbolContextScope() override
Value m_resolved_value
The value that DWARFExpression resolves this variable to before we patch it up.
size_t CalculateNumChildren(uint32_t max) override
bool SetData(DataExtractor &data, Status &error) override
lldb::VariableSP GetVariable() override
"lldb/Target/ExecutionContextScope.h" Inherit from this if your object can reconstruct its execution ...
lldb::ValueType GetValueType() const override
A uniqued constant string class.
Definition: ConstString.h:38
CompilerType GetCompilerTypeImpl() override
ConstString GetQualifiedTypeName() override
A class that describes the declaration location of a lldb object.
Definition: Declaration.h:24
"lldb/Symbol/SymbolContextScope.h" Inherit from this if your object is part of a symbol context and c...
static lldb::ValueObjectSP Create(ExecutionContextScope *exe_scope, const lldb::VariableSP &var_sp)
const char * GetLocationAsCString() override
bool GetDeclaration(Declaration &decl) override
An error handling class.
Definition: Status.h:44