예제 #1
0
        public void RemapFunction(int newILOffset)
        {
            ICorDebugILFrame ilframe = GetILFrame();

            if (ilframe == null)
            {
                throw new Exception("Cannot remap on non-il frame.");
            }
            ICorDebugILFrame2 ilframe2 = (ICorDebugILFrame2)ilframe;

            ilframe2.RemapFunction((uint)newILOffset);
        }
예제 #2
0
        /// <summary>
        /// Finds appropriete SequncePointMap instances and builds SequencePointRemapper, gets new IL offset and call RemapFunction.
        /// </summary>
        public void FunctionRemapOpportunity(ICorDebugAppDomain pAppDomain, ICorDebugThread pThread, ICorDebugFunction pOldFunction, ICorDebugFunction pNewFunction, uint oldILOffset)
        {
            ICorDebugILFrame2 frame = (ICorDebugILFrame2)pThread.GetActiveFrame();

            uint nToken = pOldFunction.GetToken();

            SequencePointRemapper remapper;

            if (!remappers.TryGetValue(nToken, out remapper))
            {
                throw new KeyNotFoundException("Methods sequence points not found.");
            }
            frame.__RemapFunction(remapper.TranslateILOffset(oldILOffset));
        }