From 998b8c380ff21dd77179a1aeb1e35eb2cb6e82df Mon Sep 17 00:00:00 2001 From: Bobby Galli Date: Wed, 21 May 2025 21:00:16 -0400 Subject: [PATCH 1/2] feat: upload line number mappings --- .gitignore | 5 ++++- Editor/PostBuild.cs | 2 +- README.md | 14 +++++++++++++- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 1ed20da..37ea83e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,7 @@ .DS_Store symbol-upload-macos +symbol-upload-macos.meta symbol-upload-linux -symbol-upload-windows.exe \ No newline at end of file +symbol-upload-linux.meta +symbol-upload-windows.exe +symbol-upload-windows.exe.meta \ No newline at end of file diff --git a/Editor/PostBuild.cs b/Editor/PostBuild.cs index 6759d64..f7979dd 100644 --- a/Editor/PostBuild.cs +++ b/Editor/PostBuild.cs @@ -78,7 +78,7 @@ private static void UploadSymbolFilesWin(string pathToBuiltProject, BugSplatOpti return; } - UploadSymbols(Path.GetDirectoryName(pathToBuiltProject), "**/*.{pdb,dll,exe}", options, uploadExitCode => + UploadSymbols(Path.GetDirectoryName(pathToBuiltProject), "**/{*.pdb,*.dll,*.exe,LineNumberMappings.json}", options, uploadExitCode => { if (uploadExitCode != 0) { diff --git a/README.md b/README.md index 3480bb1..c8d78d4 100644 --- a/README.md +++ b/README.md @@ -43,6 +43,8 @@ https://github.com/BugSplat-Git/bugsplat-unity.git ## 🧑‍🏫 Sample +> [!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. + 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. 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 ![BugSplat Crash Page](https://github.com/BugSplat-Git/bugsplat-unity/assets/2646053/f108d7e9-ee90-4a09-a7b4-8a9b5d764942) +## 🧰 Player Settings + +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. + +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`. + +TODO BG image + ## ⚙️ Configuration 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)); ### Preventing Repeated Reports -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` value. Be sure your new implementation can handle a null value for `Exception`! +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` value. Be sure your new implementation can handle a null value for `Exception`! The following example demonstrates how you could implement your own time-based report throttling mechanism: @@ -226,6 +236,8 @@ Utils.ForceCrash(ForcedCrashCategory.PureVirtualFunction); 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. +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. + ### Support Response 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. From d93315281bc1f9c5c099d833319b1653ea630a77 Mon Sep 17 00:00:00 2001 From: Bobby Galli Date: Wed, 21 May 2025 21:21:02 -0400 Subject: [PATCH 2/2] chore: update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c8d78d4..11bd908 100644 --- a/README.md +++ b/README.md @@ -74,7 +74,7 @@ For best results, BugSplat recommends building with the `IL2CPP` backend. The `M 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`. -TODO BG image +![Unity Player Settings](https://github.com/user-attachments/assets/ed459d7e-8580-4e8d-b6aa-386ecaa51a56) ## ⚙️ Configuration