Browse Source

fix stepping

pull/191/merge
Eusebiu Marcu 15 years ago
parent
commit
42f0c2e130
  1. 2
      Debugger/Debugger.Core/Options.cs
  2. 16
      Debugger/ILSpy.Debugger/Services/Debugger/WindowsDebugger.cs
  3. 9
      ICSharpCode.Decompiler/Ast/TextOutputFormatter.cs

2
Debugger/Debugger.Core/Options.cs

@ -5,7 +5,7 @@ namespace Debugger @@ -5,7 +5,7 @@ namespace Debugger
{
public class Options
{
public bool EnableJustMyCode = true;
public bool EnableJustMyCode = false;
public bool StepOverNoSymbols = false;
public bool StepOverDebuggerAttributes = true;
public bool StepOverAllProperties = false;

16
Debugger/ILSpy.Debugger/Services/Debugger/WindowsDebugger.cs

@ -287,27 +287,27 @@ namespace ILSpy.Debugger.Services @@ -287,27 +287,27 @@ namespace ILSpy.Debugger.Services
// Stepping:
SourceCodeMapping GetNextCodeMapping()
SourceCodeMapping GetCurrentCodeMapping()
{
if (CurrentLineBookmark.Instance == null)
return null;
// get the mapped instruction from the current line marker or the next one
uint token;
var instruction = CodeMappingsStorage.GetInstructionByTypeAndLine(
return CodeMappingsStorage.GetInstructionByTypeAndLine(
CurrentLineBookmark.Instance.Type.FullName,
CurrentLineBookmark.Instance.LineNumber, out token);
var val = CodeMappingsStorage[CurrentLineBookmark.Instance.Type.FullName];
var mapping = val.Find(m => m.MetadataToken == token);
return mapping.MemberCodeMappings.FirstOrDefault(s => s.ILInstructionOffset.From == instruction.ILInstructionOffset.From);
// var val = CodeMappingsStorage[CurrentLineBookmark.Instance.Type.FullName];
//
// var mapping = val.Find(m => m.MetadataToken == token);
//
// return mapping.MemberCodeMappings.FirstOrDefault(s => s.ILInstructionOffset.From == instruction.ILInstructionOffset.From);
}
StackFrame GetStackFrame()
{
var map = GetNextCodeMapping();
var map = GetCurrentCodeMapping();
if (map == null) {
CurrentLineBookmark.Remove();
Continue();

9
ICSharpCode.Decompiler/Ast/TextOutputFormatter.cs

@ -132,11 +132,20 @@ namespace ICSharpCode.Decompiler.Ast @@ -132,11 +132,20 @@ namespace ICSharpCode.Decompiler.Ast
var n = node.Ancestors.FirstOrDefault(a => a.Annotation<MemberMapping>() != null);
if (n != default(AstType)) {
MemberMapping mapping = n.Annotation<MemberMapping>();
var map = mapping.MemberCodeMappings.Find(s => s.SourceCodeLine == output.CurrentLine);
foreach (var range in ranges) {
if (map == null) {
mapping.MemberCodeMappings.Add(new SourceCodeMapping {
ILInstructionOffset = range,
SourceCodeLine = output.CurrentLine
});
} else {
if (map.ILInstructionOffset.From > range.From)
map.ILInstructionOffset.From = range.From;
if (map.ILInstructionOffset.To < range.To)
map.ILInstructionOffset.To = range.To;
}
}
}
}

Loading…
Cancel
Save