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§
- Annotation
Reference Symbol - The information parsed from a symbol record with kind
S_ANNOTATIONREF. - Argument
List - The information parsed from a type record with kind
LF_ARGLIST. - Array
Type - The information parsed from a type record with kind
LF_ARRAY,LF_ARRAY_STorLF_STRIDED_ARRAY. - Base
Class Type - The information parsed from a type record with kind
LF_BCLASSorLF_BINTERFACE. - Bitfield
Type - The information parsed from a type record with kind
LF_BITFIELD. - Class
Type - The information parsed from a type record with kind
LF_CLASS,LF_CLASS_ST,LF_STRUCTURE,LF_STRUCTURE_STorLF_INTERFACE. - Compile3
Symbol - The information parsed from a symbol record with kind
S_COMPILE3 - Constant
Symbol - The information parsed from a symbol record with kind
S_CONSTANT, orS_CONSTANT_ST. - Data
Reference Symbol - The information parsed from a symbol record with kind
S_DATAREForS_DATAREF_ST. - Data
Symbol - 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, orS_GMANDATA_ST. - Debug
Information - Provides access to the “DBI” stream inside the PDB.
- Enumerate
Type - The information parsed from a type record with kind
LF_ENUMERATEorLF_ENUMERATE_ST. - Enumeration
Type - The information parsed from a type record with kind
LF_ENUMorLF_ENUM_ST. - Field
Attributes - Field
List - The information parsed from a type record with kind
LF_FIELDLIST. - Function
Attributes - Member
Function Type - The information parsed from a type record with kind
LF_MFUNCTION. - Member
Type - The information parsed from a type record with kind
LF_MEMBERorLF_MEMBER_ST. - Method
List - The information parsed from a type record with kind
LF_METHODLIST. - Method
List Entry - An entry in a
MethodList. - Method
Type - The information parsed from a type record with kind
LF_ONEMETHODorLF_ONEMETHOD_ST. - Modifier
Type - The information parsed from a type record with kind
LF_MODIFIER. - Module
- Represents a module from the DBI stream.
- Module
Info - This struct contains data about a single module from its module info stream.
- Module
Iter - A
ModuleIteriterates over the modules in the DBI section, producingModules. - Namespace
Symbol - The information parsed from a symbol record with kind
S_UNAMESPACE, orS_UNAMESPACE_ST. - Nested
Type - The information parsed from a type record with kind
LF_NESTTYPE,LF_NESTTYPE_ST,LF_NESTTYPEEX, orLF_NESTTYPEEX_ST. - ObjName
Symbol - The information parsed from a symbol record with kind
S_OBJNAME, orS_OBJNAME_ST. - Overloaded
Method Type - The information parsed from a type record with kind
LF_METHODorLF_METHOD_ST. - PDB
PDBprovides access to the data within a PDB file.- PDBInformation
- A PDB info stream header parsed from a stream.
- Pointer
Attributes - Pointer
Type - The information parsed from a type record with kind
LF_POINTER. - Primitive
Type - Represents a primitive type like
voidorchar *. - Procedure
Flags - The information parsed from a CV_PROCFLAGS bit field
- Procedure
Reference Symbol - The information parsed from a symbol record with kind
S_PROCREF,S_PROCREF_ST,S_LPROCREF, orS_LPROCREF_ST. - Procedure
Symbol - The information parsed from a symbol record with kind
S_GPROC32,S_GPROC32_ST,S_LPROC32,S_LPROC32_STS_GPROC32_ID,S_LPROC32_ID,S_LPROC32_DPC, orS_LPROC32_DPC_ID - Procedure
Type - The information parsed from a type record with kind
LF_PROCEDURE. - Public
Symbol - The information parsed from a symbol record with kind
S_PUB32orS_PUB32_ST. - RawString
RawStringrefers to a&[u8]that physically resides somewhere inside a PDB data structure.- Source
Slice - Represents an offset + size of the source file.
- Static
Member Type - The information parsed from a type record with kind
LF_STMEMBERorLF_STMEMBER_ST. - Stream
Name - A named stream contained within the PDB file.
- Stream
Names - A list of named streams contained within the PDB file.
- Symbol
- Represents a symbol from the symbol table.
- Symbol
Iter - A
SymbolIteriterates over aSymbolTable, producingSymbols. - Symbol
Table - PDB symbol tables contain names, locations, and metadata about functions, global/static data, constants, data types, and more.
- Thread
Storage Symbol - The information parsed from a symbol record with kind
S_LTHREAD32,S_LTHREAD32_ST,S_GTHREAD32, orS_GTHREAD32_ST. - Type
- Represents a type from the type table. A
Typehas been minimally processed and may not be correctly formed or even understood by this library. - Type
Finder - A
TypeFinderis a secondary, in-memory data structure that permits efficiently finding types byTypeIndex. It starts out empty and must be populated by callingupdate(&TypeIter)while iterating. - Type
Information TypeInformationprovides zero-copy access to a PDB type data stream.- Type
Iter - A
TypeIteriterates over aTypeInformation, producingTypess. - Type
Properties - Union
Type - The information parsed from a type record with kind
LF_UNIONorLF_UNION_ST. - User
Defined Type Symbol - The information parsed from a symbol record with kind
S_UDT, orS_UDT_ST. - Virtual
Base Class Type - The information parsed from a type record with kind
LF_VBCLASSorLF_IVBCLASS. - Virtual
Function Table Pointer Type - The information parsed from a type record with kind
LF_VFUNCTAB.
Enums§
- Class
Kind - Used by
ClassTypeto distinguish class-like concepts. - Error
- An error that occurred while reading or parsing the PDB.
- Indirection
- Machine
Type - The target machine’s architecture. Reference: https://docs.microsoft.com/en-us/windows/desktop/debug/pe-format#machine-types
- Primitive
Kind - Symbol
Data SymbolDatacontains the information parsed from a symbol record.- Type
Data - Encapsulates parsed data about a
Type. - Variant
Traits§
- Source
- The
pdbcrate accesses PDB files via thepdb::Sourcetrait. - Source
View - An owned, droppable, read-only view of the source file which can be referenced as a byte slice.