Skip to content

Commit 2e4600d

Browse files
committed
Replace Apkd.UnityDemystifier with Ben.Demystifier
1 parent b380ee7 commit 2e4600d

22 files changed

+536
-1432
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ You need to have at least [BepInEx 5,x](https://github.com/BepInEx/BepInEx) inst
77

88
### DemystifyExceptions
99
Turns exceptions into a more readable format. Resolves enumerators, lambdas and other complex structures.
10-
Based on [Apkd.UnityDemystifier](https://github.com/apkd/Apkd.UnityDemystifier).
10+
Based on [Ben.Demystifier](https://github.com/benaadams/Ben.Demystifier).
1111

1212
**How to use:** This is a preloader patcher. Put the compiled DLL into `BepInEx/patchers`. Requires BepInEx 5 (or BepInEx 4 with MonoMod.RuntimeDetour).
1313

src/DemystifyExceptions/Demystify/CacheDictionary.cs

Lines changed: 0 additions & 40 deletions
This file was deleted.

src/DemystifyExceptions/Demystify/EnhancedStackFrame.cs

Lines changed: 4 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
11
// Copyright (c) Ben A Adams. All rights reserved.
22
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
33

4-
using System;
5-
using System.Diagnostics;
6-
using System.IO;
74
using System.Reflection;
8-
using DemystifyExceptions.Demystify.Internal;
95

10-
namespace DemystifyExceptions.Demystify
6+
namespace System.Diagnostics
117
{
12-
internal sealed class EnhancedStackFrame : StackFrame
8+
public class EnhancedStackFrame : StackFrame
139
{
1410
private readonly int _colNumber;
1511
private readonly string _fileName;
@@ -27,11 +23,9 @@ internal EnhancedStackFrame(StackFrame stackFrame, ResolvedMethod methodInfo, st
2723
_colNumber = colNumber;
2824
}
2925

30-
internal StackFrame StackFrame { get; }
26+
public StackFrame StackFrame { get; }
3127

32-
internal ResolvedMethod MethodInfo { get; }
33-
34-
internal bool IsEmpty => MethodInfo == null;
28+
public ResolvedMethod MethodInfo { get; }
3529

3630
/// <summary>
3731
/// Gets the column number in the file that contains the code that is executing.
@@ -60,36 +54,9 @@ public override int GetFileLineNumber()
6054
/// <returns>The file name, or null if the file name cannot be determined.</returns>
6155
public override string GetFileName()
6256
{
63-
if (_fileName.IsNullOrWhitespace())
64-
return null;
65-
66-
if (_fileName.StartsWith(@"C:\buildslave\unity", StringComparison.Ordinal))
67-
return null;
68-
69-
return Path.GetFileName(_fileName);
70-
// return _fileName;
71-
}
72-
73-
internal string GetFullFilename()
74-
{
75-
if (_fileName.IsNullOrWhitespace())
76-
return null;
77-
var index = _fileName.IndexOf("\\Assets\\");
78-
if (index >= 0)
79-
return _fileName.Substring(index + 1);
8057
return _fileName;
8158
}
8259

83-
internal StringBuilder AppendFullFilename(StringBuilder sb)
84-
{
85-
if (_fileName.IsNullOrWhitespace())
86-
return sb;
87-
var index = _fileName.IndexOf("\\Assets\\");
88-
if (index >= 0)
89-
return sb.Append(_fileName, index + 1);
90-
return sb.Append(_fileName);
91-
}
92-
9360
/// <summary>
9461
/// Gets the offset from the start of the Microsoft intermediate language (MSIL)
9562
/// code for the method that is executing. This offset might be an approximation

0 commit comments

Comments
 (0)