SourcecodeSegment SetIP(bool simulate, string filename, int line, int column) { process.AssertPaused(); SourcecodeSegment segment = SourcecodeSegment.Resolve(this.MethodInfo.DebugModule, filename, null, line, column); if (segment != null && segment.CorFunction.GetToken() == this.MethodInfo.MetadataToken) { try { if (simulate) { CorILFrame.CanSetIP((uint)segment.ILStart); } else { // Invalidates all frames and chains for the current thread CorILFrame.SetIP((uint)segment.ILStart); process.NotifyResumed(DebuggeeStateAction.Keep); process.NotifyPaused(PausedReason.SetIP); process.RaisePausedEvents(); } } catch { return(null); } return(segment); } return(null); }
public virtual bool SetBreakpoint(Module module) { if (this.fileName == null) { return(false); } SourcecodeSegment segment = SourcecodeSegment.Resolve(module, FileName, CheckSum, Line, Column); if (segment == null) { return(false); } originalLocation = segment; ICorDebugFunctionBreakpoint corBreakpoint = segment.CorFunction.GetILCode().CreateBreakpoint((uint)segment.ILStart); corBreakpoint.Activate(enabled ? 1 : 0); corBreakpoints.Add(corBreakpoint); OnSet(new BreakpointEventArgs(this)); return(true); }
SourcecodeSegment GetSegmentForOffset(int offset) { if (SourceCodeLine != 0) { return(SourcecodeSegment.ResolveForIL(this.MethodInfo.DebugModule, corFunction, SourceCodeLine, offset, ILRanges)); } return(SourcecodeSegment.Resolve(this.MethodInfo.DebugModule, corFunction, offset)); }
SourcecodeSegment GetSegmentForOffet(int offset) { return(SourcecodeSegment.Resolve(this.MethodInfo.DebugModule, corFunction, offset)); }