Skip to content

Commit 0aa9f2c

Browse files
authored
feat: upload line number mappings (#102)
1 parent ae29aa5 commit 0aa9f2c

File tree

3 files changed

+18
-3
lines changed

3 files changed

+18
-3
lines changed

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
.DS_Store
22
symbol-upload-macos
3+
symbol-upload-macos.meta
34
symbol-upload-linux
4-
symbol-upload-windows.exe
5+
symbol-upload-linux.meta
6+
symbol-upload-windows.exe
7+
symbol-upload-windows.exe.meta

Editor/PostBuild.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ private static void UploadSymbolFilesWin(string pathToBuiltProject, BugSplatOpti
7878
return;
7979
}
8080

81-
UploadSymbols(Path.GetDirectoryName(pathToBuiltProject), "**/*.{pdb,dll,exe}", options, uploadExitCode =>
81+
UploadSymbols(Path.GetDirectoryName(pathToBuiltProject), "**/{*.pdb,*.dll,*.exe,LineNumberMappings.json}", options, uploadExitCode =>
8282
{
8383
if (uploadExitCode != 0)
8484
{

README.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ https://github.com/BugSplat-Git/bugsplat-unity.git
4343

4444
## 🧑‍🏫 Sample
4545

46+
> [!TIP] BugSplat recommends building with the IL2CPP backend for the best crash reporting experience. For more information please see the [Player Settings](#-player-settings ) section.
47+
4648
After installing `com.bugsplat.unity`, you can import a sample project to help you get started with BugSplat. Click here if you'd like to skip the sample project and get straight to the [usage](#usage) instructions.
4749

4850
To import the sample, click the carrot next to **Samples** to reveal the **my-unity-crasher** sample. Click **Import** to add the sample to your project.
@@ -66,6 +68,14 @@ Navigate to the [Crashes](https://app.bugsplat.com/v2/crashes) page, and click t
6668

6769
![BugSplat Crash Page](https://github.com/BugSplat-Git/bugsplat-unity/assets/2646053/f108d7e9-ee90-4a09-a7b4-8a9b5d764942)
6870

71+
## 🧰 Player Settings
72+
73+
For best results, BugSplat recommends building with the `IL2CPP` backend. The `Mono` backend is supported, but has several limitations. With `IL2CPP`, BugSplat can capture fully symbolicated C# exception traces in production, as well as native crashes that contain call stacks mapped back to their original C# function names, file names, and line numbers.
74+
75+
To optimize your game for crash reporting, open `Player Settings` (`Edit > Player Settings`). Navigate to the `Configuration` section. For `Scripting Backend` choose `IL2CPP` and for `IL2CPP StackTrace Information` choose `Method Name, File Name, and Line Number`.
76+
77+
![Unity Player Settings](https://github.com/user-attachments/assets/ed459d7e-8580-4e8d-b6aa-386ecaa51a56)
78+
6979
## ⚙️ Configuration
7080

7181
BugSplat's Unity integration is flexible and can be used in various ways. The easiest way to get started is to attach the `BugSplatManager` Monobehaviour to a GameObject.
@@ -172,7 +182,7 @@ StartCoroutine(bugsplat.Post(ex, options, callback));
172182

173183
### Preventing Repeated Reports
174184

175-
By default, BugSplat prevents reports from being sent at a rate greater than 1 per every 60 seconds. You can override the default crash report throttling implementation by setting `ShouldPostException` on your BugSplat instance. To override `ShouldPostException`, assign the property a new `Func<Exception, bool>` value. Be sure your new implementation can handle a null value for `Exception`!
185+
By default, BugSplat prevents reports from being sent at a rate greater than 1 per every 3 seconds. You can override the default crash report throttling implementation by setting `ShouldPostException` on your BugSplat instance. To override `ShouldPostException`, assign the property a new `Func<Exception, bool>` value. Be sure your new implementation can handle a null value for `Exception`!
176186

177187
The following example demonstrates how you could implement your own time-based report throttling mechanism:
178188

@@ -226,6 +236,8 @@ Utils.ForceCrash(ForcedCrashCategory.PureVirtualFunction);
226236

227237
To enable the uploading of plugin symbols, generate an OAuth2 Client ID and Client Secret on the BugSplat [Integrations](https://app.bugsplat.com/v2/settings/database/integrations) page. Add your Client ID and Client Secret to the `BugSplatOptions` object you generated in the [Configuration](#⚙️-configuration) section. If your game contains Native Windows C++ plugins, `.dll` and `.pdb` files in the `Assets/Plugins/x86` and `Assets/Plugins/x86_64` folders will be uploaded by BugSplat's PostBuild script and used in symbolication.
228238

239+
For IL2CPP builds, BugSplat will also upload `LineNumberMappings.json`. Line mappings allow BugSplat to replace generated C++ function names, file names, and line numbers with their original C# equivalents.
240+
229241
### Support Response
230242

231243
BugSplat has the ability to display a support response to users who encounter a crash. You can show your users a generalized support response for all crashes, or a custom support response that corresponds to the type of crash that occurred. Defining a support response allows you to alert users that bug has been fixed in a new version, or that they need to update their graphics drivers.

0 commit comments

Comments
 (0)