diff --git a/src/BUTR.CrashReport.Bannerlord.Source/CrashReportHtmlRenderer.cs b/src/BUTR.CrashReport.Bannerlord.Source/CrashReportHtmlRenderer.cs index 18f8bac..c46d71f 100644 --- a/src/BUTR.CrashReport.Bannerlord.Source/CrashReportHtmlRenderer.cs +++ b/src/BUTR.CrashReport.Bannerlord.Source/CrashReportHtmlRenderer.cs @@ -520,13 +520,13 @@ private static string GetEnhancedStacktraceHtml(CrashReportModel crashReport) .Append("Method From Stackframe Issue: ").Append(stacktrace.MethodFromStackframeIssue).Append("
") .Append("Approximate IL Offset: ").Append(stacktrace.ILOffset is not null ? $"{stacktrace.ILOffset:X4}" : "UNKNOWN").Append("
") .Append("Native Offset: ").Append(stacktrace.NativeOffset is not null ? $"{stacktrace.NativeOffset:X4}" : "UNKNOWN") - .Append($"
+ IL:
")
+                    .AppendIf(stacktrace.ExecutingMethod.ILInstructions.Count > 0, $"
+ IL:
")
                     .AppendJoinIf(stacktrace.ExecutingMethod.ILInstructions.Count > 0, Environment.NewLine, stacktrace.ExecutingMethod.ILInstructions.Select(x => x.EscapeGenerics()).ToArray()).Append("
") - .Append($"
+ IL with C#:
")
+                    .AppendIf(stacktrace.ExecutingMethod.CSharpILMixedInstructions.Count > 0, $"
+ IL with C#:
")
                     .AppendJoinIf(stacktrace.ExecutingMethod.CSharpILMixedInstructions.Count > 0, Environment.NewLine, stacktrace.ExecutingMethod.CSharpILMixedInstructions.Select(x => x.EscapeGenerics()).ToArray()).Append("
") - .Append($"
+ C#:
")
+                    .AppendIf(stacktrace.ExecutingMethod.CSharpInstructions.Count > 0, $"
+ C#:
")
                     .AppendJoinIf(stacktrace.ExecutingMethod.CSharpInstructions.Count > 0, Environment.NewLine, stacktrace.ExecutingMethod.CSharpInstructions.Select(x => x.EscapeGenerics()).ToArray()).Append("
") - .Append($"
+ Native:
")
+                    .AppendIf(stacktrace.ExecutingMethod.NativeInstructions.Count > 0, $"
+ Native:
")
                     .AppendJoinIf(stacktrace.ExecutingMethod.NativeInstructions.Count > 0, Environment.NewLine, stacktrace.ExecutingMethod.NativeInstructions.Select(x => x.EscapeGenerics()).ToArray()).Append("
") .Append("") .Append(""); @@ -545,11 +545,11 @@ private static string GetEnhancedStacktraceHtml(CrashReportModel crashReport) .AppendIf(moduleId == "UNKNOWN", sb => sb.Append("Module Id: ").Append(moduleId).Append("
")) .AppendIf(moduleId != "UNKNOWN", sb => sb.Append("Module Id: ").Append("").Append(moduleId).Append("").Append("
")) .Append("Method: ").Append(method.MethodFullDescription.EscapeGenerics()).Append("
") - .Append($"
+ IL:
")
+                            .AppendIf(method.ILInstructions.Count > 0, $"
+ IL:
")
                             .AppendJoinIf(method.ILInstructions.Count > 0, Environment.NewLine, method.ILInstructions.Select(x => x.EscapeGenerics()).ToArray()).Append("
") - .Append($"
+ IL with C#:
")
+                            .AppendIf(method.CSharpILMixedInstructions.Count > 0, $"
+ IL with C#:
")
                             .AppendJoinIf(method.CSharpILMixedInstructions.Count > 0, Environment.NewLine, method.CSharpILMixedInstructions.Select(x => x.EscapeGenerics()).ToArray()).Append("
") - .Append($"
+ C#:
")
+                            .AppendIf(method.CSharpInstructions.Count > 0, $"
+ C#:
")
                             .AppendJoinIf(method.CSharpInstructions.Count > 0, Environment.NewLine, method.CSharpInstructions.Select(x => x.EscapeGenerics()).ToArray()).Append("
") .Append(""); } @@ -567,11 +567,11 @@ private static string GetEnhancedStacktraceHtml(CrashReportModel crashReport) .AppendIf(moduleId2 == "UNKNOWN", sb => sb.Append("Module Id: ").Append(moduleId2).Append("
")) .AppendIf(moduleId2 != "UNKNOWN", sb => sb.Append("Module Id: ").Append("").Append(moduleId2).Append("").Append("
")) .Append("Method: ").Append(stacktrace.OriginalMethod.MethodFullDescription.EscapeGenerics()).Append("
") - .Append($"
+ IL:
")
+                        .AppendIf(stacktrace.OriginalMethod.ILInstructions.Count > 0, $"
+ IL:
")
                         .AppendJoinIf(stacktrace.OriginalMethod.ILInstructions.Count > 0, Environment.NewLine, stacktrace.OriginalMethod.ILInstructions.Select(x => x.EscapeGenerics()).ToArray()).Append("
") - .Append($"
+ IL with C#:
")
+                        .AppendIf(stacktrace.OriginalMethod.CSharpILMixedInstructions.Count > 0, $"
+ IL with C#:
")
                         .AppendJoinIf(stacktrace.OriginalMethod.CSharpILMixedInstructions.Count > 0, Environment.NewLine, stacktrace.OriginalMethod.CSharpILMixedInstructions.Select(x => x.EscapeGenerics()).ToArray()).Append("
") - .Append($"
+ C#:
")
+                        .AppendIf(stacktrace.OriginalMethod.CSharpInstructions.Count > 0, $"
+ C#:
")
                         .AppendJoinIf(stacktrace.OriginalMethod.CSharpInstructions.Count > 0, Environment.NewLine, stacktrace.OriginalMethod.CSharpInstructions.Select(x => x.EscapeGenerics()).ToArray()).Append("
") .Append("") .Append("");