feat(debug-files): extract embedded Portable PDBs from managed PEs#1163
Open
BYK wants to merge 2 commits into
Open
feat(debug-files): extract embedded Portable PDBs from managed PEs#1163BYK wants to merge 2 commits into
BYK wants to merge 2 commits into
Conversation
Managed .NET PE assemblies can carry their Portable PDB debug companion inline (debug directory entry type 17, deflate-compressed). `debug-files upload` now extracts that PPDB during scanning and uploads it as a separate `<name>.pdb` DIF, faithful to legacy sentry-cli's `extract_embedded_ppdb`. A managed PE's debug info lives entirely in the embedded PPDB, so the PE object itself usually has no debug features and is dropped by the feature filter. Extraction therefore happens at the prepare stage, independent of the PE's own filtering; the standalone PPDB bytes then flow through the normal per-object filters, so it honors `--type portablepdb`, feature, and `--id` filters and is size-gated against the server's max file size. Consumes `ObjectFile.asPe()` / `PeFile.embeddedPpdb()` from @sentry/symbolic 13.7.0.
Contributor
|
Contributor
Codecov Results 📊✅ Patch coverage is 84.21%. Project has 5141 uncovered lines. Files with missing lines (2)
Coverage diff@@ Coverage Diff @@
## main #PR +/-##
==========================================
+ Coverage 81.49% 81.50% +0.01%
==========================================
Files 399 399 —
Lines 27744 27784 +40
Branches 18025 18045 +20
==========================================
+ Hits 22609 22643 +34
- Misses 5135 5141 +6
- Partials 1859 1862 +3Generated by Codecov Action |
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
sentry debug-files uploadnow automatically extracts a Portable PDB embedded inside a managed .NET PE assembly (debug directory entry type 17, deflate-compressed) and uploads it as a separate<name>.pdbdebug file — faithful to legacysentry-cli'sextract_embedded_ppdb.Consumes the new WASM API from
@sentry/symbolic@13.7.0(bumped from 13.5.0):ObjectFile.asPe()→PeFile.embeddedPpdb()(shipped in getsentry/symbolic#1004).Why the extraction lives at the prepare stage
A managed PE's debug info lives entirely in its embedded Portable PDB, so the PE object itself typically reports no debug features and is dropped by the feature filter. Extraction therefore happens in
prepareDifs(not inbuildDifListover already-preparedfiles), independent of whether the PE passed the filters — mirroring legacy, which extracts from any PE with a debug id.The standalone extracted PPDB bytes are then run through the same per-object filters as any other file, so it:
--type portablepdb(a PE excluded by thepe-format filter is still read whenportablepdbis wanted),--idfilters,.ziparchives.Extraction/decompression errors are swallowed (logged at debug level) so a malformed embed never aborts the scan.
Tests
test/lib/dif/embedded-ppdb.test.ts— unit tests forextractEmbeddedPpdb(positive/negative, standalone-PPDB round-trip) against small committed .NET PE fixtures.test/commands/debug-files/upload.test.ts— command-level: dry-run queues the.pdb,--type portablepdbextracts it,--type elfignores it, PE-without-embed yields nothing, and the PPDB is threaded through touploadDebugFiles.Fixtures (
embedded-ppdb.dll,pe-no-ppdb.dll) are the small Sentry sample console binaries fromsymbolic-testutils.Verified locally:
typecheck,lint,test(350 debug-files/dif/scan tests),check:deps,check:fragmentsall green.Notes
--il2cpp-mapping) to follow.