public bool SetBreakpoint(Module module) { ICorDebugFunction corFunction; int ilOffset; if (!sourcecodeSegment.GetFunctionAndOffset(module, false, out corFunction, out ilOffset)) { return(false); } corBreakpoint = corFunction.ILCode.CreateBreakpoint((uint)ilOffset); hadBeenSet = true; corBreakpoint.Activate(enabled?1:0); OnChanged(); return(true); }
SourcecodeSegment SetIP(bool simulate, string filename, int line, int column) { process.AssertPaused(); SourcecodeSegment suggestion = new SourcecodeSegment(filename, line, column, column); ICorDebugFunction corFunction; int ilOffset; if (!suggestion.GetFunctionAndOffset(this.Module, false, out corFunction, out ilOffset)) { return(null); } else { if (corFunction.Token != methodProps.Token) { return(null); } else { try { if (simulate) { CorILFrame.CanSetIP((uint)ilOffset); } else { // invalidates all frames and chains for the current thread CorILFrame.SetIP((uint)ilOffset); process.NotifyPaused(new PauseSession(PausedReason.SetIP)); process.Pause(false); } } catch { return(null); } return(GetSegmentForOffet((uint)ilOffset)); } } }
SourcecodeSegment SetIP(bool simulate, string filename, int line, int column) { process.AssertPaused(); SourcecodeSegment suggestion = new SourcecodeSegment(filename, line, column, column); ICorDebugFunction corFunction; int ilOffset; if (!suggestion.GetFunctionAndOffset(this.Module, false, out corFunction, out ilOffset)) { return null; } else { if (corFunction.Token != methodProps.Token) { return null; } else { try { if (simulate) { CorILFrame.CanSetIP((uint)ilOffset); } else { // invalidates all frames and chains for the current thread CorILFrame.SetIP((uint)ilOffset); process.NotifyPaused(new PauseSession(PausedReason.SetIP)); process.Pause(false); } } catch { return null; } return GetSegmentForOffet((uint)ilOffset); } } }