Struct gimli::DebugInfo [] [src]

pub struct DebugInfo<'input, Endian> where Endian: Endianity {
    // some fields omitted
}

The DebugInfo struct represents the DWARF debugging information found in the .debug_info section.

Methods

impl<'input, Endian> DebugInfo<'input, Endian> where Endian: Endianity
[src]

fn new(debug_info_section: &'input [u8]) -> DebugInfo<'input, Endian>

Construct a new DebugInfo instance from the data in the .debug_info section.

It is the caller's responsibility to read the .debug_info section and present it as a &[u8] slice. That means using some ELF loader on Linux, a Mach-O loader on OSX, etc.

use gimli::{DebugInfo, LittleEndian};

let debug_info = DebugInfo::<LittleEndian>::new(read_debug_info_section_somehow());

fn compilation_units(&self) -> CompilationUnitsIter<'input, Endian>

Iterate the compilation units in this .debug_info section.

use gimli::{DebugInfo, LittleEndian};

let debug_info = DebugInfo::<LittleEndian>::new(read_debug_info_section_somehow());

for parse_result in debug_info.compilation_units() {
    let unit = parse_result.unwrap();
    println!("unit's length is {}", unit.unit_length());
}