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

This class represents a DWARF function which can be associated with either: DW_TAG_subprogram or DW_TAG_inlined_subroutine. More...

#include <Function.hpp>

Classes

class  Iterator
 
class  Parameter
 This class wraps a DWARF function's parameter. More...
 

Public Types

using vars_it = iterator_range<Variable::Iterator>
 

Public Member Functions

 Function (std::unique_ptr< details::Function > impl)
 
std::string name () const
 The name of the function (DW_AT_name)
 
std::string linkage_name () const
 The name of the function which is used for linking (DW_AT_linkage_name).
 
result< uint64_t > address () const
 Return the address of the function (DW_AT_entry_pc or DW_AT_low_pc).
 
vars_it variables () const
 Return an iterator of variables (DW_TAG_variable) defined within the scope of this function. This includes regular stack-based variables as well as static ones.
 
bool is_artificial () const
 Whether this function is created by the compiler and not present in the original source code.
 
uint64_t size () const
 Return the size taken by this function in the binary.
 
std::vector< range_tranges () const
 Ranges of virtual addresses owned by this function.
 
debug_location_t debug_location () const
 Original source code location.
 
std::unique_ptr< Typetype () const
 Return the dwarf::Type associated with the return type of this function.
 
std::vector< Parameterparameters () const
 Return the function's parameters.
 
std::unique_ptr< Scopescope () const
 Return the scope in which this function is defined.
 
 ~Function ()
 

Detailed Description

This class represents a DWARF function which can be associated with either: DW_TAG_subprogram or DW_TAG_inlined_subroutine.

Member Typedef Documentation

◆ vars_it

Constructor & Destructor Documentation

◆ Function()

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

◆ ~Function()

LIEF::dwarf::Function::~Function ( )

Member Function Documentation

◆ address()

result< uint64_t > LIEF::dwarf::Function::address ( ) const

Return the address of the function (DW_AT_entry_pc or DW_AT_low_pc).

◆ debug_location()

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

Original source code location.

◆ is_artificial()

bool LIEF::dwarf::Function::is_artificial ( ) const

Whether this function is created by the compiler and not present in the original source code.

◆ linkage_name()

std::string LIEF::dwarf::Function::linkage_name ( ) const

The name of the function 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::Function::name ( ) const

The name of the function (DW_AT_name)

◆ parameters()

std::vector< Parameter > LIEF::dwarf::Function::parameters ( ) const

Return the function's parameters.

◆ ranges()

std::vector< range_t > LIEF::dwarf::Function::ranges ( ) const

Ranges of virtual addresses owned by this function.

◆ scope()

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

Return the scope in which this function is defined.

◆ size()

uint64_t LIEF::dwarf::Function::size ( ) const

Return the size taken by this function in the binary.

◆ type()

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

Return the dwarf::Type associated with the return type of this function.

◆ variables()

vars_it LIEF::dwarf::Function::variables ( ) const

Return an iterator of variables (DW_TAG_variable) defined within the scope of this function. This includes regular stack-based variables as well as static ones.


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