Browse Source

Order and merge the stepping ranges at the end

pull/191/merge
Eusebiu Marcu 15 years ago
parent
commit
8621e93ec1
  1. 2
      Debugger/Debugger.Core/SourcecodeSegment.cs
  2. 9
      Debugger/Debugger.Core/StackFrame.cs
  3. 21
      ICSharpCode.Decompiler/CodeMappings.cs

2
Debugger/Debugger.Core/SourcecodeSegment.cs

@ -383,7 +383,7 @@ namespace Debugger @@ -383,7 +383,7 @@ namespace Debugger
segment.endColumn = 0;
segment.corFunction = corFunction;
segment.ilStart = offset;
segment.ilEnd = ranges[ranges.Length - 1];
segment.ilEnd = ranges[1];
segment.stepRanges = ranges;
return segment;

9
Debugger/Debugger.Core/StackFrame.cs

@ -191,13 +191,8 @@ namespace Debugger @@ -191,13 +191,8 @@ namespace Debugger
void AsyncStep(bool stepIn)
{
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");
Stepper stepInStepper = Stepper.StepIn(this, ILRanges, "normal");
this.Thread.CurrentStepIn = stepInStepper;
Stepper clearCurrentStepIn = Stepper.StepOut(this, "clear current step in");
clearCurrentStepIn.StepComplete += delegate {
@ -207,7 +202,7 @@ namespace Debugger @@ -207,7 +202,7 @@ namespace Debugger
};
clearCurrentStepIn.Ignore = true;
} else {
Stepper.StepOver(this, nextSt.StepRanges, "normal");
Stepper.StepOver(this, ILRanges, "normal");
}
AsyncContinue();

21
ICSharpCode.Decompiler/CodeMappings.cs

@ -45,24 +45,19 @@ namespace ICSharpCode.Decompiler @@ -45,24 +45,19 @@ namespace ICSharpCode.Decompiler
/// <returns></returns>
public int[] ToArray()
{
var resultList = new List<int>();
// add list for the current source code line
var currentList = MemberMapping.MemberCodeMappings
.FindAll(m => m.SourceCodeLine == this.SourceCodeLine)
.OrderBy(m => m.ILInstructionOffset.From);
foreach (var element in currentList.Distinct(new SourceCodeMappingComparer())) {
resultList.Add(element.ILInstructionOffset.From);
resultList.Add(element.ILInstructionOffset.To);
}
.ConvertAll<ILRange>(m => m.ILInstructionOffset);
// add inverted
var invertedList = MemberMapping.GetInvertedList();
if (invertedList != null && invertedList.Count() > 0) {
foreach (var range in invertedList) {
resultList.Add(range.From);
resultList.Add(range.To);
}
currentList.AddRange(MemberMapping.GetInvertedList());
var resultList = new List<int>();
foreach (var element in ILRange.OrderAndJoint(currentList)) {
resultList.Add(element.From);
resultList.Add(element.To);
}
return resultList.ToArray();

Loading…
Cancel
Save