Browse Source

modify step ranges.

pull/191/merge
Eusebiu Marcu 15 years ago
parent
commit
c002dfa032
  1. 18
      Debugger/ILSpy.Debugger/Services/Debugger/WindowsDebugger.cs
  2. 14
      ICSharpCode.Decompiler/CodeMappings.cs

18
Debugger/ILSpy.Debugger/Services/Debugger/WindowsDebugger.cs

@ -282,7 +282,7 @@ namespace ILSpy.Debugger.Services @@ -282,7 +282,7 @@ namespace ILSpy.Debugger.Services
// Stepping:
SourceCodeMapping GetNextCodeMapping()
MethodMapping GetNextCodeMapping()
{
uint token;
var instruction = CodeMappingsStorage.GetInstructionByTypeAndLine(
@ -291,9 +291,9 @@ namespace ILSpy.Debugger.Services @@ -291,9 +291,9 @@ namespace ILSpy.Debugger.Services
var val = CodeMappingsStorage[CurrentLineBookmark.Instance.TypeName];
var mapping = val.Find(m => m.MetadataToken == token);
return val.Find(m => m.MetadataToken == token);
return mapping.MethodCodeMappings.FirstOrDefault(s => s.ILInstructionOffset.From <= instruction.ILInstructionOffset.To);
//return mapping.MethodCodeMappings.FirstOrDefault(s => s.ILInstructionOffset.From <= instruction.ILInstructionOffset.To);
}
public void StepInto()
@ -315,8 +315,8 @@ namespace ILSpy.Debugger.Services @@ -315,8 +315,8 @@ namespace ILSpy.Debugger.Services
Continue();
} else {
var frame = debuggedProcess.SelectedThread.MostRecentStackFrame;
frame.SourceCodeLine = map.SourceCodeLine;
frame.ILRanges = (new List<int> { map.ILInstructionOffset.From, map.ILInstructionOffset.To }).ToArray();
frame.SourceCodeLine = CurrentLineBookmark.Instance.LineNumber;
frame.ILRanges = map.ToArray();
frame.AsyncStepInto();
}
}
@ -341,8 +341,8 @@ namespace ILSpy.Debugger.Services @@ -341,8 +341,8 @@ namespace ILSpy.Debugger.Services
Continue();
} else {
var frame = debuggedProcess.SelectedThread.MostRecentStackFrame;
frame.SourceCodeLine = map.SourceCodeLine;
frame.ILRanges = (new List<int> { map.ILInstructionOffset.From, map.ILInstructionOffset.To }).ToArray();
frame.SourceCodeLine = CurrentLineBookmark.Instance.LineNumber;
frame.ILRanges = map.ToArray();
frame.AsyncStepOver();
}
}
@ -367,8 +367,8 @@ namespace ILSpy.Debugger.Services @@ -367,8 +367,8 @@ namespace ILSpy.Debugger.Services
Continue();
} else {
var frame = debuggedProcess.SelectedThread.MostRecentStackFrame;
frame.SourceCodeLine = map.SourceCodeLine;
frame.ILRanges = (new List<int> { map.ILInstructionOffset.From, map.ILInstructionOffset.To }).ToArray();
frame.SourceCodeLine = CurrentLineBookmark.Instance.LineNumber;
frame.ILRanges = map.ToArray();
frame.AsyncStepOut();
}
}

14
ICSharpCode.Decompiler/CodeMappings.cs

@ -37,6 +37,20 @@ namespace ICSharpCode.Decompiler @@ -37,6 +37,20 @@ namespace ICSharpCode.Decompiler
public uint MetadataToken { get; set; }
public List<SourceCodeMapping> MethodCodeMappings { get; set; }
public int[] ToArray()
{
int[] result = new int[MethodCodeMappings.Count + 1];
int i = 0;
foreach (var element in MethodCodeMappings) {
result[i] = MethodCodeMappings[i].ILInstructionOffset.From;
++i;
}
result[MethodCodeMappings.Count] = MethodCodeMappings[MethodCodeMappings.Count - 1].ILInstructionOffset.To;
return result;
}
}
public static class CodeMappings

Loading…
Cancel
Save