Skip to content

Add Windows PDB metadata preparation and native ISF overlays - #84

Merged
vvollers merged 4 commits into
mainfrom
windows-memory-support
Nov 16, 2026
Merged

vvollers merged 4 commits into
mainfrom
windows-memory-support

Conversation

@vvollers

Copy link
Copy Markdown
Owner

Windows PDB metadata preparation, native ISF overlays, and memory-source fixes.

PdbMetadata reads MSF 7 / CodeView V70 and V80 PDB metadata from selected streams and writes a deterministic ISF 6.2.0 profile offline (no debugger, symbol server or network):

  • Identity: GUID, both age fields, the original DBI machine; an explicit targetMachine is required when the DBI machine is zero.
  • Types: structs, classes, unions, enums, arrays, bitfields and flat 32/64-bit pointers. C++ field lists export instance members and skip methods, bases, nested types, static members and vtable entries.
  • Symbols: public, global and unambiguous file-local addresses after OMAP; absolute values kept separately; ambiguous file-local names are reported in Diagnostics; a PDB without a symbol stream still provides its types.
  • Limits: maxMetadataBytes and per-table maxRecords bound loading; WriteIsf has its own maxTraversalSteps limit.

ISF import

  • Accepts format 6.1.0 as well as 6.2.0.
  • Members whose physical bits overlap are grouped into a generated union held by a promoted __overlay_{offset} member, so original paths still resolve and unrelated members keep struct semantics.
  • An explicit pointer storage base supplies the pointer's width and byte order, so native and WOW64 pointers coexist.

Memory sources

  • Breaking: MappedMemorySource.Read returns a positive short count at a mapping boundary. Region APIs (ReadExactly, ReadPartial) assemble complete transfers; direct callers continue from the returned count.
  • CachedMemorySource stores positive short reads and evicts by retained bytes.

Brought up to date with main after #83 (StyleCop 1.3: secondary PdbMetadata partials use <content>). The managed API baseline keeps main's released revision 75 and records this branch's surface as revision 76 (additive; PdbMetadata is new).

Local checks on the merged tree: full solution Release build (0 warnings), test-managed --full (4652 runtime tests on net8.0 and net10.0, parity, compiler, generator), documentation validator, API compare, changed-documentation, mutation remap, Explorer catalog.

PdbMetadata reads MSF 7 / CodeView V70 and V80 PDB metadata from selected
streams and writes a deterministic ISF 6.2.0 profile offline:
- Identity: GUID, both age fields, original DBI machine; an explicit
  targetMachine is required when the DBI machine is zero.
- Types: structs, classes, unions, enums, arrays, bitfields and flat
  32/64-bit pointers (legacy records without size bits keep their kind's
  width). C++ field lists export instance members and skip methods, bases,
  nested types, static members and vtable entries; the declared count is an
  upper bound when such elements are present.
- Symbols: public, global and unambiguous file-local addresses after OMAP;
  absolute values kept separately; file-local names with several addresses
  are omitted with a diagnostic; a PDB without a symbol stream still loads.
- Limits: maxMetadataBytes and per-table maxRecords bound loading;
  WriteIsf has its own maxTraversalSteps export limit.

ISF import:
- Accepts format 6.1.0 as well as 6.2.0.
- Members whose physical bits overlap are grouped into a generated union held
  by a promoted __overlay_{offset} member, so original paths still resolve and
  unrelated members keep struct semantics.
- An explicit pointer storage base supplies the pointer's width and byte
  order, so native and WOW64 pointers coexist.

Memory sources:
- MappedMemorySource.Read returns a positive short count at a mapping
  boundary (breaking for direct callers; region APIs assemble transfers and
  keep confirmed prefixes across missing extents).
- CachedMemorySource stores positive short reads and evicts by retained bytes.

The MemoryProjectionTests pointer case now stores its big-endian pointer in
big-endian order; it previously passed only because pointer byte order was
ignored.
Conflicts:
- CHANGELOG.md: both Unreleased sections combined.
- contracts/api/managed/manifest.json: main's released history kept (revision
  75, the StyleCop StructValue rename); this branch's unreleased revisions
  75-77 consolidated into revision 76 for the PdbMetadata surface.

StyleCop 1.3 (SA1653): the secondary PdbMetadata partials document
themselves with <content>.
CI's coverage gate rated PdbMetadata.Isf.cs high risk (74% lines, 59%
branches) and PdbRecordReader.cs critical (66%, 45%): enum export, modifiers,
bitfields, function pointers, nested and forward-element arrays, unions,
anonymous members, continuations, most numeric-leaf encodings and nearly every
rejection path had no test.

- RichStorageForms_ExportAndReadBack exports one record using every supported
  storage form and reads it back through IsfMetadata and MemorySession.
- MalformedStorage_RejectsTheExport covers 28 malformed or unsupported
  descriptions, each of which must fail instead of publishing a layout.
- WriteIsf_RejectsUnwritableOutputAndPathNames covers argument validation.

Both files now rate low risk (99%/96% and 96%/95%).

dotnet format: switch labels in SkipNonStorageField and the OMAP test follow
the repository's unindented case style.
@vvollers
vvollers merged commit 5522ca2 into main Nov 16, 2026
10 checks passed
@vvollers
vvollers deleted the windows-memory-support branch November 16, 2026 20:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant