feat(debug-files): add --il2cpp-mapping for Unity IL2CPP line mappings#1164
Closed
BYK wants to merge 1 commit into
Closed
feat(debug-files): add --il2cpp-mapping for Unity IL2CPP line mappings#1164BYK wants to merge 1 commit into
BYK wants to merge 1 commit into
Conversation
Contributor
|
Contributor
Codecov Results 📊❌ Patch coverage is 76.92%. Project has 5140 uncovered lines. Files with missing lines (2)
Coverage diff@@ Coverage Diff @@
## main #PR +/-##
==========================================
+ Coverage 81.50% 81.50% —%
==========================================
Files 399 397 -2
Lines 27744 27777 +33
Branches 18025 18051 +26
==========================================
+ Hits 22609 22637 +28
- Misses 5135 5140 +5
- Partials 1859 1864 +5Generated by Codecov Action |
Adds `debug-files upload --il2cpp-mapping`, which computes a Unity IL2CPP C++→C# line mapping for each scanned object and uploads it as a separate `il2cpp` DIF carrying the object's debug id — faithful to legacy sentry-cli's `create_il2cpp_mappings`. The generated C++ source files an object references are read from disk via a provider (IL2CPP `source_info` markers are parsed from them); mappings that come out empty are skipped. When combined with `--include-sources`, the per-file source bundle also collects the referenced C# source files (`SourceBundleWriter.collectIl2cppSources`). Adds `createIl2cppLineMapping()` and a `collectIl2cppSources` option on `createSourceBundle()` in the DIF module, consuming the top-level `il2cppLineMapping(object, provider)` export and the `collectIl2cppSources` setter from @sentry/symbolic 13.7.0. `--symbol-maps` remains the only deferred legacy upload option.
5f74db4 to
e7b1178
Compare
Member
Author
BYK
added a commit
that referenced
this pull request
Jul 2, 2026
#1165) > Follows #1163 (embedded Portable PDB extraction), now merged. This PR is rebased onto `main`. (Re-opened from #1164, which GitHub auto-closed when its base branch was deleted on #1163's merge.) ## What Adds `sentry debug-files upload --il2cpp-mapping`: for each prepared debug file it computes a **Unity IL2CPP C++→C# line mapping** (from the file's primary debug-info object) and uploads it as a separate `il2cpp` DIF carrying the object's debug id — faithful to legacy `sentry-cli`'s `create_il2cpp_mappings`. Consumes the new WASM API from **`@sentry/symbolic@13.7.0`** (getsentry/symbolic#1005): - top-level `il2cppLineMapping(object, provider)` - `SourceBundleWriter.collectIl2cppSources` (present since 13.5.0) ## Behavior (matches legacy) - The generated C++ source files an object references are read from disk via a provider; IL2CPP `//<source_info:File.cs:line>` markers are parsed from them. Objects that yield an empty mapping are skipped. - The mapping DIF is named `<name>.il2cpp` and carries the source file's debug id. - When combined with `--include-sources`, the per-file source bundle **also** collects the referenced C# source files (`collectIl2cppSources`) — otherwise the source bundle is unchanged. - Missing/unreadable sources and mapping failures are swallowed (debug-logged), never aborting the upload. - `--symbol-maps` (BCSymbolMap resolution) remains the only deferred legacy upload option. ## Implementation - `src/lib/dif/index.ts`: `createIl2cppLineMapping(data, readSource)` + a `collectIl2cppSources` option on `createSourceBundle()`. - `src/commands/debug-files/upload.ts`: `--il2cpp-mapping` flag; extracted a shared `readSourceFile` disk-reader used by both the source bundle and the IL2CPP provider. ## Tests - `test/lib/dif/il2cpp.test.ts` — `createIl2cppLineMapping` (mapping JSON, provider-null → null, no-markers → null) and `createSourceBundle` `collectIl2cppSources` (C# included only when enabled, verified by unzipping the bundle). - `test/commands/debug-files/upload.test.ts` — `--il2cpp-mapping` queues the `.il2cpp` DIF, absent without the flag, and is threaded through to `uploadDebugFiles`. All text fixtures (Breakpad `FILE` records + synthetic C++/C#), no binaries. Verified locally: `typecheck`, `lint`, `test` (358 debug-files/dif/scan tests), `check:deps`, `check:fragments` all green.
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
Adds
sentry debug-files upload --il2cpp-mapping: for each prepared debug file it computes a Unity IL2CPP C++→C# line mapping (from the file's primary debug-info object) and uploads it as a separateil2cppDIF carrying the object's debug id — faithful to legacysentry-cli'screate_il2cpp_mappings.Consumes the new WASM API from
@sentry/symbolic@13.7.0(getsentry/symbolic#1005):il2cppLineMapping(object, provider)SourceBundleWriter.collectIl2cppSources(present since 13.5.0)Behavior (matches legacy)
//<source_info:File.cs:line>markers are parsed from them. Objects that yield an empty mapping are skipped.<name>.il2cppand carries the source file's debug id.--include-sources, the per-file source bundle also collects the referenced C# source files (collectIl2cppSources) — otherwise the source bundle is unchanged.--symbol-maps(BCSymbolMap resolution) remains the only deferred legacy upload option.Implementation
src/lib/dif/index.ts:createIl2cppLineMapping(data, readSource)+ acollectIl2cppSourcesoption oncreateSourceBundle().src/commands/debug-files/upload.ts:--il2cpp-mappingflag; extracted a sharedreadSourceFiledisk-reader used by both the source bundle and the IL2CPP provider.Tests
test/lib/dif/il2cpp.test.ts—createIl2cppLineMapping(mapping JSON, provider-null → null, no-markers → null) andcreateSourceBundlecollectIl2cppSources(C# included only when enabled, verified by unzipping the bundle).test/commands/debug-files/upload.test.ts—--il2cpp-mappingqueues the.il2cppDIF, absent without the flag, and is threaded through touploadDebugFiles.All text fixtures (Breakpad
FILErecords + synthetic C++/C#), no binaries.Verified locally:
typecheck,lint,test(358 debug-files/dif/scan tests),check:deps,check:fragmentsall green.