15#ifndef LIEF_DWARF_EDITOR_FUNCTION_H
16#define LIEF_DWARF_EDITOR_FUNCTION_H
33class FunctionParameter;
34class FunctionLexicalBlock;
55 Parameter(std::unique_ptr<details::FunctionParameter> impl);
66 std::unique_ptr<details::FunctionParameter> impl_;
76 std::unique_ptr<LexicalBlock>
add_block(uint64_t start,
80 std::unique_ptr<LexicalBlock>
94 std::unique_ptr<details::FunctionLexicalBlock> impl_;
101 Label(std::unique_ptr<details::FunctionLabel> impl);
106 std::unique_ptr<details::FunctionLabel> impl_;
This class mirrors the DW_TAG_label DWARF tag.
Definition DWARF/editor/Function.hpp:98
Label(std::unique_ptr< details::FunctionLabel > impl)
This class mirrors the DW_TAG_lexical_block DWARF tag.
Definition DWARF/editor/Function.hpp:70
LexicalBlock & add_name(const std::string &name)
Create a DW_AT_name entry to associate a name to this entry.
std::unique_ptr< LexicalBlock > add_block(const std::vector< range_t > &range)
Create a sub-block with the given range of addresses.
LexicalBlock(std::unique_ptr< details::FunctionLexicalBlock > impl)
LexicalBlock & add_description(const std::string &description)
Create a DW_AT_description entry with the description provided in parameter.
std::unique_ptr< LexicalBlock > add_block(uint64_t start, uint64_t end)
Create a sub-block with the given low/high addresses.
This class represents a parameter of the current function (DW_TAG_formal_parameter).
Definition DWARF/editor/Function.hpp:52
Parameter(std::unique_ptr< details::FunctionParameter > impl)
Parameter & assign_register(const std::string &name)
Assign this parameter to a specific named register.
Parameter & assign_register(uint64_t reg)
Assign this parameter to the given DWARF register id (e.g. DW_OP_reg0).
Function(std::unique_ptr< details::Function > impl)
std::unique_ptr< Label > add_label(uint64_t addr, const std::string &label)
Add a label at the given address.
Function & set_external()
Set the function as external by defining DW_AT_external to true. This means that the function is impo...
Function & set_return_type(const Type &type)
Set the return type of this function.
std::unique_ptr< Variable > create_stack_variable(const std::string &name)
Create a stack-based variable owned by the current function.
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 ...
std::unique_ptr< Parameter > add_parameter(const std::string &name, const Type &type)
Add a parameter to the current function.
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 contiguo...
Function & set_address(uint64_t addr)
Set the address of this function by defining DW_AT_entry_pc.
std::unique_ptr< LexicalBlock > add_lexical_block(uint64_t start, uint64_t end)
Add a lexical block with the given range.
Function & add_description(const std::string &description)
Create a DW_AT_description entry with the description provided in parameter.
This class is the base class for any types created when editing DWARF debug info.
Definition DWARF/editor/Type.hpp:37
This class represents an editable DWARF variable which can be scoped by a function or a compilation u...
Definition editor/Variable.hpp:35
#define LIEF_LIFETIMEBOUND
Definition compiler_attributes.hpp:72
Definition DWARF/editor/CompilationUnit.hpp:38
Namespace for the DWARF debug format.
Definition DWARF/CompilationUnit.hpp:30
LIEF namespace.
Definition Abstract/Binary.hpp:41
uint64_t end
Definition DWARF/editor/Function.hpp:47
range_t(uint64_t start, uint64_t end)
Definition DWARF/editor/Function.hpp:43
uint64_t start
Definition DWARF/editor/Function.hpp:46
#define LIEF_API
Definition visibility.h:45