feat: Portable PDB (BSJB) debug identity + multi-target net10.0#4
Open
bobbyg603 wants to merge 1 commit into
Open
feat: Portable PDB (BSJB) debug identity + multi-target net10.0#4bobbyg603 wants to merge 1 commit into
bobbyg603 wants to merge 1 commit into
Conversation
PDBFile now transparently reads a Portable PDB's debug identity (the
{GUID}{age} symbol-server key) alongside MSF/CodeView PDBs and PE images,
so a store keyed by PdbLibrary indexes .NET Core / modern-SDK app PDBs
under the same key a dump's CodeView record names. The identity is the
16-byte GUID prefix of the metadata "PDB id" with age 1 (Roslyn's fixed
RSDS age for portable PDBs).
Multi-targeted netstandard2.0;net10.0: portable identity uses in-box
System.Reflection.Metadata under #if NET (net10.0), so no package
reference is added and the netstandard2.0 flavor stays pure BCL
(MSF + PE only). Adds a golden test against a real portable PDB.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Adds Portable PDB (ECMA-335 “BSJB”) debug-identity extraction to PDBFile and updates the library to multi-target so Portable PDB parsing is available on modern .NET while keeping the netstandard2.0 surface area/package dependencies unchanged.
Changes:
- Multi-target
PdbLibraryasnetstandard2.0;net10.0and bump package version to1.2.0. - Detect Portable PDBs via the
BSJBmagic and extract{GUID}{age}from portable PDB metadata (age fixed at 1). - Add a golden unit test validating the portable PDB store key for a real fixture.
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| UnitTestPdbLibrary/PdbLibraryTests.cs | Adds a portable-PDB fixture test asserting the {GUID}{age} store key. |
| PdbLibrary/PdbLibrary.csproj | Multi-targets netstandard2.0 + net10.0 and updates package metadata/version. |
| PdbLibrary/PdbLibrary.cs | Implements Portable PDB detection + identity extraction via System.Reflection.Metadata on .NET targets. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+406
to
+416
| var header = reader.DebugMetadataHeader; | ||
| if (header == null) | ||
| { | ||
| throw new Exception("Not a portable PDB: file has no debug metadata header"); | ||
| } | ||
|
|
||
| var idBlob = header.Id; // 20-byte PDB id: 16-byte GUID + 4-byte stamp | ||
| if (idBlob.Length < 16) | ||
| { | ||
| throw new Exception($"Portable PDB id too short: {idBlob.Length} bytes"); | ||
| } |
daveplunkett
approved these changes
Jul 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
PDBFilenow transparently extracts a Portable PDB (ECMA-335BSJB) debug identity — the{GUID}{age}symbol-server key — in addition to the existing MSF/CodeView PDB and PE support. The identity is the 16-byte GUID prefix of the metadata "PDB id" (DebugMetadataHeader.Id) with age1(Roslyn's fixed RSDS age for portable PDBs), formatted exactly as aSystem.Guid("N")+ age, so it matches the key a dump's CodeView record resolves to.Why
The BugSplat backend keys uploaded symbols into its symsrv store with
PdbLibrary.PDBFile(...).GUID.Value(). Portable PDBs (the format .NET Core / modern-SDK app assemblies ship) previously threw on the MSF signature check, so they were skipped and never indexed — meaning bugsplat-cdb's managed line resolution for .NET Core crashes couldn't find the app PDB. This closes that gap with no change to the indexer call site.How
netstandard2.0;net10.0. Portable identity uses in-boxSystem.Reflection.Metadata, guarded#if NET, so it compiles only on the net10.0 flavor. No package reference is added on any target; the netstandard2.0 flavor stays pure BCL (MSF + PE only), preserving cross-platform use.0023F679…B6721).Version bumped to
1.2.0. Verified:dotnet test— 6/6 pass on net10.0.