Go to the documentation of this file.
15#ifndef LIEF_DWARF_VARIABLE_H
16#define LIEF_DWARF_VARIABLE_H
40 using iterator_category = std::bidirectional_iterator_tag;
41 using value_type = std::unique_ptr<Variable>;
42 using difference_type = std::ptrdiff_t;
43 using pointer = Variable*;
44 using reference = std::unique_ptr<Variable>&;
45 using implementation = details::VariableIt;
49 friend class Iterator;
56 template <
typename RefT>
57 PointerProxy(RefT &&R) : R(std::forward<RefT>(R)) {}
62 Iterator(std::unique_ptr<details::VariableIt> impl);
65 friend
LIEF_API bool operator==(const Iterator& LHS, const Iterator& RHS);
66 friend
LIEF_API bool operator!=(const Iterator& LHS, const Iterator& RHS) {
74 Iterator tmp = *
static_cast<Iterator*
>(
this);
75 --*
static_cast<Iterator *
>(
this);
80 Iterator tmp = *
static_cast<Iterator*
>(
this);
81 ++*
static_cast<Iterator *
>(
this);
88 return static_cast<const Iterator*
>(
this)->
operator*();
92 std::unique_ptr<details::VariableIt> impl_;
95 Variable(std::unique_ptr<details::Variable> impl);
96 std::string
name()
const;
105 result<int64_t>
address()
const;
115 result<uint64_t>
size()
const;
127 std::unique_ptr<Type>
type()
const;
130 std::unique_ptr<Scope>
scope()
const;
136 std::unique_ptr<details::Variable> impl_;
This class materializes a scope in which Function, Variable, Type, ... can be defined.
Definition Scope.hpp:32
pointer operator->() const
Definition Variable.hpp:51
Iterator operator++(int)
Definition Variable.hpp:79
Iterator operator--(int)
Definition Variable.hpp:73
PointerProxy operator->() const
Definition Variable.hpp:87
Iterator(const Iterator &)
std::unique_ptr< Variable > operator*() const
Iterator(Iterator &&) noexcept
This class represents a DWARF variable which can be owned by a dwarf::Function or a dwarf::Compilatio...
Definition Variable.hpp:36
std::string linkage_name() const
The name of the variable which is used for linking (DW_AT_linkage_name).
Variable(std::unique_ptr< details::Variable > impl)
bool is_constexpr() const
Whether it's a constexpr variable.
std::unique_ptr< Type > type() const
Return the type of this variable.
debug_location_t debug_location() const
The original source location where the variable is defined.
std::unique_ptr< Scope > scope() const
Return the scope in which this variable is defined.
std::string name() const
Name of the variable (usually demangled)
result< int64_t > address() const
Address of the variable.
result< uint64_t > size() const
Return the size of the variable (or a lief_errors if it can't be resolved).
Definition DWARF/CompilationUnit.hpp:30
Namespace for the DWARF debug format.
Definition DWARF/CompilationUnit.hpp:28
LIEF namespace.
Definition Abstract/Binary.hpp:36
#define LIEF_API
Definition visibility.h:41