Skip to content

Commit 53b2b1e

Browse files
committed
Expose unwinding in the Backtrace UI
1 parent 723b294 commit 53b2b1e

File tree

3 files changed

+42
-33
lines changed

3 files changed

+42
-33
lines changed

Editor/BacktraceConfigurationEditor.cs

Lines changed: 31 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public class BacktraceConfigurationEditor : UnityEditor.Editor
1212
protected static bool showMetricsSettings = false;
1313
protected static bool showClientAdvancedSettings = false;
1414
protected static bool showDatabaseSettings = false;
15-
15+
protected static bool showNativeCrashesSettings = false;
1616
public override void OnInspectorGUI()
1717
{
1818
serializedObject.Update();
@@ -43,21 +43,6 @@ public override void OnInspectorGUI()
4343
EditorGUILayout.PropertyField(
4444
serializedObject.FindProperty("IgnoreSslValidation"),
4545
new GUIContent(BacktraceConfigurationLabels.LABEL_IGNORE_SSL_VALIDATION));
46-
#endif
47-
#if UNITY_ANDROID || UNITY_IOS
48-
EditorGUILayout.PropertyField(
49-
serializedObject.FindProperty("HandleANR"),
50-
new GUIContent(BacktraceConfigurationLabels.LABEL_HANDLE_ANR));
51-
52-
EditorGUILayout.PropertyField(
53-
serializedObject.FindProperty("OomReports"),
54-
new GUIContent(BacktraceConfigurationLabels.LABEL_HANDLE_OOM));
55-
56-
#if UNITY_2019_2_OR_NEWER && UNITY_ANDROID
57-
EditorGUILayout.PropertyField(
58-
serializedObject.FindProperty("SymbolsUploadToken"),
59-
new GUIContent(BacktraceConfigurationLabels.LABEL_SYMBOLS_UPLOAD_TOKEN));
60-
#endif
6146
#endif
6247
EditorGUILayout.PropertyField(
6348
serializedObject.FindProperty("UseNormalizedExceptionMessage"),
@@ -141,20 +126,41 @@ public override void OnInspectorGUI()
141126
serializedObject.FindProperty("DeduplicationStrategy"),
142127
new GUIContent(BacktraceConfigurationLabels.LABEL_DEDUPLICATION_RULES));
143128

129+
GUIStyle showNativeCrashesSupportFoldout = new GUIStyle(EditorStyles.foldout);
130+
showNativeCrashesSettings = EditorGUILayout.Foldout(showNativeCrashesSettings, BacktraceConfigurationLabels.LABEL_NATIVE_CRASHES, showNativeCrashesSupportFoldout);
131+
if (showNativeCrashesSettings)
132+
{
144133
#if UNITY_STANDALONE_WIN
145134
EditorGUILayout.PropertyField(
146135
serializedObject.FindProperty("MinidumpType"),
147136
new GUIContent(BacktraceConfigurationLabels.LABEL_MINIDUMP_SUPPORT));
148137
#endif
149138

150-
#if UNITY_STANDALONE_LINUX || UNITY_STANDALONE_OSX || UNITY_STANDALONE_WIN
151-
EditorGUILayout.PropertyField(
152-
serializedObject.FindProperty("AddUnityLogToReport"),
153-
new GUIContent(BacktraceConfigurationLabels.LABEL_ADD_UNITY_LOG));
154139

155-
#endif
140+
#if UNITY_ANDROID || UNITY_IOS
141+
EditorGUILayout.PropertyField(
142+
serializedObject.FindProperty("CaptureNativeCrashes"),
143+
new GUIContent(BacktraceConfigurationLabels.CAPTURE_NATIVE_CRASHES));
144+
145+
EditorGUILayout.PropertyField(
146+
serializedObject.FindProperty("HandleANR"),
147+
new GUIContent(BacktraceConfigurationLabels.LABEL_HANDLE_ANR));
148+
149+
EditorGUILayout.PropertyField(
150+
serializedObject.FindProperty("OomReports"),
151+
new GUIContent(BacktraceConfigurationLabels.LABEL_HANDLE_OOM));
156152

153+
#if UNITY_2019_2_OR_NEWER && UNITY_ANDROID
154+
EditorGUILayout.PropertyField(
155+
serializedObject.FindProperty("ClientSideUnwinding"),
156+
new GUIContent(BacktraceConfigurationLabels.LABEL_ENABLE_CLIENT_SIDE_UNWINDING));
157157

158+
EditorGUILayout.PropertyField(
159+
serializedObject.FindProperty("SymbolsUploadToken"),
160+
new GUIContent(BacktraceConfigurationLabels.LABEL_SYMBOLS_UPLOAD_TOKEN));
161+
#endif
162+
#endif
163+
}
158164
GUIStyle breadcrumbsSupportFoldout = new GUIStyle(EditorStyles.foldout);
159165
showBreadcrumbsSettings = EditorGUILayout.Foldout(showBreadcrumbsSettings, BacktraceConfigurationLabels.LABEL_BREADCRUMBS_SECTION, breadcrumbsSupportFoldout);
160166
if (showBreadcrumbsSettings)
@@ -176,11 +182,12 @@ public override void OnInspectorGUI()
176182
}
177183
}
178184

179-
#if UNITY_ANDROID || UNITY_IOS
185+
#if UNITY_STANDALONE_LINUX || UNITY_STANDALONE_OSX || UNITY_STANDALONE_WIN
180186
EditorGUILayout.PropertyField(
181-
serializedObject.FindProperty("CaptureNativeCrashes"),
182-
new GUIContent(BacktraceConfigurationLabels.CAPTURE_NATIVE_CRASHES));
187+
serializedObject.FindProperty("AddUnityLogToReport"),
188+
new GUIContent(BacktraceConfigurationLabels.LABEL_ADD_UNITY_LOG));
183189
#endif
190+
184191
EditorGUILayout.PropertyField(
185192
serializedObject.FindProperty("AutoSendMode"),
186193
new GUIContent(BacktraceConfigurationLabels.LABEL_AUTO_SEND_MODE));

Editor/BacktraceConfigurationLabels.cs

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,19 @@ internal static class BacktraceConfigurationLabels
99

1010
internal static string LABEL_DESTROY_CLIENT_ON_SCENE_LOAD = "Destroy client on new scene load (false - Backtrace managed)";
1111
internal static string LABEL_SAMPLING = "Log random sampling rate";
12-
internal static string LABEL_HANDLE_ANR = "Handle ANR (Application not responding)";
13-
#if UNITY_ANDROID || UNITY_IOS
14-
internal static string LABEL_HANDLE_OOM = "Send Out of Memory exceptions to Backtrace";
15-
#endif
1612

1713
internal const string LABEL_ENABLE_METRICS = "Enable crash free metrics reporting";
1814
internal const string LABEL_METRICS_TIME_INTERVAL = "Auto send interval in min";
1915
internal const string LABEL_CRASH_FREE_SECTION = "Crash Free Metrics Reporting";
2016

17+
internal const string LABEL_NATIVE_CRASHES = "Native crashes";
18+
internal static string LABEL_MINIDUMP_SUPPORT = "Minidump type";
19+
internal const string LABEL_ENABLE_CLIENT_SIDE_UNWINDING = "Enable client-side unwinding";
20+
internal static string LABEL_HANDLE_ANR = "Capture ANR (Application not responding)";
21+
internal static string LABEL_HANDLE_OOM = "Send Out of Memory exceptions to Backtrace";
22+
internal static string LABEL_SEND_UNHANDLED_GAME_CRASHES_ON_STARTUP = "Send unhandled native game crashes on startup";
23+
internal static string LABEL_SYMBOLS_UPLOAD_TOKEN = "Symbols upload token";
24+
2125
internal const string LABEL_BREADCRUMBS_SECTION = "Breadcrumbs support";
2226
internal const string LABEL_ENABLE_BREADCRUMBS = "Enable breadcrumbs support";
2327
internal const string LABEL_BREADCRUMBS_EVENTS = "Breadcrumbs events type";
@@ -28,15 +32,12 @@ internal static class BacktraceConfigurationLabels
2832
internal static string LABEL_REPORT_FILTER = "Filter reports";
2933
internal static string LABEL_GAME_OBJECT_DEPTH = "Game object depth limit";
3034
internal static string LABEL_IGNORE_SSL_VALIDATION = "Ignore SSL validation";
31-
internal static string LABEL_SEND_UNHANDLED_GAME_CRASHES_ON_STARTUP = "Send unhandled native game crashes on startup";
3235
internal static string LABEL_USE_NORMALIZED_EXCEPTION_MESSAGE = "Use normalized exception message";
3336
internal static string LABEL_PERFORMANCE_STATISTICS = "Enable performance statistics";
34-
internal static string LABEL_SYMBOLS_UPLOAD_TOKEN = "Symbols upload token";
35-
37+
3638
// database labels
3739
internal static string LABEL_ENABLE_DATABASE = "Enable Database";
3840
internal static string LABEL_PATH = "Backtrace database path";
39-
internal static string LABEL_MINIDUMP_SUPPORT = "Minidump type";
4041
internal static string LABEL_ADD_UNITY_LOG = "Attach Unity Player.log";
4142
internal static string LABEL_GENERATE_SCREENSHOT_ON_EXCEPTION = "Attach screenshot";
4243
internal static string LABEL_DEDUPLICATION_RULES = "Client-Side deduplication";

Runtime/Model/BacktraceConfiguration.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ public class BacktraceConfiguration : ScriptableObject
112112
/// <summary>
113113
/// Handle ANR events - Application not responding
114114
/// </summary>
115-
[Tooltip("Handle ANR events - Application not responding")]
115+
[Tooltip("Capture ANR events - Application not responding")]
116116
public bool HandleANR = true;
117117

118118
#if UNITY_ANDROID || UNITY_IOS
@@ -258,6 +258,7 @@ public class BacktraceConfiguration : ScriptableObject
258258
[Tooltip("This specifies in which order records are sent to the Backtrace server.")]
259259
public RetryOrder RetryOrder;
260260

261+
[Tooltip("Enable client-side unwinding.")]
261262
public bool ClientSideUnwinding = false;
262263

263264
/// <summary>

0 commit comments

Comments
 (0)