LIEF: Library to Instrument Executable Formats Version 0.15.1
|
This class represents a DWARF variable which can be owned by a dwarf::Function or a dwarf::CompilationUnit. More...
#include <Variable.hpp>
Classes | |
class | Iterator |
Public Member Functions | |
Variable (std::unique_ptr< details::Variable > impl) | |
std::string | name () const |
Name of the variable (usually demangled) | |
std::string | linkage_name () const |
The name of the variable which is used for linking (DW_AT_linkage_name ). | |
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). | |
bool | is_constexpr () const |
Whether it's a constexpr variable. | |
debug_location_t | debug_location () const |
The original source location where the variable is defined. | |
std::unique_ptr< Type > | type () const |
Return the type of this variable. | |
std::unique_ptr< Scope > | scope () const |
Return the scope in which this variable is defined. | |
~Variable () | |
This class represents a DWARF variable which can be owned by a dwarf::Function or a dwarf::CompilationUnit.
LIEF::dwarf::Variable::Variable | ( | std::unique_ptr< details::Variable > | impl | ) |
LIEF::dwarf::Variable::~Variable | ( | ) |
result< int64_t > LIEF::dwarf::Variable::address | ( | ) | const |
Address of the variable.
If the variable is static, it returns the virtual address where it is defined. If the variable is stack-based, it returns the relative offset from the frame based register.
If the address can't be resolved, it returns a lief_errors.
debug_location_t LIEF::dwarf::Variable::debug_location | ( | ) | const |
The original source location where the variable is defined.
bool LIEF::dwarf::Variable::is_constexpr | ( | ) | const |
Whether it's a constexpr
variable.
std::string LIEF::dwarf::Variable::linkage_name | ( | ) | const |
The name of the variable which is used for linking (DW_AT_linkage_name
).
This name differs from name() as it is usually mangled. The function return an empty string if the linkage name is not available.
std::string LIEF::dwarf::Variable::name | ( | ) | const |
Name of the variable (usually demangled)
std::unique_ptr< Scope > LIEF::dwarf::Variable::scope | ( | ) | const |
Return the scope in which this variable is defined.
result< uint64_t > LIEF::dwarf::Variable::size | ( | ) | const |
Return the size of the variable (or a lief_errors if it can't be resolved).
This size is defined by its type.
std::unique_ptr< Type > LIEF::dwarf::Variable::type | ( | ) | const |
Return the type of this variable.