Table of Contents

Class DbiStream

Namespace
AsmResolver.Symbols.Pdb.Metadata.Dbi
Assembly
AsmResolver.Symbols.Pdb.dll

Represents the DBI Stream (also known as the Debug Information stream).

public class DbiStream : SegmentBase, ISegment, IOffsetProvider, IWritable
Inheritance
DbiStream
Implements
Derived
Inherited Members

Constructors

DbiStream()

Creates a new empty DBI stream.

public DbiStream()

Fields

StreamIndex

Gets the default fixed MSF stream index for the DBI stream.

public const int StreamIndex = 3

Field Value

int

Properties

Age

Gets or sets the number of times the DBI stream 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

BuildNumber

Gets or sets a bitfield containing the major and minor version of the toolchain that was used to build the program.

public ushort BuildNumber { get; set; }

Property Value

ushort

ECStream

Gets or sets the contents of the Edit-and-Continue sub stream.

public ISegment? ECStream { get; set; }

Property Value

ISegment

Remarks

The exact purpose and layout of this sub stream is unknown, hence this property exposes the stream as a raw segment.

ExtraStreamIndices

Gets a collection of indices referring to additional debug streams in the MSF file.

public IList<ushort> ExtraStreamIndices { get; }

Property Value

IList<ushort>

GlobalStreamIndex

Gets or sets the MSF stream index of the Global Symbol Stream.

public ushort GlobalStreamIndex { get; set; }

Property Value

ushort

IsNewVersionFormat

Gets or sets a value indicating that the DBI stream is using the new file format (NewDBI).

public bool IsNewVersionFormat { get; set; }

Property Value

bool

Machine

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

public MachineType Machine { get; set; }

Property Value

MachineType

MfcTypeServerIndex

Gets or sets the MSF stream index of the MFC type server.

public uint MfcTypeServerIndex { get; set; }

Property Value

uint

Modules

Gets a collection of modules (object files) that were linked together into the program.

public IList<ModuleDescriptor> Modules { get; }

Property Value

IList<ModuleDescriptor>

PdbDllRbld

Unknown.

public ushort PdbDllRbld { get; set; }

Property Value

ushort

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

PublicStreamIndex

Gets or sets the MSF stream index of the Public Symbol Stream.

public ushort PublicStreamIndex { get; set; }

Property Value

ushort

SectionContributions

Gets a collection of section contributions describing the layout of the sections of the final executable file.

public IList<SectionContribution> SectionContributions { get; }

Property Value

IList<SectionContribution>

SectionMaps

Gets a collection of section mappings stored in the section mapping sub stream.

public IList<SectionMap> SectionMaps { get; }

Property Value

IList<SectionMap>

Remarks

The exact purpose of this is unknown, but it seems to be always containing a copy of the sections in the final executable file.

SourceFiles

Gets a collection of source files assigned to each module in Modules.

public IList<SourceFileCollection> SourceFiles { get; }

Property Value

IList<SourceFileCollection>

Remarks

Every collection of source files within this list corresponds to exactly the module within Modules at the same index. For example, the first source file list in this collection is the source file list of the first module.

SymbolRecordStreamIndex

Gets or sets the MSF stream index of the Symbol Record Stream.

public ushort SymbolRecordStreamIndex { get; set; }

Property Value

ushort

TypeServerMapStream

Gets or sets the contents of the type server map sub stream.

public ISegment? TypeServerMapStream { get; set; }

Property Value

ISegment

Remarks

The exact purpose and layout of this sub stream is unknown, hence this property exposes the stream as a raw segment.

VersionHeader

Gets or sets the version number of the DBI header.

public DbiStreamVersion VersionHeader { get; set; }

Property Value

DbiStreamVersion

Remarks

Modern tooling only recognize the VC7.0 file format.

VersionSignature

Gets or sets the version signature assigned to the DBI stream.

public int VersionSignature { get; set; }

Property Value

int

Remarks

This value should always be -1 for valid PDB files.

Methods

FromReader(BinaryStreamReader)

Reads a single DBI stream from the provided input stream.

public static DbiStream FromReader(BinaryStreamReader reader)

Parameters

reader BinaryStreamReader

The input stream.

Returns

DbiStream

The parsed DBI stream.

GetECStream()

Obtains the contents of the EC sub stream.

protected virtual ISegment? GetECStream()

Returns

ISegment

The contents of the sub stream.

Remarks

This method is called upon initialization of the ECStream property.

GetExtraStreamIndices()

Obtains the list of indices referring to additional debug streams in the MSF file.

protected virtual IList<ushort> GetExtraStreamIndices()

Returns

IList<ushort>

The list of indices.

Remarks

This method is called upon initialization of the ExtraStreamIndices property.

GetModules()

Obtains the list of module descriptors.

protected virtual IList<ModuleDescriptor> GetModules()

Returns

IList<ModuleDescriptor>

The module descriptors

Remarks

This method is called upon initialization of the Modules property.

GetPhysicalSize()

Computes the number of bytes that the structure contains.

public override uint GetPhysicalSize()

Returns

uint

The number of bytes.

GetSectionContributions()

Obtains the list of section contributions.

protected virtual IList<SectionContribution> GetSectionContributions()

Returns

IList<SectionContribution>

The section contributions.

Remarks

This method is called upon initialization of the SectionContributions property.

GetSectionMaps()

Obtains the list of section maps.

protected virtual IList<SectionMap> GetSectionMaps()

Returns

IList<SectionMap>

The section maps.

Remarks

This method is called upon initialization of the SectionMaps property.

GetSourceFiles()

Obtains a table that assigns a list of source files to every module referenced in the PDB file.

protected virtual IList<SourceFileCollection> GetSourceFiles()

Returns

IList<SourceFileCollection>

The table.

Remarks

This method is called upon initialization of the SourceFiles property.

GetTypeServerMapStream()

Obtains the contents of the type server map sub stream.

protected virtual ISegment? GetTypeServerMapStream()

Returns

ISegment

The contents of the sub stream.

Remarks

This method is called upon initialization of the TypeServerMapStream property.

Write(BinaryStreamWriter)

Serializes the structure to an output stream.

public override void Write(BinaryStreamWriter writer)

Parameters

writer BinaryStreamWriter

The output stream to write the data to.