-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add Container build callsite, add object creation callsite
- Loading branch information
1 parent
3f065d1
commit d1087fc
Showing
22 changed files
with
364 additions
and
250 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
using System.Collections.Generic; | ||
using System.Diagnostics; | ||
using System.Linq; | ||
using UnityEngine; | ||
|
||
namespace Reflex | ||
{ | ||
internal static class Diagnosis | ||
{ | ||
public static List<CallSite> GetCallSite(int skipFrames) | ||
{ | ||
var result = new List<CallSite>(); | ||
var stackTrace = new StackTrace(skipFrames, true); | ||
var frames = stackTrace.GetFrames(); | ||
|
||
foreach (var frame in frames.Where(f => f.GetFileName() != null)) | ||
{ | ||
var methodName = frame.GetMethod()?.Name; | ||
var className = frame.GetMethod()?.DeclaringType?.FullName; | ||
var lineNumber = frame.GetFileLineNumber(); | ||
var filePath = GetUnityPath(frame.GetFileName()); | ||
result.Add(new CallSite(className, methodName, filePath, lineNumber)); | ||
} | ||
|
||
return result; | ||
} | ||
|
||
private static string GetUnityPath(string path) | ||
{ | ||
return path.Replace("\\", "/").Replace(Application.dataPath, "Assets"); | ||
} | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.