Browse Source

fix debugger symbols for decompiled code

newNRILSpyDebugger
Siegfried Pammer 12 years ago
parent
commit
2bbde47f50
  1. 14
      src/AddIns/DisplayBindings/ILSpyAddIn/DebuggerTextOutput.cs

14
src/AddIns/DisplayBindings/ILSpyAddIn/DebuggerTextOutput.cs

@ -6,6 +6,7 @@ using System.Collections.Generic; @@ -6,6 +6,7 @@ using System.Collections.Generic;
using System.Linq;
using ICSharpCode.Core;
using ICSharpCode.Decompiler;
using ICSharpCode.Decompiler.ILAst;
using ICSharpCode.NRefactory.CSharp;
using Mono.Cecil;
@ -41,10 +42,23 @@ namespace ICSharpCode.ILSpyAddIn @@ -41,10 +42,23 @@ namespace ICSharpCode.ILSpyAddIn
if (node is EntityDeclaration && node.Annotation<MemberReference>() != null) {
MemberLocations[XmlDocKeyProvider.GetKey(node.Annotation<MemberReference>())] = node.StartLocation;
}
// code mappings
var ranges = node.Annotation<List<ILRange>>();
if (symbolsStack.Count > 0 && ranges != null && ranges.Count > 0) {
symbolsStack.Peek().SequencePoints.Add(
new SequencePoint() {
ILRanges = ILRange.OrderAndJoin(ranges).ToArray(),
StartLocation = node.StartLocation,
EndLocation = node.EndLocation
});
}
if (node.Annotation<MethodDebugSymbols>() != null) {
var symbols = symbolsStack.Pop();
symbols.SequencePoints = symbols.SequencePoints.OrderBy(s => s.ILOffset).ToList();
symbols.StartLocation = node.StartLocation;
symbols.EndLocation = node.EndLocation;
DebugSymbols[XmlDocKeyProvider.GetKey(symbols.CecilMethod)] = symbols;
}
}

Loading…
Cancel
Save