Repository navigation
Add missing portable PDB debug data types and fix the FPO value - #781
Merged
Washi1337 merged 1 commit intoSep 10, 2026
Merged
Conversation
Owner
|
LGTM, if you can rebase the branch to latest dev then I can merge it safely. |
The FPO debug data type was defined as 0 rather than 3, which made it an alias of Unknown, so a type 3 debug directory entry never mapped onto it. Also adds the two portable PDB debug data types defined by the Portable PDB specification, which had no members: EMBEDDED_PORTABLE_PDB (17) and PDBCHECKSUM (19). Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Sergio0694
force-pushed
the
issue/missing-debug-data-types
branch
from
September 10, 2026 10:49
5a27444 to
a05472f
Compare
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.
Summary
Adds the two portable PDB debug data types that
DebugDataTypewas missing, and fixesFpo, which was defined as0instead of3.Motivation
DebugDataTypehas no members for two of the debug directory entry types that every deterministic .NET assembly built with embedded symbols carries:IMAGE_DEBUG_TYPE_EMBEDDED_PORTABLE_PDBIMAGE_DEBUG_TYPE_PDBCHECKSUMBoth are defined by the Portable PDB specification and are present in
System.Reflection.PortableExecutable.DebugDirectoryEntryType. Reading and writing these entries already works (they fall through toCustomDebugDataSegmentinDefaultDebugDataReader), but callers have to cast a magic number to name them:Separately,
Fpois declared as0, butIMAGE_DEBUG_TYPE_FPOis3. As a resultDebugDataType.Fpo == DebugDataType.Unknownistrue, and a real type 3 entry is surfaced as an unnamed(DebugDataType)3instead ofFpo. This looks like a typo rather than something intentional, since every other member matches itswinnt.hvalue.Changes
src/AsmResolver.PE/Debug/DebugDataType.cs: addsEmbeddedPortablePdb = 17andPdbChecksum = 19, and correctsFpofrom0to3.test/AsmResolver.PE.Tests/Debug/DebugDataEntryTest.cs: addsPersistentPortablePdbEntries, asserting that entries of the newly named types survive a build and reload round trip alongsideRepro.Notes
Changing the value of
Fpois technically a source and binary compatible but behavior changing fix, so it is worth calling out explicitly. In practice nothing can be relying on the current value in a meaningful way: it is indistinguishable fromUnknown, so any code branching onDebugDataType.Fpotoday is matching unknown entries rather than FPO entries. I am happy to split it into its own pull request if you would rather keep the additions separate from the fix.18is deliberately not added: unlike 17 and 19 it is not part of the specification linked above and has nowinnt.hconstant.All 313 tests in
AsmResolver.PE.Testspass.