Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion examples/pdb_symbols.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use std::env;

use getopts::Options;
use pdb::{FallibleIterator, PdbInternalSectionOffset};
use pdb::{FallibleIterator, PdbInternalSectionOffset, RawString};

fn print_usage(program: &str, opts: Options) {
let brief = format!("Usage: {} input.pdb", program);
Expand All @@ -26,6 +26,15 @@ fn print_symbol(symbol: &pdb::Symbol<'_>) -> pdb::Result<()> {
pdb::SymbolData::Procedure(data) => {
print_row(data.offset, "function", data.name);
}
pdb::SymbolData::ManagedProcedure(data) => {
match data.name {
None => print_row(data.offset, "function", RawString::from(&b"<empty>"[..])),
Some(name) => print_row(data.offset, "function", name),
}
}
pdb::SymbolData::ManagedSlot(data) => {
print_row(data.offset, "data", data.name);
}
_ => {
// ignore everything else
}
Expand Down
8 changes: 8 additions & 0 deletions src/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -605,6 +605,14 @@ impl_pread!(TypeIndex);

impl ItemIndex for TypeIndex {}

/// COM+ metadata token for managed procedures (`CV_tkn_t`).
#[derive(Clone, Copy, Default, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct COMToken(pub u32);

impl_convert!(COMToken, u32);
impl_hex_fmt!(COMToken);
impl_pread!(COMToken);

/// Index of an [`Id`](crate::Id) in [`IdInformation`](crate::IdInformation) stream.
///
/// If this index is a [cross module reference](ItemIndex::is_cross_module), it must be resolved
Expand Down
Loading