Browse Source

#1674: Add DebugInfoProvider to WholeProjectDecompiler API.

pull/1686/head
Siegfried Pammer 6 years ago
parent
commit
be887d0ea6
  1. 4
      ICSharpCode.Decompiler/CSharp/WholeProjectDecompiler.cs
  2. 1
      ILSpy/Languages/CSharpLanguage.cs

4
ICSharpCode.Decompiler/CSharp/WholeProjectDecompiler.cs

@ -36,6 +36,7 @@ using static ICSharpCode.Decompiler.Metadata.DotNetCorePathFinderExtensions; @@ -36,6 +36,7 @@ using static ICSharpCode.Decompiler.Metadata.DotNetCorePathFinderExtensions;
using static ICSharpCode.Decompiler.Metadata.MetadataExtensions;
using ICSharpCode.Decompiler.Metadata;
using ICSharpCode.Decompiler.Solution;
using ICSharpCode.Decompiler.DebugInfo;
namespace ICSharpCode.Decompiler.CSharp
{
@ -73,6 +74,8 @@ namespace ICSharpCode.Decompiler.CSharp @@ -73,6 +74,8 @@ namespace ICSharpCode.Decompiler.CSharp
public IAssemblyResolver AssemblyResolver { get; set; }
public IDebugInfoProvider DebugInfoProvider { get; set; }
/// <summary>
/// The MSBuild ProjectGuid to use for the new project.
/// <c>null</c> to automatically generate a new GUID.
@ -322,6 +325,7 @@ namespace ICSharpCode.Decompiler.CSharp @@ -322,6 +325,7 @@ namespace ICSharpCode.Decompiler.CSharp
CSharpDecompiler CreateDecompiler(DecompilerTypeSystem ts)
{
var decompiler = new CSharpDecompiler(ts, settings);
decompiler.DebugInfoProvider = DebugInfoProvider;
decompiler.AstTransforms.Add(new EscapeInvalidIdentifiers());
decompiler.AstTransforms.Add(new RemoveCLSCompliantAttribute());
return decompiler;

1
ILSpy/Languages/CSharpLanguage.cs

@ -432,6 +432,7 @@ namespace ICSharpCode.ILSpy @@ -432,6 +432,7 @@ namespace ICSharpCode.ILSpy
this.options = options;
base.Settings = options.DecompilerSettings;
base.AssemblyResolver = assembly.GetAssemblyResolver();
base.DebugInfoProvider = assembly.GetDebugInfoOrNull();
}
protected override IEnumerable<Tuple<string, string>> WriteResourceToFile(string fileName, string resourceName, Stream entryStream)

Loading…
Cancel
Save