Crate pdb2

source ·
Expand description

The pdb create parses Microsoft PDB (Program Database) files. PDB files contain debugging information produced by most compilers that target Windows, including information about symbols, types, modules, and so on.

Usage

PDB files are accessed via the pdb::PDB object.

Example

let file = std::fs::File::open("fixtures/self/foo.pdb")?;
let mut pdb = pdb2::PDB::open(file)?;

let symbol_table = pdb.global_symbols()?;
let address_map = pdb.address_map()?;

let mut symbols = symbol_table.iter();
while let Some(symbol) = symbols.next()? {
    match symbol.parse() {
        Ok(pdb2::SymbolData::Public(data)) if data.function => {
            // we found the location of a function!
            let rva = data.offset.to_rva(&address_map).unwrap_or_default();
            println!("{} is {}", rva, data.name);
        }
        _ => {}
    }
}

Re-exports

Structs

Enums

Traits

Type Definitions