Crate pdb[−][src]
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 address_map = pdb.address_map()?; let mut symbols = symbol_table.iter(); while let Some(symbol) = symbols.next()? { match symbol.parse() { Ok(pdb::SymbolData::Public(data)) if data.function => { // we found the location of a function! let rva = data.offset.to_rva(&address_map).unwrap_or_default(); println!("{} is {}", rva, data.name); } _ => {} } }
Re-exports
pub use fallible_iterator::FallibleIterator; |
Structs
AddressMap | A mapping between addresses and offsets used in the PDB and PE file. |
AnnotationReferenceSymbol | Reference to an annotation. |
ArgumentList | The information parsed from a type record with kind |
ArrayType | The information parsed from a type record with kind
|
BaseClassType | The information parsed from a type record with kind |
BinaryAnnotations | Binary annotations of a symbol. |
BinaryAnnotationsIter | An iterator over binary annotations used by |
BitfieldType | The information parsed from a type record with kind |
BlockSymbol | A block symbol. |
BuildInfoId | Tool, version and command line build information. |
BuildInfoSymbol | Reference to build information. |
ClassType | The information parsed from a type record with kind
|
CompileFlags | Compile flags declared in |
CompileFlagsSymbol | Flags used to compile a module. |
CompilerVersion | A version number refered to by |
ConstantSymbol | A constant value. |
CrossModuleExportIter | Iterator returned by |
CrossModuleExports | A table of exports declared by this module. |
CrossModuleImports | Provides efficient access to imported types and IDs from other modules. |
CrossModuleRef | Reference to a local type or id in another module. |
DBISectionContribution | Information about a module’s contribution to a section.
|
DBISectionContributionIter | A |
DataReferenceSymbol | Reference to an imported variable. |
DataSymbol | Static data, such as a global variable. |
DebugInformation | Provides access to the “DBI” stream inside the PDB. |
EnumerateType | The information parsed from a type record with kind |
EnumerationType | The information parsed from a type record with kind |
ExportSymbol | An exported symbol. |
ExportSymbolFlags | Flags of an |
FieldAttributes | |
FieldList | The information parsed from a type record with kind |
FileIndex | Index of a file entry in the module. |
FileInfo | Information record on a source file. |
FileIterator | An iterator over file records in a module. |
FrameData | Frame data for a code block. |
FrameDataIter | Iterator over entries in a |
FrameTable | Describes stack frame layout of functions. |
FunctionAttributes | |
FunctionId | Global function, usually inlined. |
IdIndex | Index of an |
ImageSectionHeader | A PE |
InlineSiteSymbol | The callsite of an inlined function. |
Inlinee | An inlined function that can evaluate to line information. |
InlineeIterator | An iterator over line information records in a module. |
InlineeLineIterator | An iterator over line information records in a module. |
Item | Represents an entry in the type or id stream. |
ItemFinder | In-memory index for efficient random-access to |
ItemInformation | Zero-copy access to a PDB type or id stream. |
ItemIter | An iterator over items in |
LabelSymbol | A label symbol. |
LineInfo | Mapping of a source code offset to a source file location. |
LineIterator | An iterator over line information records in a module. |
LineProgram | The |
Local | An |
LocalSymbol | A local symbol in optimized code. |
LocalVariableFlags | Flags for a |
MemberFunctionId | Member function, usually inlined. |
MemberFunctionType | The information parsed from a type record with kind |
MemberType | The information parsed from a type record with kind |
MethodList | The information parsed from a type record with kind |
MethodListEntry | An entry in a |
MethodType | The information parsed from a type record with kind |
ModifierType | The information parsed from a type record with kind |
Module | Represents a module from the DBI stream. |
ModuleInfo | This struct contains data about a single module from its module info stream. |
ModuleIter | A |
ModuleRef | Named reference to a |
MultiRegisterVariableSymbol | A Register variable spanning multiple registers. |
NestedType | The information parsed from a type record with kind
|
ObjNameSymbol | Name of the object file of this module. |
OverloadedMethodType | The information parsed from a type record with kind |
PDB |
|
PDBInformation | A PDB info stream header parsed from a stream. |
PdbInternalRva | A Relative Virtual Address in an unoptimized PE file. |
PdbInternalRvaRangeIter | Iterator over |
PdbInternalSectionOffset | An offset relative to a PE section in the original unoptimized binary. |
PointerAttributes | |
PointerType | The information parsed from a type record with kind |
PrimitiveType | Represents a primitive type like |
ProcedureFlags | Flags of a |
ProcedureReferenceSymbol | Reference to an imported procedure. |
ProcedureSymbol | A procedure, such as a function or method. |
ProcedureType | The information parsed from a type record with kind |
PublicSymbol | A public symbol with a mangled name. |
RawString |
|
Register | A register referred to by its number. |
RegisterRelativeSymbol | A register relative symbol. |
RegisterVariableSymbol | A Register variable. |
Rva | A Relative Virtual Address as it appears in a PE file. |
RvaRangeIter | Iterator over |
SectionOffset | An offset relative to a PE section. |
SeparatedCodeFlags | Flags for a |
SeparatedCodeSymbol | A separated code symbol. |
SourceSlice | Represents an offset + size of the source file. |
StaticMemberType | The information parsed from a type record with kind |
StreamIndex | Index of a PDB stream. |
StreamName | A named stream contained within the PDB file. |
StreamNames | A list of named streams contained within the PDB file. |
StringId | A string. |
StringListId | A list of substrings. |
StringRef | A reference to a string in the string table. |
StringTable | The global string table of a PDB. |
Symbol | Represents a symbol from the symbol table. |
SymbolIndex | A reference into the symbol table of a module. |
SymbolIter | A |
SymbolTable | PDB symbol tables contain names, locations, and metadata about functions, global/static data, constants, data types, and more. |
ThreadStorageSymbol | A thread local variable. |
ThunkAdjustor | Thunk adjustor |
ThunkSymbol | A thunk symbol. |
TypeIndex | Index of |
TypeProperties | |
UnionType | The information parsed from a type record with kind |
UserDefinedTypeSourceId | Source and line of the definition of a User Defined Type (UDT). |
UserDefinedTypeSymbol | A user defined type. |
UsingNamespaceSymbol | A using namespace directive. |
VirtualBaseClassType | The information parsed from a type record with kind |
VirtualFunctionTablePointerType | The information parsed from a type record with kind |
Enums
BinaryAnnotation | Represents a parsed |
CPUType | These values correspond to the CV_CPU_TYPE_e enumeration, and are documented on MSDN. |
ClassKind | Used by |
CrossModuleExport | A cross module export that can either be a |
Error | An error that occurred while reading or parsing the PDB. |
FileChecksum | Checksum of a source file’s contents. |
FrameType | A compiler specific frame type. |
HeaderVersion | The version of the PDB format. |
IdData | Encapsulates parsed data about an |
Indirection | Pointer mode of primitive types. |
LineInfoKind | The kind of source construct a line info is referring to. |
MachineType | The target machine’s architecture. Reference: https://docs.microsoft.com/en-us/windows/desktop/debug/pe-format#machine-types |
PointerKind | The kind of a |
PointerMode | The mode of a |
PrimitiveKind | A simple type. |
SourceLanguage | These values correspond to the CV_CFL_LANG enumeration, and are documented on MSDN. |
SymbolData | Information parsed from a |
ThunkKind | A thunk kind |
TypeData | Encapsulates parsed data about a |
UserDefinedTypeSourceFileRef | A reference to the source file name of a |
Variant | Value of an enumerate type. |
Traits
ItemIndex | An index into either the |
Source | The |
SourceView | An owned, droppable, read-only view of the source file which can be referenced as a byte slice. |
Type Definitions
Id | Information on an inline function, build infos or source references. |
IdFinder | In-memory index for efficient random-access of |
IdInformation | Zero-copy access to the PDB type stream (TPI). |
IdIter | An iterator over |
NameIter | An iterator over |
Result | The result type returned by this crate. |
SymbolKind | The raw type discriminator for |
Type | Information on a primitive type, class, or procedure. |
TypeFinder | In-memory index for efficient random-access of |
TypeInformation | Zero-copy access to the PDB type stream (TPI). |
TypeIter | An iterator over |