From d53e321b9912c901a827364fd7c50e6afefa5dd1 Mon Sep 17 00:00:00 2001 From: de4dot Date: Fri, 25 Oct 2013 22:08:52 +0200 Subject: [PATCH] Rename field and method --- de4dot.blocks/StackTracePatcher.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/de4dot.blocks/StackTracePatcher.cs b/de4dot.blocks/StackTracePatcher.cs index e97432f0..a5acce88 100644 --- a/de4dot.blocks/StackTracePatcher.cs +++ b/de4dot.blocks/StackTracePatcher.cs @@ -25,12 +25,12 @@ namespace de4dot.blocks { public class StackTracePatcher { static readonly FieldInfo methodField; static readonly FieldInfo framesField; - static readonly FieldInfo iMethodsToSkip; + static readonly FieldInfo methodsToSkipField; static StackTracePatcher() { methodField = GetStackFrameMethodField(); framesField = GetStackTraceStackFramesField(); - iMethodsToSkip = GetMethodsToSkip(); + methodsToSkipField = GetMethodsToSkipField(); } static FieldInfo GetStackFrameMethodField() { @@ -43,7 +43,7 @@ namespace de4dot.blocks { return GetFieldThrow(typeof(StackTrace), typeof(StackFrame[]), flags, "Could not find StackTrace's frames (StackFrame[]) field"); } - static FieldInfo GetMethodsToSkip() { + static FieldInfo GetMethodsToSkipField() { var flags = BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance; return GetFieldThrow(typeof(StackTrace), "m_iMethodsToSkip", flags, "Could not find StackTrace's iMethodsToSkip field"); } @@ -81,7 +81,7 @@ namespace de4dot.blocks { public static StackTrace WriteStackFrame(StackTrace stackTrace, int frameNo, MethodBase newMethod) { var framesField = GetStackTraceStackFramesField(); var frames = (StackFrame[])framesField.GetValue(stackTrace); - int numFramesToSkip = (int)iMethodsToSkip.GetValue(stackTrace); + int numFramesToSkip = (int)methodsToSkipField.GetValue(stackTrace); WriteMethodBase(frames[numFramesToSkip + frameNo], newMethod); return stackTrace; }