void AsyncStep(bool stepIn) { if (this.MethodInfo.DebugModule.HasSymbols == false) { throw new DebuggerException("Unable to step. No symbols loaded."); } SourcecodeSegment nextSt = NextStatement; if (nextSt == null) { throw new DebuggerException("Unable to step. Next statement not aviable"); } if (stepIn) { Stepper stepInStepper = Stepper.StepIn(this, nextSt.StepRanges, "normal"); this.Thread.CurrentStepIn = stepInStepper; Stepper clearCurrentStepIn = Stepper.StepOut(this, "clear current step in"); clearCurrentStepIn.StepComplete += delegate { if (this.Thread.CurrentStepIn == stepInStepper) { this.Thread.CurrentStepIn = null; } }; clearCurrentStepIn.Ignore = true; } else { Stepper.StepOver(this, nextSt.StepRanges, "normal"); } AsyncContinue(); }
void AsyncStep(bool stepIn) { List <ILRange> stepRanges = new List <ILRange>(); var symbolSource = this.Process.GetSymbolSource(this.MethodInfo); var seq = symbolSource.GetSequencePoint(this.MethodInfo, this.IP); if (seq != null) { Process.TraceMessage("Step over: {0} IL:{1}", seq, string.Join(" ", seq.ILRanges)); stepRanges.AddRange(seq.ILRanges); stepRanges.AddRange(symbolSource.GetIgnoredILRanges(this.MethodInfo)); } // Remove overlapping and connected ranges List <int> fromToList = new List <int>(); foreach (var range in stepRanges.OrderBy(r => r.From)) { if (fromToList.Count > 0 && range.From <= fromToList[fromToList.Count - 1]) { fromToList[fromToList.Count - 1] = Math.Max(range.To, fromToList[fromToList.Count - 1]); } else { fromToList.Add(range.From); fromToList.Add(range.To); } } if (stepIn) { Stepper stepInStepper = Stepper.StepIn(this, fromToList.ToArray(), "normal"); this.Thread.CurrentStepIn = stepInStepper; Stepper clearCurrentStepIn = Stepper.StepOut(this, "clear current step in"); clearCurrentStepIn.StepComplete += delegate { if (this.Thread.CurrentStepIn == stepInStepper) { this.Thread.CurrentStepIn = null; } }; clearCurrentStepIn.Ignore = true; } else { Stepper.StepOver(this, fromToList.ToArray(), "normal"); } this.Process.AsyncContinue(DebuggeeStateAction.Clear); }
void AsyncStep(bool stepIn) { if (stepIn) { Stepper stepInStepper = Stepper.StepIn(this, ILRanges, "normal"); this.Thread.CurrentStepIn = stepInStepper; Stepper clearCurrentStepIn = Stepper.StepOut(this, "clear current step in"); clearCurrentStepIn.StepComplete += delegate { if (this.Thread.CurrentStepIn == stepInStepper) { this.Thread.CurrentStepIn = null; } }; clearCurrentStepIn.Ignore = true; } else { Stepper.StepOver(this, ILRanges, "normal"); } AsyncContinue(); }
void AsyncStep(bool stepIn) { int[] stepRanges; if (ILRanges == null) { SourcecodeSegment nextSt = NextStatement; if (nextSt == null) { throw new DebuggerException("Unable to step. Next statement not aviable"); } stepRanges = nextSt.StepRanges; } else { stepRanges = ILRanges; } if (stepIn) { Stepper stepInStepper = Stepper.StepIn(this, stepRanges, "normal"); this.Thread.CurrentStepIn = stepInStepper; Stepper clearCurrentStepIn = Stepper.StepOut(this, "clear current step in"); clearCurrentStepIn.StepComplete += delegate { if (this.Thread.CurrentStepIn == stepInStepper) { this.Thread.CurrentStepIn = null; } }; clearCurrentStepIn.Ignore = true; } else { Stepper.StepOver(this, stepRanges, "normal"); } AsyncContinue(); }