Exemple #1
0
        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);
        }
Exemple #2
0
        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));
 }
Exemple #4
0
 SourcecodeSegment GetSegmentForOffet(int offset)
 {
     return(SourcecodeSegment.Resolve(this.MethodInfo.DebugModule, corFunction, offset));
 }