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); }
/// <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)); }