Skip to content

Commit

Permalink
Small PDB parsing fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
RazrFalcon committed Dec 30, 2021
1 parent 05f7955 commit 0aa1e2b
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -990,12 +990,16 @@ fn collect_pdb_data(pdb_path: &path::Path, text_size: u64) -> Result<Data, Error
.map(|(_, mangled_name)| {
binfarce::demangle::SymbolName::demangle(mangled_name)
})
// Assume the Symbol record name is unmangled if we didn't find one
.unwrap_or(binfarce::demangle::SymbolName {
// Assume the Symbol record name is unmangled if we didn't find one.
// Note that unmangled names stored in PDB have a different format from
// one stored in binaries itself. Specifically they do not include hash
// and can have a bit different formatting.
// We also assume that a Legacy mangling scheme were used.
.unwrap_or_else(|| binfarce::demangle::SymbolName {
complete: unmangled_name.clone(),
trimmed: unmangled_name.clone(),
crate_name: None,
kind: binfarce::demangle::Kind::V0,
kind: binfarce::demangle::Kind::Legacy,
}),
address: address.0 as u64,
size,
Expand Down

0 comments on commit 0aa1e2b

Please sign in to comment.