public override bool SetBreakpoint(Module module) { bool okMod = MethodKey.IsSameModule(module.FullPath); Debug.Assert(okMod, "Trying to set a BP that belongs in another module"); if (!okMod) { return(false); } SourcecodeSegment segment = SourcecodeSegment.CreateForIL(module, this.Location.Line, (int)MethodKey.Token, (int)ILOffset); if (segment == null) { return(false); } try { ICorDebugFunctionBreakpoint corBreakpoint = segment.CorFunction.GetILCode().CreateBreakpoint((uint)segment.ILStart); corBreakpoint.Activate(Enabled ? 1 : 0); corBreakpoints.Add(corBreakpoint); OnSet(new BreakpointEventArgs(this)); return(true); } catch { return(false); } }
public override bool SetBreakpoint(Module module) { SourcecodeSegment segment = SourcecodeSegment.CreateForIL(module, this.Line, (int)MetadataToken, ILOffset); if (segment == null) { return(false); } try { ICorDebugFunctionBreakpoint corBreakpoint = segment.CorFunction.GetILCode().CreateBreakpoint((uint)segment.ILStart); corBreakpoint.Activate(Enabled ? 1 : 0); corBreakpoints.Add(corBreakpoint); OnSet(new BreakpointEventArgs(this)); return(true); } catch { return(false); } }