Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ InitializeSourceInfo()

void System.Diagnostics.StackFrameHelper.InitializeSourceInfo ( int iSkip,
bool fNeedFileInfo,
Exception exception )
inlinepackage

Definition at line 73 of file StackFrameHelper.cs.

74 {
75 StackTrace.GetStackFramesInternal(this, iSkip, fNeedFileInfo, exception);
76 if (!fNeedFileInfo || t_reentrancy > 0)
77 {
78 return;
79 }
81 try
82 {
83 if (s_getSourceLineInfo == null)
84 {
85 Type type = Type.GetType("System.Diagnostics.StackTraceSymbols, System.Diagnostics.StackTrace, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", throwOnError: false);
86 if (type == null)
87 {
88 return;
89 }
90 Type[] types = new Type[12]
91 {
92 typeof(Assembly),
93 typeof(string),
94 typeof(IntPtr),
95 typeof(int),
96 typeof(bool),
97 typeof(IntPtr),
98 typeof(int),
99 typeof(int),
100 typeof(int),
101 typeof(string).MakeByRefType(),
102 typeof(int).MakeByRefType(),
103 typeof(int).MakeByRefType()
104 };
105 MethodInfo method = type.GetMethod("GetSourceLineInfo", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic, null, types, null);
106 if (method == null)
107 {
108 return;
109 }
110 object target = Activator.CreateInstance(type);
113 }
114 for (int i = 0; i < iFrameCount; i++)
115 {
116 if (rgiMethodToken[i] != 0)
117 {
119 }
120 }
121 }
122 catch
123 {
124 }
125 finally
126 {
127 t_reentrancy--;
128 }
129 }
static GetSourceLineInfoDelegate s_getSourceLineInfo
delegate void GetSourceLineInfoDelegate(Assembly assembly, string assemblyPath, IntPtr loadedPeAddress, int loadedPeSize, bool isFileLayout, IntPtr inMemoryPdbAddress, int inMemoryPdbSize, int methodToken, int ilOffset, out string sourceFile, out int sourceLine, out int sourceColumn)
virtual Delegate CreateDelegate(Type delegateType)
Definition MethodInfo.cs:48
static int CompareExchange(ref int location1, int value, int comparand)

References System.Threading.Interlocked.CompareExchange(), System.Reflection.MethodInfo.CreateDelegate(), System.Activator.CreateInstance(), System.exception, System.Diagnostics.StackFrameHelper.GetSourceLineInfoDelegate(), System.Diagnostics.StackTrace.GetStackFramesInternal(), System.Type.GetType(), System.Diagnostics.StackFrameHelper.iFrameCount, System.Type.MakeByRefType(), System.Diagnostics.StackFrameHelper.rgAssembly, System.Diagnostics.StackFrameHelper.rgAssemblyPath, System.Diagnostics.StackFrameHelper.rgFilename, System.Diagnostics.StackFrameHelper.rgiColumnNumber, System.Diagnostics.StackFrameHelper.rgiILOffset, System.Diagnostics.StackFrameHelper.rgiInMemoryPdbSize, System.Diagnostics.StackFrameHelper.rgiIsFileLayout, System.Diagnostics.StackFrameHelper.rgiLineNumber, System.Diagnostics.StackFrameHelper.rgiLoadedPeSize, System.Diagnostics.StackFrameHelper.rgiMethodToken, System.Diagnostics.StackFrameHelper.rgInMemoryPdbAddress, System.Diagnostics.StackFrameHelper.rgLoadedPeAddress, System.Diagnostics.StackFrameHelper.s_getSourceLineInfo, System.Diagnostics.StackFrameHelper.t_reentrancy, System.type, and System.value.

Referenced by System.Diagnostics.StackFrame.BuildStackFrame().