LIEF: Library to Instrument Executable Formats Version 0.17.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 (const std::string &producer) |
Set the DW_AT_producer producer attribute. | |
std::unique_ptr< Function > | create_function (const std::string &name) |
Create a new function owned by this compilation unit. | |
std::unique_ptr< Variable > | create_variable (const std::string &name) |
Create a new global variable owned by this compilation unit. | |
std::unique_ptr< Type > | create_generic_type (const std::string &name) |
Create a DW_TAG_unspecified_type type with the given name. | |
std::unique_ptr< EnumType > | create_enum (const std::string &name) |
Create an enum type (DW_TAG_enumeration_type ) | |
std::unique_ptr< TypeDef > | create_typedef (const std::string &name, const Type &type) |
Create a typdef with the name provided in the first parameter which aliases the type provided in the second parameter. | |
std::unique_ptr< StructType > | create_structure (const std::string &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 (const std::string &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 (const std::string &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_void_type () |
Create a void type. | |
std::unique_ptr< ArrayType > | create_array (const std::string &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 |
LIEF::dwarf::editor::CompilationUnit::CompilationUnit | ( | std::unique_ptr< details::CompilationUnit > | impl | ) |
LIEF::dwarf::editor::CompilationUnit::~CompilationUnit | ( | ) |
std::unique_ptr< ArrayType > LIEF::dwarf::editor::CompilationUnit::create_array | ( | const std::string & | name, |
const Type & | type, | ||
size_t | count ) |
Create an array type with the given name, type and size.
std::unique_ptr< BaseType > LIEF::dwarf::editor::CompilationUnit::create_base_type | ( | const std::string & | name, |
size_t | size, | ||
BaseType::ENCODING | encoding = BaseType::ENCODING::NONE ) |
Create a primitive type with the given name and size.
std::unique_ptr< EnumType > LIEF::dwarf::editor::CompilationUnit::create_enum | ( | const std::string & | name | ) |
Create an enum type (DW_TAG_enumeration_type
)
std::unique_ptr< Function > LIEF::dwarf::editor::CompilationUnit::create_function | ( | const std::string & | name | ) |
Create a new function owned by this compilation unit.
std::unique_ptr< FunctionType > LIEF::dwarf::editor::CompilationUnit::create_function_type | ( | const std::string & | name | ) |
Create a function type with the given name.
std::unique_ptr< Type > LIEF::dwarf::editor::CompilationUnit::create_generic_type | ( | const std::string & | name | ) |
Create a DW_TAG_unspecified_type
type with the given name.
|
inline |
Create a pointer on the provided type.
References LIEF::dwarf::editor::Type::pointer_to().
std::unique_ptr< StructType > LIEF::dwarf::editor::CompilationUnit::create_structure | ( | const std::string & | name, |
StructType::TYPE | kind = StructType::TYPE::STRUCT ) |
Create a struct-like type (struct, class, union) with the given name.
std::unique_ptr< TypeDef > LIEF::dwarf::editor::CompilationUnit::create_typedef | ( | const std::string & | name, |
const Type & | type ) |
Create a typdef with the name provided in the first parameter which aliases the type provided in the second parameter.
std::unique_ptr< Variable > LIEF::dwarf::editor::CompilationUnit::create_variable | ( | const std::string & | name | ) |
Create a new global variable owned by this compilation unit.
std::unique_ptr< Type > LIEF::dwarf::editor::CompilationUnit::create_void_type | ( | ) |
Create a void
type.
CompilationUnit & LIEF::dwarf::editor::CompilationUnit::set_producer | ( | const std::string & | 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
)