Readable Stack Traces

Learn how to get traces with line numbers and file paths in Sentry with SDK for Godot Engine.

The official Godot Engine builds only provide templates without debug information files. This guide covers how to create such templates and use them to export your project with full debug information available in Sentry.

Debug information files allow Sentry to extract stack traces and provide additional information from crash reports. In order to get stack traces that contain function names, line numbers and file paths, Sentry needs to have these debug information files available when processing the crash dumps. For that, you need to export your Godot project using an export template that contains debug information.

To get debug information, we need to compile export templates with debug symbols produced. You'll need Git, SCons build tool, Python, and a C++ compiler for your target platform installed.

For Android, you'll also need the Android SDK (command-line tools are enough). On macOS, don't use the Android SDK provided by Homebrew as it will not be installed in a unified location.

Ensure you have a compatible C++ compiler. On Windows, for instance, you can use Visual Studio Community 2022 with the C++ workload installed, GCC on Linux and Clang on macOS.

Here are a few ways to install the SCons build tool:

Copied
# If you have `scoop` installed:
scoop install scons

For compiling on macOS you also need to install Vulkan SDK.

Start in a terminal with Git available. Clone Godot Engine repository and switch to your preferred version tag (or branch):

Copied
git clone https://github.com/godotengine/godot
cd godot
git checkout 4.5-stable
Additional Setup for Android

For Android compilation, Godot requires the Swappy frame pacing library. Download the pre-built library from https://github.com/godotengine/godot-swappy/releases and extract the archive contents to the thirdparty/swappy-frame-pacing/ directory within your cloned Godot source tree.

To compile the Godot export templates with debug symbols, run the following commands:

Copied
scons target=template_release production=yes debug_symbols=yes separate_debug_symbols=yes
Options explained
  • target: compilation target (e.g., "editor" or "template_release")
  • arch: architecture to compile for (e.g., "x86_64" or "arm64")
  • production: set build defaults for production use
  • debug_symbols: include debugging symbols in the build
  • separate_debug_symbols: extract symbols into a separate file
  • generate_bundle: generate application bundle archive (godot_macos.zip for macOS or godot_ios.zip for iOS)
  • generate_android_binaries: generate Android template AARs and Gradle template project after build is complete (android_source.zip)

For more information, run: scons --help

After a successful build, the export template files will be generated in the bin/ directory within the Godot source tree:

Windows (MSVC): You'll find .exe executable files alongside corresponding .pdb files containing the debug information.

macOS: The build generates godot_macos.zip containing a universal binary that supports both x86_64 and ARM64 architectures. Additionally, you'll see two separate .dSYM folders (debug symbol bundles) for each architecture.

iOS: The build generates godot_ios.zip containing universal frameworks with static libraries and Xcode project files for both release and debug export configurations.

Android: The build produces android_source.zip, which contains the Gradle build template with the compiled export template libraries. Additionally, the build generates android-template-release-native-symbols.zip and android-template-debug-native-symbols.zip archives containing the corresponding debug symbols for each template variant.

With your custom templates compiled, you can now export your project with debug symbols. Open the Godot Export dialog and configure it as follows:

  1. Select or add an export preset for your target platform.

  2. Enable Advanced Options in the top-right corner of the dialog.

  3. Configure the custom template in the Options tab:

    For Windows/Linux:

    • Find the Custom Template section
    • Under Release, browse and select your compiled template executable from the bin/ directory

    For macOS

    • Find the Custom Template section
    • Under Release, browse and select godot_macos.zip bundle from the bin/ directory

    For iOS:

    • Find the Custom Template section
    • Under both Release and Debug, browse and select the same godot_ios.zip bundle from the bin/ directory

    For Android:

    • Enable Gradle Build in the Gradle section
    • Set Android Source Template to point to the android_source.zip file generated during compilation
    • Install the Android build template by navigating to Project > Install Android Build Template... in the editor menu

Once configured, your export preset will use the custom template containing the debug information needed for readable stack traces in Sentry.

You should now be able to export your project using this template. Just make sure to uncheck Export with Debug in the Export Project... dialog, as you will need to compile and use the template_debug for that option.

In order to get readable stack traces in Sentry, you also need to upload your debug symbols. The easiest way to do it is by using Sentry CLI. This tool allows you to upload the necessary debug information, making the stack traces useful for debugging.

Installing Sentry CLI
Copied
# On Windows, if you have `scoop` installed:
scoop install sentry-cli

For other methods, refer to Sentry CLI Installation.

Log in to Sentry via the CLI by running the following command:

Copied
sentry-cli login

It will prompt you to create an auth token in your web browser. Follow the instructions, generate the token, and then paste it into the command-line prompt when asked.

To show inline source context in Sentry, sentry-cli can scan debug files for source references, resolves them locally, and creates an archive of all referenced source files called source bundle. The source bundle can be created by sentry-cli during the upload of debug information files.

To upload the debug information files to Sentry with sources included, run the following command:

Copied
sentry-cli debug-files upload --include-sources --org example-org --project example-project bin

This uploads debug information files from the bin directory to Sentry, creating the source bundles on the fly.

Generating source bundle archives separately

You can also create the source bundles separately from the upload step by running:

Copied
sentry-cli debug-files bundle-sources bin\godot.windows.template_release.x86_64.pdb
sentry-cli debug-files bundle-sources bin\godot.windows.template_release.x86_64.console.pdb

Example output:

Copied
$ sentry-cli debug-files upload --include-sources --org my-sentry-org --project my-game bin
> Found 4 debug information files
  WARN    2025-05-12 12:03:13.130458600 -07:00 Source exceeded maximum item size limit (1572415). C:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\shared\winerror.h
  WARN    2025-05-12 12:03:14.535023400 -07:00 Source exceeded maximum item size limit (1572415). C:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\shared\winerror.h
  WARN    2025-05-12 12:03:15.349655900 -07:00 Source exceeded maximum item size limit (1152425). C:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\um\shobjidl_core.h
  WARN    2025-05-12 12:03:15.947910200 -07:00 Source exceeded maximum item size limit (1145069). C:\Users\user\Projects\godot\4.4.1-stable\thirdparty\ufbx\ufbx.c
> Resolved source code for 2 debug information files
> Prepared debug information files for upload
> Uploading completed in 10.049s
> Uploaded 6 missing debug information files
> File upload complete:

  UPLOADED efc658cd-7481-4a15-93a5-9f8fa2b6c8a3-1 (godot.windows.template_release.x86_64.pdb; x86_64 sources)
  UPLOADED efc658cd-7481-4a15-93a5-9f8fa2b6c8a3-1 (godot.windows.template_release.x86_64.pdb; x86_64 debug companion)
  UPLOADED 050f8915-6eae-4054-8062-b90d75593f3a-1 (godot.windows.template_release.x86_64.console.pdb; x86_64 sources)
  UPLOADED efc658cd-7481-4a15-93a5-9f8fa2b6c8a3-1 (godot.windows.template_release.x86_64.exe; x86_64 executable)
  UPLOADED 050f8915-6eae-4054-8062-b90d75593f3a-1 (godot.windows.template_release.x86_64.console.exe; x86_64 executable)
  UPLOADED 050f8915-6eae-4054-8062-b90d75593f3a-1 (godot.windows.template_release.x86_64.console.pdb; x86_64 debug companion)

You can also upload debug files for the Sentry SDK itself by running the following command from your project directory:

Copied
sentry-cli debug-files upload --org example-org --project example-project addons/sentry/

This uploads the SDK's debug files to Sentry. You can repeat this step for any other native extension used in your Godot project.

Congratulations! You're all set up. Your exported project should now produce symbolicated stack traces in Sentry.

Was this helpful?
Help improve this content
Our documentation is open source and available on GitHub. Your contributions are welcome, whether fixing a typo (drat!) or suggesting an update ("yeah, this would be better").