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 = pdb::PDB::open(file)?;
let symbol_table = pdb.global_symbols()?;
let mut symbols = symbol_table.iter();
while let Some(symbol) = symbols.next()? {
match symbol.parse() {
Ok(pdb::SymbolData::PublicSymbol(data)) if data.function => {
// we found the location of a function!
println!("{:x}:{:08x} is {}", data.segment, data.offset, symbol.name()?);
}
_ => {}
}
}
Re-exports
pub use fallible_iterator::FallibleIterator;
Structs
The information parsed from a symbol record with kind
S_ANNOTATIONREF
.The information parsed from a type record with kind
LF_ARGLIST
.The information parsed from a type record with kind
LF_ARRAY
, LF_ARRAY_ST
or LF_STRIDED_ARRAY
.The information parsed from a type record with kind
LF_BCLASS
or LF_BINTERFACE
.The information parsed from a type record with kind
LF_BITFIELD
.The information parsed from a type record with kind
LF_CLASS
, LF_CLASS_ST
, LF_STRUCTURE
, LF_STRUCTURE_ST
or LF_INTERFACE
.The information parsed from a symbol record with kind
S_CONSTANT
, or S_CONSTANT_ST
.The information parsed from a symbol record with kind
S_DATAREF
or S_DATAREF_ST
.The information parsed from a symbol record with kind
S_LDATA32
, S_LDATA32_ST
, S_GDATA32
, S_GDATA32_ST
,
S_LMANDATA
, S_LMANDATA_ST
, S_GMANDATA
, or S_GMANDATA_ST
.Provides access to the “DBI” stream inside the PDB.
The information parsed from a type record with kind
LF_ENUMERATE
or LF_ENUMERATE_ST
.The information parsed from a type record with kind
LF_ENUM
or LF_ENUM_ST
.The information parsed from a type record with kind
LF_FIELDLIST
.The information parsed from a type record with kind
LF_MFUNCTION
.The information parsed from a type record with kind
LF_MEMBER
or LF_MEMBER_ST
.The information parsed from a type record with kind
LF_METHODLIST
.An entry in a
MethodList
.The information parsed from a type record with kind
LF_ONEMETHOD
or LF_ONEMETHOD_ST
.The information parsed from a type record with kind
LF_MODIFIER
.Represents a module from the DBI stream.
This struct contains data about a single module from its module info stream.
A
ModuleIter
iterates over the modules in the DBI section, producing Module
s.The information parsed from a type record with kind
LF_NESTTYPE
, LF_NESTTYPE_ST
, LF_NESTTYPEEX
, or LF_NESTTYPEEX_ST
.The information parsed from a type record with kind
LF_METHOD
or LF_METHOD_ST
.PDB
provides access to the data within a PDB file.A PDB info stream header parsed from a stream.
The information parsed from a type record with kind
LF_POINTER
.Represents a primitive type like
void
or char *
.The information parsed from a symbol record with kind
S_PROCREF
, S_PROCREF_ST
, S_LPROCREF
, or S_LPROCREF_ST
.The information parsed from a type record with kind
LF_PROCEDURE
.The information parsed from a symbol record with kind
S_PUB32
or S_PUB32_ST
.RawString
refers to a &[u8]
that physically resides somewhere inside a PDB data structure.Represents an offset + size of the source file.
The information parsed from a type record with kind
LF_STMEMBER
or LF_STMEMBER_ST
.A named stream contained within the PDB file.
A list of named streams contained within the PDB file.
Represents a symbol from the symbol table.
A
SymbolIter
iterates over a SymbolTable
, producing Symbol
s.PDB symbol tables contain names, locations, and metadata about functions, global/static data,
constants, data types, and more.
The information parsed from a symbol record with kind
S_LTHREAD32
, S_LTHREAD32_ST
, S_GTHREAD32
, or S_GTHREAD32_ST
.Represents a type from the type table. A
Type
has been minimally processed and may not be
correctly formed or even understood by this library.A
TypeFinder
is a secondary, in-memory data structure that permits efficiently finding types
by TypeIndex
. It starts out empty and must be populated by calling update(&TypeIter)
while
iterating.TypeInformation
provides zero-copy access to a PDB type data stream.A
TypeIter
iterates over a TypeInformation
, producing Types
s.The information parsed from a type record with kind
LF_UNION
or LF_UNION_ST
.The information parsed from a symbol record with kind
S_UDT
, or S_UDT_ST
.The information parsed from a type record with kind
LF_VBCLASS
or LF_IVBCLASS
.The information parsed from a type record with kind
LF_VFUNCTAB
.Enums
Used by
ClassType
to distinguish class-like concepts.An error that occurred while reading or parsing the PDB.
SymbolData
contains the information parsed from a symbol record.Encapsulates parsed data about a
Type
.Traits
The
pdb
crate accesses PDB files via the pdb::Source
trait.An owned, droppable, read-only view of the source file which can be referenced as a byte slice.