|
LIEF: Library to Instrument Executable Formats Version 2.0.0
|
This class represents an editable DWARF compilation unit. More...
#include <CompilationUnit.hpp>
Public Member Functions | |
| CompilationUnit ()=delete | |
| CompilationUnit (std::unique_ptr< details::CompilationUnit > impl) | |
| CompilationUnit & | set_producer (std::string_view producer) |
| Set the DW_AT_producer producer attribute. | |
| std::unique_ptr< Function > | create_function (std::string_view name) |
| Create a new function owned by this compilation unit. | |
| std::unique_ptr< Variable > | create_variable (std::string_view name) |
| Create a new global variable owned by this compilation unit. | |
| std::unique_ptr< Type > | create_generic_type (std::string_view name) |
| Create a DW_TAG_unspecified_type type with the given name. | |
| std::unique_ptr< EnumType > | create_enum (std::string_view name) |
| Create an enum type (DW_TAG_enumeration_type). | |
| std::unique_ptr< TypeDef > | create_typedef (std::string_view name, const Type &type) |
| Create a typedef with the name provided in the first parameter which aliases the type provided in the second parameter. | |
| std::unique_ptr< StructType > | create_structure (std::string_view name, StructType::TYPE kind=StructType::TYPE::STRUCT) |
| Create a struct-like type (struct, class, union) with the given name. | |
| std::unique_ptr< BaseType > | create_base_type (std::string_view name, size_t size, BaseType::ENCODING encoding=BaseType::ENCODING::NONE) |
| Create a primitive type with the given name and size. | |
| std::unique_ptr< FunctionType > | create_function_type (std::string_view name) |
| Create a function type with the given name. | |
| std::unique_ptr< PointerType > | create_pointer_type (const Type &ty) |
| Create a pointer on the provided type. | |
| std::unique_ptr< Type > | create_const_type (const Type &ty) |
| Create a const-qualified version of the provided type (DW_TAG_const_type). | |
| std::unique_ptr< Type > | create_volatile_type (const Type &ty) |
| Create a volatile-qualified version of the provided type (DW_TAG_volatile_type). | |
| std::unique_ptr< Type > | create_void_type () |
| Create a void type. | |
| std::unique_ptr< ArrayType > | create_array (std::string_view name, const Type &type, size_t count) |
| Create an array type with the given name, type and size. | |
| ~CompilationUnit () | |
This class represents an editable DWARF compilation unit.
|
delete |
Referenced by set_producer(), and ~CompilationUnit().
| LIEF::dwarf::editor::CompilationUnit::CompilationUnit | ( | std::unique_ptr< details::CompilationUnit > | impl | ) |
| LIEF::dwarf::editor::CompilationUnit::~CompilationUnit | ( | ) |
References CompilationUnit().
| std::unique_ptr< ArrayType > LIEF::dwarf::editor::CompilationUnit::create_array | ( | std::string_view | name, |
| const Type & | type, | ||
| size_t | count ) |
Create an array type with the given name, type and size.
References create_array(), and LIEF_LIFETIMEBOUND.
Referenced by create_array().
| std::unique_ptr< BaseType > LIEF::dwarf::editor::CompilationUnit::create_base_type | ( | std::string_view | name, |
| size_t | size, | ||
| BaseType::ENCODING | encoding = BaseType::ENCODING::NONE ) |
Create a primitive type with the given name and size.
References LIEF_LIFETIMEBOUND, and LIEF::dwarf::editor::BaseType::NONE.
Create a const-qualified version of the provided type (DW_TAG_const_type).
Qualifying the same type twice returns the same underlying DWARF entry.
References LIEF_LIFETIMEBOUND.
| std::unique_ptr< EnumType > LIEF::dwarf::editor::CompilationUnit::create_enum | ( | std::string_view | name | ) |
Create an enum type (DW_TAG_enumeration_type).
References LIEF_LIFETIMEBOUND.
| std::unique_ptr< Function > LIEF::dwarf::editor::CompilationUnit::create_function | ( | std::string_view | name | ) |
Create a new function owned by this compilation unit.
References LIEF_LIFETIMEBOUND.
| std::unique_ptr< FunctionType > LIEF::dwarf::editor::CompilationUnit::create_function_type | ( | std::string_view | name | ) |
Create a function type with the given name.
References LIEF_LIFETIMEBOUND.
| std::unique_ptr< Type > LIEF::dwarf::editor::CompilationUnit::create_generic_type | ( | std::string_view | name | ) |
Create a DW_TAG_unspecified_type type with the given name.
References LIEF_LIFETIMEBOUND.
|
inline |
Create a pointer on the provided type.
References LIEF_LIFETIMEBOUND.
| std::unique_ptr< StructType > LIEF::dwarf::editor::CompilationUnit::create_structure | ( | std::string_view | name, |
| StructType::TYPE | kind = StructType::TYPE::STRUCT ) |
Create a struct-like type (struct, class, union) with the given name.
References LIEF_LIFETIMEBOUND, and LIEF::dwarf::editor::StructType::STRUCT.
| std::unique_ptr< TypeDef > LIEF::dwarf::editor::CompilationUnit::create_typedef | ( | std::string_view | name, |
| const Type & | type ) |
Create a typedef with the name provided in the first parameter which aliases the type provided in the second parameter.
References LIEF_LIFETIMEBOUND.
| std::unique_ptr< Variable > LIEF::dwarf::editor::CompilationUnit::create_variable | ( | std::string_view | name | ) |
Create a new global variable owned by this compilation unit.
References LIEF_LIFETIMEBOUND.
| std::unique_ptr< Type > LIEF::dwarf::editor::CompilationUnit::create_void_type | ( | ) |
Create a void type.
References LIEF_LIFETIMEBOUND.
| std::unique_ptr< Type > LIEF::dwarf::editor::CompilationUnit::create_volatile_type | ( | const Type & | ty | ) |
Create a volatile-qualified version of the provided type (DW_TAG_volatile_type).
Qualifying the same type twice returns the same underlying DWARF entry.
References LIEF_LIFETIMEBOUND.
| CompilationUnit & LIEF::dwarf::editor::CompilationUnit::set_producer | ( | std::string_view | producer | ) |
Set the DW_AT_producer producer attribute.
This attribute aims to inform about the program that generated this compilation unit (e.g. LIEF Extended)
References CompilationUnit(), and LIEF_LIFETIMEBOUND.