From e11e9c26065f383bc46568bd271d6091be858a08 Mon Sep 17 00:00:00 2001 From: Eusebiu Marcu Date: Fri, 25 Feb 2011 10:10:46 +0200 Subject: [PATCH] add ToArray() method to single instruction. --- .../ILSpy.Debugger/Services/Debugger/WindowsDebugger.cs | 6 +++--- ICSharpCode.Decompiler/CodeMappings.cs | 9 +++++++++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/Debugger/ILSpy.Debugger/Services/Debugger/WindowsDebugger.cs b/Debugger/ILSpy.Debugger/Services/Debugger/WindowsDebugger.cs index afaf323c6..b81b21abe 100644 --- a/Debugger/ILSpy.Debugger/Services/Debugger/WindowsDebugger.cs +++ b/Debugger/ILSpy.Debugger/Services/Debugger/WindowsDebugger.cs @@ -282,7 +282,7 @@ namespace ILSpy.Debugger.Services // Stepping: - MethodMapping GetNextCodeMapping() + SourceCodeMapping GetNextCodeMapping() { uint token; var instruction = CodeMappingsStorage.GetInstructionByTypeAndLine( @@ -291,9 +291,9 @@ namespace ILSpy.Debugger.Services var val = CodeMappingsStorage[CurrentLineBookmark.Instance.TypeName]; - return val.Find(m => m.MetadataToken == token); + var mapping = 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() diff --git a/ICSharpCode.Decompiler/CodeMappings.cs b/ICSharpCode.Decompiler/CodeMappings.cs index 8c41b5951..4fbb05da9 100644 --- a/ICSharpCode.Decompiler/CodeMappings.cs +++ b/ICSharpCode.Decompiler/CodeMappings.cs @@ -25,6 +25,15 @@ namespace ICSharpCode.Decompiler public int SourceCodeLine { get; set; } public ILRange ILInstructionOffset { get; set; } + + public int[] ToArray() + { + int[] result = new int[2]; + result[0] = ILInstructionOffset.From; + result[1] = ILInstructionOffset.To; + + return result; + } } ///