PDB and DWARF share similar traits which are abstracted by the following classes: This class provides a generic interface for accessing debug information from different formats such as DWARF and PDB. Users can use this interface to access high-level debug features like resolving function addresses. Subclassed by LIEF::dwarf::DebugInfo, LIEF::pdb::DebugInfo Public Functions This function can be used to down cast a DebugInfo instance: Attempt to resolve the address of the function specified by Friends This structure holds a debug location (source filename & line). Configuration options for generated code from debug info. This structure configures how the debug information (DWARF/PDB) translated into an AST is generated. You can use it to configure the indentation, and the information to generate when translating DWARF/PDB into C++-like definitions Public Types Mapping between a type name and a user-friendly aliases. (e.g. Public Functions The number of spaces for indentation. Prefer C++ syntax over C syntax. If true, the output will use C++ features (e.g. Enable extended comments and annotations. If true, the generated code will include comments containing low-level details such as memory addresses, offsets, type sizes, and original source locations. Include full type definitions. If true, the output will contain the full definition of types (structs, enums, unions). Emit a function body listing its local / stack variables. Resolve type aliases (sugar). If true, typedef and type aliases are replaced by their underlying canonical types (e.g., Show the relative offset of each field/attribute in structures. If true, every member of a structure is prefixed with its byte offset, Mapping of type names to user-friendly aliases. C++¶
DebugInfo¶
inline const T *as() const¶std::unique_ptr<LIEF::Instruction> dbg = bin->debug_info();
if (const auto* dwarf = inst->as<LIEF::dwarf::DebugInfo>()) {
dwarf->find_function("main");
}
name.debug_location_t¶
DeclOpt¶
std::basic_string<char,std::char_traits<char>,std::allocator<char>> -> std::string).bool keyword)uint32_t might become unsigned int).struct Foo {
/* 0x00 *‍/ int A;
/* 0x04 *‍/ int B;
};
Bases: object
This class provides a generic interface for accessing debug information from different formats such as DWARF and PDB.
Users can use this interface to access high-level debug features like resolving function addresses.
See: DebugInfo, lief.dwarf.DebugInfo
Bases: Enum
Attempt to resolve the address of the function specified by name.
The actual debug format (PDB/DWARF)
Bases: object
Configuration options for generated code from debug info.
This structure configures how the debug information (DWARF/PDB) translated into an AST is generated. You can use it to configure the indentation, and the information to generate when translating DWARF/PDB into C++-like definitions
Register a single type alias (see type_aliases).
Resolve type aliases (sugar).
If true, typedef and type aliases are replaced by their underlying canonical types (e.g., uint32_t might become unsigned int).
Emit a function body listing its local / stack variables.
Include full type definitions.
If true, the output will contain the full definition of types (structs, enums, unions).
The number of spaces for indentation.
Prefer C++ syntax over C syntax.
If true, the output will use C++ features (e.g., bool keyword)
Enable extended comments and annotations.
If true, the generated code will include comments containing low-level details such as memory addresses, offsets, type sizes, and original source locations.
Show the relative offset of each field/attribute in structures.
If true, every member of a structure is prefixed with its byte offset (e.g. /* 0x04 */).
Mapping of type names to user-friendly aliases used while rendering types (e.g. std::basic_string<char, ...> -> std::string).