LIEF: Library to Instrument Executable Formats Version 0.17.0
|
This class represents an editable DWARF function (DW_TAG_subprogram
)
More...
#include <Function.hpp>
Classes | |
class | Label |
This class mirrors the DW_TAG_label DWARF tag. More... | |
class | LexicalBlock |
This class mirrors the DW_TAG_lexical_block DWARF tag. More... | |
class | Parameter |
This class represents a parameter of the current function (DW_TAG_formal_parameter ) More... | |
struct | range_t |
Public Member Functions | |
Function ()=delete | |
Function (std::unique_ptr< details::Function > impl) | |
Function & | set_address (uint64_t addr) |
Set the address of this function by defining DW_AT_entry_pc | |
Function & | set_low_high (uint64_t low, uint64_t high) |
Set the upper and lower bound addresses for this function. This assumes that the function is contiguous between low and high . | |
Function & | set_ranges (const std::vector< range_t > &ranges) |
Set the ranges of addresses owned by the implementation of this function by setting the DW_AT_ranges attribute. | |
Function & | set_external () |
Set the function as external by defining DW_AT_external to true. This means that the function is imported by the current compilation unit. | |
Function & | set_return_type (const Type &type) |
Set the return type of this function. | |
std::unique_ptr< Parameter > | add_parameter (const std::string &name, const Type &type) |
Add a parameter to the current function. | |
std::unique_ptr< Variable > | create_stack_variable (const std::string &name) |
Create a stack-based variable owned by the current function. | |
std::unique_ptr< LexicalBlock > | add_lexical_block (uint64_t start, uint64_t end) |
Add a lexical block with the given range. | |
std::unique_ptr< Label > | add_label (uint64_t addr, const std::string &label) |
Add a label at the given address. | |
~Function () | |
This class represents an editable DWARF function (DW_TAG_subprogram
)
|
delete |
LIEF::dwarf::editor::Function::Function | ( | std::unique_ptr< details::Function > | impl | ) |
LIEF::dwarf::editor::Function::~Function | ( | ) |
std::unique_ptr< Label > LIEF::dwarf::editor::Function::add_label | ( | uint64_t | addr, |
const std::string & | label ) |
Add a label at the given address.
std::unique_ptr< LexicalBlock > LIEF::dwarf::editor::Function::add_lexical_block | ( | uint64_t | start, |
uint64_t | end ) |
Add a lexical block with the given range.
std::unique_ptr< Parameter > LIEF::dwarf::editor::Function::add_parameter | ( | const std::string & | name, |
const Type & | type ) |
Add a parameter to the current function.
std::unique_ptr< Variable > LIEF::dwarf::editor::Function::create_stack_variable | ( | const std::string & | name | ) |
Create a stack-based variable owned by the current function.
Function & LIEF::dwarf::editor::Function::set_address | ( | uint64_t | addr | ) |
Set the address of this function by defining DW_AT_entry_pc
Function & LIEF::dwarf::editor::Function::set_external | ( | ) |
Set the function as external by defining DW_AT_external
to true. This means that the function is imported by the current compilation unit.
Function & LIEF::dwarf::editor::Function::set_low_high | ( | uint64_t | low, |
uint64_t | high ) |
Set the upper and lower bound addresses for this function. This assumes that the function is contiguous between low
and high
.
Underneath, the function defines DW_AT_low_pc
and DW_AT_high_pc
Set the ranges of addresses owned by the implementation of this function by setting the DW_AT_ranges
attribute.
This setter should be used for non-contiguous function.
Set the return type of this function.