Skip to content

Commit

Permalink
Issues #710: Ability to load debug symbols from MemoryStream (#735)
Browse files Browse the repository at this point in the history
  • Loading branch information
Serg046 authored Mar 17, 2021
1 parent f3ec06a commit 7b8ee04
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Mono.Cecil.Cil/PortablePdb.cs
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,11 @@ public ImageDebugHeader GetDebugHeader ()
// PDB Age
buffer.WriteUInt32 (1);
// PDB Path
buffer.WriteBytes (System.Text.Encoding.UTF8.GetBytes (writer.BaseStream.GetFileName ()));
var fileName = writer.BaseStream.GetFileName ();
if (string.IsNullOrEmpty (fileName)) {
fileName = module.Assembly.Name.Name + ".pdb";
}
buffer.WriteBytes (System.Text.Encoding.UTF8.GetBytes (fileName));
buffer.WriteByte (0);

var data = new byte [buffer.length];
Expand Down

0 comments on commit 7b8ee04

Please sign in to comment.