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 LLDB_CORE_VALUEOBJECTVARIABLE_H
10#define LLDB_CORE_VALUEOBJECTVARIABLE_H
11
13
14#include "lldb/Core/Value.h"
17#include "lldb/lldb-defines.h"
19#include "lldb/lldb-forward.h"
20
21#include <cstddef>
22#include <cstdint>
23#include <optional>
24
25namespace lldb_private {
26class DataExtractor;
27class Declaration;
28class Status;
29class ExecutionContextScope;
30class SymbolContextScope;
31
32/// A ValueObject that contains a root variable that may or may not
33/// have children.
35public:
37
39 const lldb::VariableSP &var_sp);
40
41 std::optional<uint64_t> GetByteSize() override;
42
43 ConstString GetTypeName() override;
44
46
48
49 llvm::Expected<uint32_t> CalculateNumChildren(uint32_t max) override;
50
51 lldb::ValueType GetValueType() const override;
52
53 bool IsInScope() override;
54
55 lldb::ModuleSP GetModule() override;
56
58
59 bool GetDeclaration(Declaration &decl) override;
60
61 const char *GetLocationAsCString() override;
62
63 bool SetValueFromCString(const char *value_str, Status &error) override;
64
65 bool SetData(DataExtractor &data, Status &error) override;
66
68
69protected:
70 bool UpdateValue() override;
71
72 void DoUpdateChildrenAddressType(ValueObject &valobj) override;
73
75
76 /// The variable that this value object is based upon.
78 ///< The value that DWARFExpression resolves this variable to before we patch
79 ///< it up.
81
82private:
84 ValueObjectManager &manager,
85 const lldb::VariableSP &var_sp);
86 // For ValueObject only
89};
90
91} // namespace lldb_private
92
93#endif // LLDB_CORE_VALUEOBJECTVARIABLE_H
static llvm::raw_ostream & error(Stream &strm)
Generic representation of a type in a programming language.
Definition: CompilerType.h:36
A uniqued constant string class.
Definition: ConstString.h:40
An data extractor class.
Definition: DataExtractor.h:48
A class that describes the declaration location of a lldb object.
Definition: Declaration.h:24
"lldb/Target/ExecutionContextScope.h" Inherit from this if your object can reconstruct its execution ...
An error handling class.
Definition: Status.h:44
"lldb/Symbol/SymbolContextScope.h" Inherit from this if your object is part of a symbol context and c...
A ValueObject that contains a root variable that may or may not have children.
lldb::ValueType GetValueType() const override
SymbolContextScope * GetSymbolContextScope() override
lldb::ModuleSP GetModule() override
Return the module associated with this value object in case the value is from an executable file and ...
void DoUpdateChildrenAddressType(ValueObject &valobj) override
ValueObjectVariable(const ValueObjectVariable &)=delete
ConstString GetDisplayTypeName() override
bool SetData(DataExtractor &data, Status &error) override
const char * GetLocationAsCString() override
static lldb::ValueObjectSP Create(ExecutionContextScope *exe_scope, const lldb::VariableSP &var_sp)
const ValueObjectVariable & operator=(const ValueObjectVariable &)=delete
std::optional< uint64_t > GetByteSize() override
ConstString GetQualifiedTypeName() override
lldb::VariableSP GetVariable() override
bool SetValueFromCString(const char *value_str, Status &error) override
lldb::VariableSP m_variable_sp
The variable that this value object is based upon.
llvm::Expected< uint32_t > CalculateNumChildren(uint32_t max) override
Should only be called by ValueObject::GetNumChildren().
bool GetDeclaration(Declaration &decl) override
CompilerType GetCompilerTypeImpl() override
A class that represents a running process on the host machine.
Definition: SBAttachInfo.h:14
std::shared_ptr< lldb_private::ValueObject > ValueObjectSP
Definition: lldb-forward.h:472
std::shared_ptr< lldb_private::Variable > VariableSP
Definition: lldb-forward.h:474
std::shared_ptr< lldb_private::Module > ModuleSP
Definition: lldb-forward.h:365