diff --git a/src/AddIns/DisplayBindings/ILSpyAddIn/DebuggerTextOutput.cs b/src/AddIns/DisplayBindings/ILSpyAddIn/DebuggerTextOutput.cs index d27b67279c..e0cd4c38b3 100644 --- a/src/AddIns/DisplayBindings/ILSpyAddIn/DebuggerTextOutput.cs +++ b/src/AddIns/DisplayBindings/ILSpyAddIn/DebuggerTextOutput.cs @@ -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 if (node is EntityDeclaration && node.Annotation() != null) { MemberLocations[XmlDocKeyProvider.GetKey(node.Annotation())] = node.StartLocation; } + + // code mappings + var ranges = node.Annotation>(); + 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() != 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; } }