LIEF: Library to Instrument Executable Formats Version 0.15.1
Loading...
Searching...
No Matches
LIEF::dwarf::Variable Class Reference

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< Typetype () const
 Return the type of this variable.
 
std::unique_ptr< Scopescope () const
 Return the scope in which this variable is defined.
 
 ~Variable ()
 

Detailed Description

This class represents a DWARF variable which can be owned by a dwarf::Function or a dwarf::CompilationUnit.

Constructor & Destructor Documentation

◆ Variable()

LIEF::dwarf::Variable::Variable ( std::unique_ptr< details::Variable > impl)

◆ ~Variable()

LIEF::dwarf::Variable::~Variable ( )

Member Function Documentation

◆ address()

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()

debug_location_t LIEF::dwarf::Variable::debug_location ( ) const

The original source location where the variable is defined.

◆ is_constexpr()

bool LIEF::dwarf::Variable::is_constexpr ( ) const

Whether it's a constexpr variable.

◆ linkage_name()

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.

◆ name()

std::string LIEF::dwarf::Variable::name ( ) const

Name of the variable (usually demangled)

◆ scope()

std::unique_ptr< Scope > LIEF::dwarf::Variable::scope ( ) const

Return the scope in which this variable is defined.

◆ size()

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.

◆ type()

std::unique_ptr< Type > LIEF::dwarf::Variable::type ( ) const

Return the type of this variable.


The documentation for this class was generated from the following file: