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_ST
orLF_STRIDED_ARRAY
. - Base
Class Type - The information parsed from a type record with kind
LF_BCLASS
orLF_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_ST
orLF_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_DATAREF
orS_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_ENUMERATE
orLF_ENUMERATE_ST
. - Enumeration
Type - The information parsed from a type record with kind
LF_ENUM
orLF_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_MEMBER
orLF_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_ONEMETHOD
orLF_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
ModuleIter
iterates over the modules in the DBI section, producingModule
s. - 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_METHOD
orLF_METHOD_ST
. - PDB
PDB
provides 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
void
orchar *
. - 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_ST
S_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_PUB32
orS_PUB32_ST
. - RawString
RawString
refers 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_STMEMBER
orLF_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
SymbolIter
iterates over aSymbolTable
, producingSymbol
s. - 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
Type
has been minimally processed and may not be correctly formed or even understood by this library. - Type
Finder - A
TypeFinder
is 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 TypeInformation
provides zero-copy access to a PDB type data stream.- Type
Iter - A
TypeIter
iterates over aTypeInformation
, producingTypes
s. - Type
Properties - Union
Type - The information parsed from a type record with kind
LF_UNION
orLF_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_VBCLASS
orLF_IVBCLASS
. - Virtual
Function Table Pointer Type - The information parsed from a type record with kind
LF_VFUNCTAB
.
Enums§
- Class
Kind - Used by
ClassType
to 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 SymbolData
contains the information parsed from a symbol record.- Type
Data - Encapsulates parsed data about a
Type
. - Variant
Traits§
- Source
- The
pdb
crate accesses PDB files via thepdb::Source
trait. - Source
View - An owned, droppable, read-only view of the source file which can be referenced as a byte slice.