Skip to content

Support portable (BSJB) PDB files #2

Description

@bobbyg603

Today PDBFile requires the legacy Windows MSF header (Microsoft C/C++ MSF 7.00) and throws on any other input, so portable PDBs are not supported. Portable PDBs begin with the BSJB metadata signature and are common for modern .NET assemblies (.NET Core/.NET 5+, and any project built with <DebugType>portable</DebugType>, which is the default).

When indexing an uploaded symbol set into a symsrv-layout store, a portable PDB currently raises Invalid PDB signature and gets skipped, so those modules fall back to nearest-export naming.

What is needed

Detect the file format by signature and add a portable-PDB reader:

  • MSF / Windows PDB — starts with Microsoft C/C++ MSF 7.00\r\n\x1ADS (current PDBFile path).
  • Portable PDB — starts with BSJB. The symbol-store key is derived from the 20-byte PDB id (#Pdb stream / MetadataReader.DebugMetadataHeader.Id): the first 16 bytes as a GUID (N format) followed by the literal age FFFFFFFF, i.e. {guid:N}FFFFFFFF. System.Reflection.Metadata (MetadataReaderProvider.FromPortablePdbStream) can read this without any native dependency.

Why

BugSplat’s cross-platform (.NET 10) crash processor now consumes PdbLibrary to lay uploaded symbols into the local symsrv cache (replacing the Windows-only symbol-upload-windows.exe). MSF PDBs + PEs are covered; portable PDBs are the remaining gap.

Reference: https://github.com/dotnet/runtime/blob/main/docs/design/specs/PortablePdb-Metadata.md

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions