From 79d3ff10a32581bb30a1325bfbff70be0002b247 Mon Sep 17 00:00:00 2001 From: Siegfried Pammer Date: Sat, 14 Oct 2017 20:00:21 +0200 Subject: [PATCH] Add setting ShowDebugInfo --- ICSharpCode.Decompiler/DecompilerSettings.cs | 17 +++++++++++++++-- ILSpy/Languages/CSharpILMixedLanguage.cs | 2 +- ILSpy/Languages/ILLanguage.cs | 2 +- ILSpy/Options/DecompilerSettingsPanel.xaml | 1 + ILSpy/Options/DecompilerSettingsPanel.xaml.cs | 2 ++ 5 files changed, 20 insertions(+), 4 deletions(-) diff --git a/ICSharpCode.Decompiler/DecompilerSettings.cs b/ICSharpCode.Decompiler/DecompilerSettings.cs index 50f744e6d..6d6e16d21 100644 --- a/ICSharpCode.Decompiler/DecompilerSettings.cs +++ b/ICSharpCode.Decompiler/DecompilerSettings.cs @@ -360,8 +360,21 @@ namespace ICSharpCode.Decompiler } } } + + bool showDebugInfo; + + public bool ShowDebugInfo { + get { return showDebugInfo; } + set { + if (showDebugInfo != value) { + showDebugInfo = value; + OnPropertyChanged(); + } + } + } + #endregion - + CSharpFormattingOptions csharpFormattingOptions; public CSharpFormattingOptions CSharpFormattingOptions { @@ -382,7 +395,7 @@ namespace ICSharpCode.Decompiler } } } - + public event PropertyChangedEventHandler PropertyChanged; protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null) diff --git a/ILSpy/Languages/CSharpILMixedLanguage.cs b/ILSpy/Languages/CSharpILMixedLanguage.cs index 1e027fae8..39d659093 100644 --- a/ILSpy/Languages/CSharpILMixedLanguage.cs +++ b/ILSpy/Languages/CSharpILMixedLanguage.cs @@ -30,7 +30,7 @@ namespace ICSharpCode.ILSpy return new ReflectionDisassembler(output, new MixedMethodBodyDisassembler(output, options) { DetectControlStructure = detectControlStructure, - ShowSequencePoints = true + ShowSequencePoints = options.DecompilerSettings.ShowDebugInfo }, options.CancellationToken); } diff --git a/ILSpy/Languages/ILLanguage.cs b/ILSpy/Languages/ILLanguage.cs index 24aeedfba..9e618150a 100644 --- a/ILSpy/Languages/ILLanguage.cs +++ b/ILSpy/Languages/ILLanguage.cs @@ -48,7 +48,7 @@ namespace ICSharpCode.ILSpy { return new ReflectionDisassembler(output, options.CancellationToken) { DetectControlStructure = detectControlStructure, - ShowSequencePoints = true + ShowSequencePoints = options.DecompilerSettings.ShowDebugInfo }; } diff --git a/ILSpy/Options/DecompilerSettingsPanel.xaml b/ILSpy/Options/DecompilerSettingsPanel.xaml index ecad2b28b..e43c553d3 100644 --- a/ILSpy/Options/DecompilerSettingsPanel.xaml +++ b/ILSpy/Options/DecompilerSettingsPanel.xaml @@ -11,6 +11,7 @@ Decompile expression trees Decompile automatic properties Use variable names from debug symbols, if available + Show info from debug symbols, if available Show XML documentation in decompiled code Enable folding on all blocks in braces diff --git a/ILSpy/Options/DecompilerSettingsPanel.xaml.cs b/ILSpy/Options/DecompilerSettingsPanel.xaml.cs index b013aa708..8541be53d 100644 --- a/ILSpy/Options/DecompilerSettingsPanel.xaml.cs +++ b/ILSpy/Options/DecompilerSettingsPanel.xaml.cs @@ -58,6 +58,7 @@ namespace ICSharpCode.ILSpy.Options s.QueryExpressions = (bool?)e.Attribute("queryExpressions") ?? s.QueryExpressions; s.ExpressionTrees = (bool?)e.Attribute("expressionTrees") ?? s.ExpressionTrees; s.UseDebugSymbols = (bool?)e.Attribute("useDebugSymbols") ?? s.UseDebugSymbols; + s.ShowDebugInfo = (bool?)e.Attribute("showDebugInfo") ?? s.ShowDebugInfo; s.ShowXmlDocumentation = (bool?)e.Attribute("xmlDoc") ?? s.ShowXmlDocumentation; s.FoldBraces = (bool?)e.Attribute("foldBraces") ?? s.FoldBraces; return s; @@ -75,6 +76,7 @@ namespace ICSharpCode.ILSpy.Options section.SetAttributeValue("queryExpressions", s.QueryExpressions); section.SetAttributeValue("expressionTrees", s.ExpressionTrees); section.SetAttributeValue("useDebugSymbols", s.UseDebugSymbols); + section.SetAttributeValue("showDebugInfo", s.ShowDebugInfo); section.SetAttributeValue("xmlDoc", s.ShowXmlDocumentation); section.SetAttributeValue("foldBraces", s.FoldBraces);