Module dwarf
Expand description
Module for processing DWARF debug info
This module exposes an API similar to the crate::pdb module to process DWARF
debug info (embedded or not).
One can instantiate a crate::dwarf::DebugInfo using either crate::generic::Binary::debug_info or
crate::dwarf::load for external DWARF files.
fn from_binary(elf: &lief::elf::Binary) {
    if let Some(lief::DebugInfo::Dwarf(dwarf)) = elf.debug_info() {
        for complilation_unit in dwarf.compilation_units() {
            println!("{}", complilation_unit.name());
        }
    }
}
fn from_external(dwarf_file: &str) {
    let debug_info = lief::dwarf::load(dwarf_file).unwrap();
    for complilation_unit in debug_info.compilation_units() {
        println!("{}", complilation_unit.name());
    }
}Modules§
- compilation_
unit  - This module wraps DWARF compilation unit
 - debug_
info  - editor
 - function
 - parameters
 - scope
 - types
 - variable
 
Structs§
- Compilation
Unit  - A DWARF compilation unit
 - Debug
Info  - This class represents a DWARF debug information. It can embed different
compilation units which can be accessed through 
DebugInfo::compilation_units. - Editor
 - This structure exposes the main API to create DWARF information
 - Function
 - This structure represents a DWARF function which can be associated with either:
DW_TAG_subprogramorDW_TAG_inlined_subroutine. - Scope
 - This class materializes a scope in which Function, Variable, Type, … can be defined.
 - Variable
 - Return an iterator of the variable 
DW_TAG_variabledefined within the scope of this function. This includes regular stack-based variables as well as static ones. 
Enums§
- Parameters
 - Type
 - This enum represents a DWARF Type which includes:
 
Traits§
Functions§
- load
 - Load a DWARF from its file path