Skip to content

Commit

Permalink
bring PDB writer from ILSpy decompiler here
Browse files Browse the repository at this point in the history
  • Loading branch information
tuxology committed Mar 17, 2024
1 parent dcbaedd commit dab54fd
Show file tree
Hide file tree
Showing 2 changed files with 641 additions and 2 deletions.
4 changes: 2 additions & 2 deletions DotNetAstGen/PDBGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,15 @@ public void GeneratePDBforDLLFile(string dllFileName, string pdbFileName)
PEStreamOptions.PrefetchEntireImage,
metadataOptions: MetadataReaderOptions.None);

if (!PortablePdbWriter.HasCodeViewDebugDirectoryEntry(module))
if (!PDBWriter.HasCodeViewDebugDirectoryEntry(module))
{
_logger?.LogWarning($"Cannot create PDB file for {dllFileName}, because it does not contain a PE Debug Directory Entry of type 'CodeView'. Skipping...");
}

using (FileStream stream = new FileStream(pdbFileName, FileMode.OpenOrCreate, FileAccess.Write))
{
var decompiler = GetDecompiler(dllFileName);
PortablePdbWriter.WritePdb(module, decompiler, GetSettings(module), stream);
PDBWriter.WritePdb(module, decompiler, GetSettings(module), stream);
}
}
}
Expand Down
Loading

0 comments on commit dab54fd

Please sign in to comment.