Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
c3228c6
basic setup
bitsandfoxes Nov 21, 2025
921a9b1
Initialization
bitsandfoxes Nov 25, 2025
9a80682
Disable native logger
bitsandfoxes Nov 25, 2025
e578294
Native logger setup
bitsandfoxes Nov 26, 2025
26ce8df
Naming
bitsandfoxes Nov 26, 2025
5ec7294
Startup time
bitsandfoxes Nov 26, 2025
95eb4ed
Dynamic libs
bitsandfoxes Nov 26, 2025
a79855b
Updated CHANGELOG.md
bitsandfoxes Nov 26, 2025
7349d27
Merge branch 'main' into feat/playstation-support
bitsandfoxes Nov 26, 2025
1bba080
Moved wrapper into plugins
bitsandfoxes Nov 27, 2025
aea5061
merged
bitsandfoxes Nov 27, 2025
e8f6305
Removed 'PS4'
bitsandfoxes Nov 27, 2025
91d27b4
Merged 'main'
bitsandfoxes Nov 27, 2025
5186660
Updated snapshot
bitsandfoxes Nov 27, 2025
ac49d1e
Missed an if
bitsandfoxes Nov 27, 2025
2018f19
Fixed .meta
bitsandfoxes Nov 27, 2025
0388e77
Reimported .meta
bitsandfoxes Nov 28, 2025
8ccd22c
Unified vsnprintf wrapper
bitsandfoxes Nov 28, 2025
f01bf87
Updated snapshot
bitsandfoxes Nov 28, 2025
be9b692
Missed platforms
bitsandfoxes Nov 28, 2025
8cbe91e
Maybe?
bitsandfoxes Dec 1, 2025
36502a1
Merged 'main'
bitsandfoxes Dec 4, 2025
8129d3d
Naming
bitsandfoxes Dec 4, 2025
8d65c78
Missed a rename
bitsandfoxes Dec 4, 2025
3adedc0
Updated Native meta
bitsandfoxes Dec 4, 2025
f687907
Make it work one last time
bitsandfoxes Dec 4, 2025
082afb1
Removed unused .meta
bitsandfoxes Dec 4, 2025
5aec4c8
Updated snapshot
bitsandfoxes Dec 4, 2025
b44888b
Cleanup
bitsandfoxes Dec 4, 2025
8a6a41c
Missed the caching
bitsandfoxes Dec 4, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

### Features

- Added PlayStation Native Support. The SDK now automatically syncs the scope - tags, breadcrumbs, context - to the native layer, so native crashes have the same rich context as managed events. ([#2433](https://github.com/getsentry/sentry-unity/pull/2433))
- On Windows, and with screenshot capture enabled, the SDK will now also capture and attach a screenshot to native crashes ([#2434](https://github.com/getsentry/sentry-unity/pull/2434))
- Added `SetBeforeSendScreenshot(Func<Texture2D, SentryEvent, Texture2D?>)` callback that provides the captured screenshot as a
`Texture2D` before JPEG compression. ([#2428](https://github.com/getsentry/sentry-unity/pull/2428))
Expand All @@ -21,7 +22,7 @@
- Access to the event context for conditional processing
- Added `SetBeforeSendViewHierarchy(Func<ViewHierarchy, SentryEvent, ViewHierarchy?>)` callback that provides the captured
`ViewHierarchy` to be modified before compression. ([#2429](https://github.com/getsentry/sentry-unity/pull/2429))

### Dependencies

- Bump Cocoa SDK from v8.57.2 to v8.57.3 ([#2424](https://github.com/getsentry/sentry-unity/pull/2424), [#2427](https://github.com/getsentry/sentry-unity/pull/2427))
Expand Down
16 changes: 16 additions & 0 deletions package-dev/Plugins/PS5/sentry_utils.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#include <stdarg.h>
#include <stdio.h>

/**
* Wrapper around vsnprintf for Unity C# IL2CPP interop.
*
* This function provides a stable ABI entry point for Unity to call
* vsnprintf functionality across Windows, Linux, and PlayStation platforms.
*
* This wrapper is compiled as native C code where va_list is properly
* understood, then IL2CPP calls this wrapper with generic pointers.
*/
int vsnprintf_sentry(char *buffer, size_t size, const char *format, va_list args)
{
return vsnprintf(buffer, size, format, args);
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

70 changes: 70 additions & 0 deletions package-dev/Runtime/Sentry.Unity.Native.PlayStation.dll.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

53 changes: 29 additions & 24 deletions package-dev/Runtime/Sentry.Unity.Native.dll.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion package-dev/Runtime/SentryInitialization.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
#define SENTRY_NATIVE
#elif UNITY_GAMECORE
#define SENTRY_NATIVE
#elif UNITY_PS5
#define SENTRY_NATIVE
#elif UNITY_WEBGL
#define SENTRY_WEBGL
#endif
Expand Down Expand Up @@ -131,7 +133,7 @@ private Il2CppMethods _il2CppMethods
return null;
}

#if UNITY_ANDROID || UNITY_STANDALONE_LINUX
#if UNITY_ANDROID || UNITY_STANDALONE_LINUX || UNITY_PS5
// For ELF platforms, the 20-byte `NT_GNU_BUILD_ID` needs to be
// turned into a "little-endian GUID", which means the first three
// components need to be byte-swapped appropriately.
Expand Down
1 change: 1 addition & 0 deletions package-dev/Runtime/io.sentry.unity.dev.runtime.asmdef
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"LinuxStandalone64",
"Lumin",
"macOSStandalone",
"PS5",
"Stadia",
"Switch",
"WSA",
Expand Down
1 change: 1 addition & 0 deletions package/Runtime/io.sentry.unity.runtime.asmdef
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"LinuxStandalone64",
"Lumin",
"macOSStandalone",
"PS5",
"Stadia",
"Switch",
"WSA",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,12 @@ internal static void Display(ScriptableSentryUnityOptions options, SentryCliOpti
GUILayout.Label("Console", EditorStyles.boldLabel);

options.XboxNativeSupportEnabled = EditorGUILayout.Toggle(
new GUIContent("Xbox", "Whether to enable native crashes support on Xbox."),
new GUIContent("Xbox", "Whether to enable native crash support on Xbox."),
options.XboxNativeSupportEnabled);

options.PlayStationNativeSupportEnabled = EditorGUILayout.Toggle(
new GUIContent("PlayStation", "Whether to enable native crash support on PlayStation."),
options.PlayStationNativeSupportEnabled);
}

EditorGUI.indentLevel--;
Expand Down
18 changes: 16 additions & 2 deletions src/Sentry.Unity.Editor/Native/BuildPostProcess.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
using Sentry.Extensibility;
using Sentry.Unity.Editor.ConfigurationWindow;
using System.Text.RegularExpressions;
using Microsoft.Extensions.FileSystemGlobbing;
using UnityEngine;
using UnityEditor;
using UnityEditor.Build;
Expand All @@ -18,7 +17,9 @@ public static class BuildPostProcess
public static void OnPostProcessBuild(BuildTarget target, string executablePath)
{
var targetGroup = BuildPipeline.GetBuildTargetGroup(target);
if (targetGroup is not BuildTargetGroup.Standalone and not BuildTargetGroup.GameCoreXboxSeries)
if (targetGroup is not BuildTargetGroup.Standalone
and not BuildTargetGroup.GameCoreXboxSeries
and not BuildTargetGroup.PS5)
{
return;
}
Expand Down Expand Up @@ -47,10 +48,12 @@ public static void OnPostProcessBuild(BuildTarget target, string executablePath)
// The executable path resolves to the following when pointing Unity into a `build/platform/` directory:
// - Desktop: `./samples/unity-of-bugs/builds/windows/unityofbugs.exe`
// - Xbox: `./samples/unity-of-bugs/builds/xsx/`
// - PlayStation: `./samples/unity-of-bugs/builds/ps5/`
var buildOutputDir = targetGroup switch
{
BuildTargetGroup.Standalone => Path.GetDirectoryName(executablePath),
BuildTargetGroup.GameCoreXboxSeries => executablePath,
BuildTargetGroup.PS5 => executablePath,
_ => string.Empty
};

Expand Down Expand Up @@ -87,6 +90,7 @@ public static void OnPostProcessBuild(BuildTarget target, string executablePath)
BuildTarget.StandaloneOSX => options.MacosNativeSupportEnabled,
BuildTarget.StandaloneLinux64 => options.LinuxNativeSupportEnabled,
BuildTarget.GameCoreXboxSeries or BuildTarget.GameCoreXboxOne => options.XboxNativeSupportEnabled,
BuildTarget.PS5 => options.PlayStationNativeSupportEnabled,
_ => false,
};

Expand All @@ -108,6 +112,9 @@ private static void AddCrashHandler(IDiagnosticLogger logger, BuildTarget target
case BuildTarget.GameCoreXboxOne:
// No standalone crash handler for Xbox - comes with Breakpad
return;
case BuildTarget.PS5:
// No standalone crash handler for PlayStation
return;
default:
throw new ArgumentException($"Unsupported build target: {target}");
}
Expand Down Expand Up @@ -158,6 +165,13 @@ private static void UploadDebugSymbols(IDiagnosticLogger logger, BuildTarget tar
paths += $" \"{xboxSentryPluginPath}\"";
}
break;
case BuildTarget.PS5:
var playstationSentryPluginPath = Path.GetFullPath("Assets/Plugins/Sentry/");
if (Directory.Exists(playstationSentryPluginPath))
{
paths += $" \"{playstationSentryPluginPath}\"";
}
break;
case BuildTarget.StandaloneLinux64:
var linuxSentryDbg = Path.GetFullPath($"Packages/{SentryPackageInfo.GetName()}/Plugins/Linux/Sentry/libsentry.dbg.so");
if (File.Exists(linuxSentryDbg))
Expand Down
4 changes: 2 additions & 2 deletions src/Sentry.Unity.Native/Sentry.Unity.Native.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
<Csc
Sources="@(Compile)"
References="@(ReferencePath)"
OutputAssembly="$(OutDir)Sentry.Unity.Native.Console.dll"
DefineConstants="$(DefineConstants);SENTRY_NATIVE_STATIC"
OutputAssembly="$(OutDir)Sentry.Unity.Native.PlayStation.dll"
DefineConstants="$(DefineConstants);SENTRY_NATIVE_PLAYSTATION"
TargetType="library"
EmitDebugInformation="true"
/>
Expand Down
Loading