Table of Contents

Class PdbImage

Namespace
AsmResolver.Symbols.Pdb
Assembly
AsmResolver.Symbols.Pdb.dll

Represents a single Program Debug Database (PDB) image.

public class PdbImage : ICodeViewSymbolProvider
Inheritance
PdbImage
Implements
Derived
Inherited Members

Properties

Age

Gets or sets the number of times the PDB file has been written.

public uint Age { get; set; }

Property Value

uint

Attributes

Gets or sets attributes associated to the DBI stream.

public DbiAttributes Attributes { get; set; }

Property Value

DbiAttributes

BuildMajorVersion

Gets or sets the major version of the toolchain that was used to build the program.

public byte BuildMajorVersion { get; set; }

Property Value

byte

BuildMinorVersion

Gets or sets the minor version of the toolchain that was used to build the program.

public byte BuildMinorVersion { get; set; }

Property Value

byte

Machine

Gets or sets the machine type the program was compiled for.

public MachineType Machine { get; set; }

Property Value

MachineType

Modules

Gets a collection of all modules stored in the PDB image.

public IList<PdbModule> Modules { get; }

Property Value

IList<PdbModule>

PdbDllVersion

Gets or sets the version number of mspdbXXXX.dll that was used to produce this PDB file.

public ushort PdbDllVersion { get; set; }

Property Value

ushort

Symbols

Gets the list of defined symbols.

public IList<ICodeViewSymbol> Symbols { get; }

Property Value

IList<ICodeViewSymbol>

Timestamp

Gets or sets the time-stamp of the PDB file.

public DateTime Timestamp { get; set; }

Property Value

DateTime

UniqueId

Gets or sets the unique identifier assigned to the PDB file.

public Guid UniqueId { get; set; }

Property Value

Guid

Methods

FromBytes(byte[])

Interprets a byte array as a PDB image.

public static PdbImage FromBytes(byte[] data)

Parameters

data byte[]

The data to interpret.

Returns

PdbImage

The read PDB image.

FromBytes(byte[], PdbReaderParameters)

Interprets a byte array as a PDB image.

public static PdbImage FromBytes(byte[] data, PdbReaderParameters readerParameters)

Parameters

data byte[]

The data to interpret.

readerParameters PdbReaderParameters

The parameters to use while reading the PDB image.

Returns

PdbImage

The read PDB image.

FromFile(IInputFile)

Reads a PDB image from the provided input file.

public static PdbImage FromFile(IInputFile file)

Parameters

file IInputFile

The input file.

Returns

PdbImage

The read PDB image.

FromFile(IInputFile, PdbReaderParameters)

Reads a PDB image from the provided input file.

public static PdbImage FromFile(IInputFile file, PdbReaderParameters readerParameters)

Parameters

file IInputFile

The input file.

readerParameters PdbReaderParameters

The parameters to use while reading the PDB image.

Returns

PdbImage

The read PDB image.

FromFile(MsfFile)

Loads a PDB image from the provided MSF file.

public static PdbImage FromFile(MsfFile file)

Parameters

file MsfFile

The MSF file.

Returns

PdbImage

The read PDB image.

FromFile(MsfFile, PdbReaderParameters)

Loads a PDB image from the provided MSF file.

public static PdbImage FromFile(MsfFile file, PdbReaderParameters readerParameters)

Parameters

file MsfFile

The MSF file.

readerParameters PdbReaderParameters

The parameters to use while reading the PDB image.

Returns

PdbImage

The read PDB image.

FromFile(string)

Reads a PDB image from the provided input file.

public static PdbImage FromFile(string path)

Parameters

path string

The path to the PDB file.

Returns

PdbImage

The read PDB image.

FromFile(string, PdbReaderParameters)

Reads a PDB image from the provided input file.

public static PdbImage FromFile(string path, PdbReaderParameters readerParameters)

Parameters

path string

The path to the PDB file.

readerParameters PdbReaderParameters

The parameters to use while reading the PDB image.

Returns

PdbImage

The read PDB image.

FromReader(BinaryStreamReader)

Reads an PDB image from the provided input stream reader.

public static PdbImage FromReader(BinaryStreamReader reader)

Parameters

reader BinaryStreamReader

The reader.

Returns

PdbImage

The read PDB image.

FromReader(BinaryStreamReader, PdbReaderParameters)

Reads an PDB image from the provided input stream reader.

public static PdbImage FromReader(BinaryStreamReader reader, PdbReaderParameters readerParameters)

Parameters

reader BinaryStreamReader

The reader.

readerParameters PdbReaderParameters

The parameters to use while reading the PDB image.

Returns

PdbImage

The read PDB image.

GetIdLeafRecord(uint)

Obtains an ID record from the IPI stream based on its ID index.

public IIpiLeaf GetIdLeafRecord(uint idIndex)

Parameters

idIndex uint

The ID index.

Returns

IIpiLeaf

The resolved leaf

Exceptions

ArgumentException

Occurs when the ID index is invalid.

GetIdLeafRecord<TLeaf>(uint)

Obtains an ID record from the IPI stream based on its ID index.

public TLeaf GetIdLeafRecord<TLeaf>(uint idIndex) where TLeaf : CodeViewLeaf

Parameters

idIndex uint

The ID index.

Returns

TLeaf

The resolved leaf

Type Parameters

TLeaf

Exceptions

ArgumentException

Occurs when the ID index is invalid.

GetIdLeafRecords()

Obtains all records stored in the original IPI stream of the PDB image.

public virtual IEnumerable<IIpiLeaf> GetIdLeafRecords()

Returns

IEnumerable<IIpiLeaf>

An object that lazily enumerates all IPI leaf records.

GetLeafRecord(uint)

Obtains a type record from the TPI stream based on its type index.

public ITpiLeaf GetLeafRecord(uint typeIndex)

Parameters

typeIndex uint

The type index.

Returns

ITpiLeaf

The resolved type.

Exceptions

ArgumentException

Occurs when the type index is invalid.

GetLeafRecord<TLeaf>(uint)

Obtains a type record from the TPI stream based on its type index.

public TLeaf GetLeafRecord<TLeaf>(uint typeIndex) where TLeaf : ITpiLeaf

Parameters

typeIndex uint

The type index.

Returns

TLeaf

The resolved type.

Type Parameters

TLeaf

Exceptions

ArgumentException

Occurs when the type index is invalid.

GetLeafRecords()

Obtains all records stored in the original TPI stream of the PDB image.

public virtual IEnumerable<ITpiLeaf> GetLeafRecords()

Returns

IEnumerable<ITpiLeaf>

An object that lazily enumerates all TPI leaf records.

GetModules()

Obtains a collection of modules stored in the DBI stream of the PDB image.

protected virtual IList<PdbModule> GetModules()

Returns

IList<PdbModule>

The modules.

Remarks

This method is called upon initialization of the Modules property.

GetSymbols()

Obtains a collection of symbols stored in the symbol record stream of the PDB image.

protected virtual IList<ICodeViewSymbol> GetSymbols()

Returns

IList<ICodeViewSymbol>

The symbols.

Remarks

This method is called upon initialization of the Symbols property.

TryGetIdLeafRecord(uint, out IIpiLeaf?)

Attempts to obtain an ID record from the IPI stream based on its ID index.

public virtual bool TryGetIdLeafRecord(uint idIndex, out IIpiLeaf? leaf)

Parameters

idIndex uint

The ID index.

leaf IIpiLeaf

The resolved leaf.

Returns

bool

true if the leaf was found, false otherwise.

TryGetIdLeafRecord<TLeaf>(uint, out TLeaf?)

Attempts to obtain an ID record from the IPI stream based on its ID index.

public bool TryGetIdLeafRecord<TLeaf>(uint idIndex, out TLeaf? leaf) where TLeaf : IIpiLeaf

Parameters

idIndex uint

The ID index.

leaf TLeaf

The resolved leaf.

Returns

bool

true if the leaf was found, false otherwise.

Type Parameters

TLeaf

TryGetLeafRecord(uint, out ITpiLeaf?)

Attempts to obtain a type record from the TPI stream based on its type index.

public virtual bool TryGetLeafRecord(uint typeIndex, out ITpiLeaf? leaf)

Parameters

typeIndex uint

The type index.

leaf ITpiLeaf

The resolved type.

Returns

bool

true if the type was found, false otherwise.

TryGetLeafRecord<TLeaf>(uint, out TLeaf?)

Attempts to obtain a type record from the TPI stream based on its type index.

public bool TryGetLeafRecord<TLeaf>(uint typeIndex, out TLeaf? leaf) where TLeaf : ITpiLeaf

Parameters

typeIndex uint

The type index.

leaf TLeaf

The resolved type.

Returns

bool

true if the type was found, false otherwise.

Type Parameters

TLeaf