Skip to content

fix: line number support for unity 6.5 and newer - #2805

Merged
bitsandfoxes merged 24 commits into
mainfrom
feat/fix-symbols-unity-6.5
Aug 13, 2026
Merged

fix: line number support for unity 6.5 and newer#2805
bitsandfoxes merged 24 commits into
mainfrom
feat/fix-symbols-unity-6.5

Conversation

@bitsandfoxes

@bitsandfoxes bitsandfoxes commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Context

In Unity 6.3 and older, when building the game you'd end up with an output folder looking like that

.
├── game-name_BackUpThisFolder_ButDontShipItWithYourGame
│   ├── GameAssembly.dSYM
│   ├── il2cppOutput
│   └── Managed
|        ├ all-the-dlls.dll
|        └ all-the-dlls.pdb
└── game-name.app

The Managed directory would contain all the stripped down .dll and matching .pdb files. Starting with 6.5 the Managed folder contains the .dll only. To get to the .pdb you will need to do a Development build and opt-in to Script Debugging. Not ideal.

What this does

These options provide the UnityLinker with the additional argument --link-symbols.

So starting with Unity 6.5 on top of adding --emit-source-mapping to IL2CPP we need to add this argument when the UnityLinker gets invoked. Since there are no callbacks and the backdoor of AdditionalIl2CppArguments only works for IL2CPP we're touching some internals to do the same for the AdditionalUnityLinkerArguments.

We'll need to find a less brittle way of getting to the debug symbols

Before

Screenshot 2026-08-07 at 15 14 31

After

Screenshot 2026-08-07 at 15 24 22

Testing

We're now also validating that the stack trace on the resulting events coming from the integration tests do have proper frames with a line number.

Comment thread src/Sentry.Unity.Editor/Il2CppBuildPreProcess.cs Outdated
@bitsandfoxes bitsandfoxes changed the title write additional unitylinker args fix: line number support for unity 6.5 and newer Aug 7, 2026
Comment thread src/Sentry.Unity.Editor/Il2CppBuildPreProcess.cs
bitsandfoxes and others added 2 commits August 7, 2026 17:59
Start Unity Editor with --link-symbols in its process environment to determine whether Linux Bee reads the setting before build preprocessing.

Refs #2805

Co-Authored-By: OpenCode <noreply@openai.com>
Comment thread .github/workflows/test-build-linux.yml Outdated
The process-start linker argument reached UnityLinker but did not restore Linux source resolution, so remove the temporary CI override.

Refs #2805

Co-Authored-By: OpenCode <noreply@openai.com>
Comment thread src/Sentry.Unity.Editor/Il2CppBuildPreProcess.cs Outdated
Comment thread test/IntegrationTest/Integration.Tests.ps1
Comment thread src/Sentry.Unity.Editor/Il2CppBuildPreProcess.cs Outdated
Comment thread test/IntegrationTest/Integration.Tests.ps1 Outdated
Comment thread src/Sentry.Unity.Editor/SentryUnityLinkerProcessor.cs Outdated
Comment thread src/Sentry.Unity.Editor/SentryUnityLinkerProcessor.cs Outdated
Comment thread src/Sentry.Unity.Editor/SentryUnityLinkerProcessor.cs Outdated
Comment thread src/Sentry.Unity.Editor/SentryUnityLinkerArguments.cs Outdated
Comment thread src/Sentry.Unity.Editor/SentryUnityLinkerArguments.cs Outdated
Comment thread src/Sentry.Unity.Editor/Il2CppBuildPreProcess.cs
Comment thread src/Sentry.Unity.Editor/Il2CppBuildPreProcess.cs
Comment thread .github/workflows/test-build-linux.yml Outdated
Comment thread src/Sentry.Unity.Editor/Il2CppBuildPreProcess.cs Outdated
Comment thread src/Sentry.Unity.Editor/Il2CppBuildPreProcess.cs Outdated
Comment thread src/Sentry.Unity.Editor/UnityLinkerDiagnosticSwitch.cs
@bitsandfoxes
bitsandfoxes requested a review from a team August 13, 2026 11:42

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit f3d7a79. Configure here.

Comment thread test/IntegrationTest/Integration.Tests.ps1
@bitsandfoxes
bitsandfoxes merged commit 62a4d37 into main Aug 13, 2026
65 checks passed
@bitsandfoxes
bitsandfoxes deleted the feat/fix-symbols-unity-6.5 branch August 13, 2026 16:17
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.

2 participants