Skip to content

Commit 0e25d36

Browse files
gm4slGeorge Menhorn
andauthored
xbox native client: fixes output directory for minidumps (#191)
Uses the updated API of backtrace_native_xbox.dll, previously backtrace_native_xbox_mt.dll, to specify a path for writing dump files. Prior to this commit, it was unpredictable as to whether a minidump could be written or not as the current directory of the process was (unintentionally) being used. With this change, minidumps are written to the value specified by the configuration's database path is passed which, by default, is `Application.persistentDataPath`. Removed unused exports, BacktraceCrash, used only for debugging, and BacktraceSetUrl, which was folded into BacktraceNativeXboxInit. The change will require updating to the latest backtrace_native_xbox.dll. [Internal Ref BT-509] Co-authored-by: George Menhorn <gmenhorn@backtrace.io>
1 parent 17aeba4 commit 0e25d36

File tree

1 file changed

+8
-13
lines changed

1 file changed

+8
-13
lines changed

Runtime/Native/XBOX/NativeClient.cs

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,29 +19,24 @@ namespace Backtrace.Unity.Runtime.Native.XBOX
1919

2020
internal class NativeClient : NativeClientBase, INativeClient
2121
{
22-
[DllImport("backtrace_native_xbox_mt.dll")]
23-
private static extern bool BacktraceCrash();
24-
25-
[DllImport("backtrace_native_xbox_mt.dll")]
22+
[DllImport("backtrace_native_xbox.dll")]
2623
private static extern bool BacktraceAddAttribute(
2724
[MarshalAs(UnmanagedType.LPWStr)] string name,
2825
[MarshalAs(UnmanagedType.LPWStr)] string value
2926
);
3027

31-
[DllImport("backtrace_native_xbox_mt.dll")]
28+
[DllImport("backtrace_native_xbox.dll")]
3229
private static extern bool BacktraceAddFile(
3330
[MarshalAs(UnmanagedType.LPWStr)] string name,
3431
[MarshalAs(UnmanagedType.LPWStr)] string path
3532
);
3633

37-
[DllImport("backtrace_native_xbox_mt.dll")]
38-
private static extern bool BacktraceSetUrl(
39-
[MarshalAs(UnmanagedType.LPWStr)] string url
34+
[DllImport("backtrace_native_xbox.dll")]
35+
private static extern bool BacktraceNativeXboxInit(
36+
[MarshalAs(UnmanagedType.LPWStr)] string url,
37+
[MarshalAs(UnmanagedType.LPWStr)] string dump_path
4038
);
4139

42-
[DllImport("backtrace_native_xbox_mt.dll")]
43-
private static extern bool BacktraceNativeInitialize();
44-
4540
/// <summary>
4641
/// Determine if the XBOX integration should be enabled
4742
/// </summary>
@@ -111,15 +106,15 @@ private void HandleNativeCrashes(IDictionary<string, string> clientAttributes, I
111106
}
112107

113108
var minidumpUrl = new BacktraceCredentials(_configuration.GetValidServerUrl()).GetMinidumpSubmissionUrl().ToString();
114-
BacktraceSetUrl(minidumpUrl);
109+
var dumpPath = _configuration.GetFullDatabasePath();
115110

116111
foreach (var attachment in attachments)
117112
{
118113
var name = Path.GetFileName(attachment);
119114
BacktraceAddFile(name, attachment);
120115
}
121116

122-
CaptureNativeCrashes = BacktraceNativeInitialize();
117+
CaptureNativeCrashes = BacktraceNativeXboxInit(minidumpUrl, dumpPath);
123118

124119
if (!CaptureNativeCrashes)
125120
{

0 commit comments

Comments
 (0)