Skip to content

Commit 7b8ee04

Browse files
authored
Issues #710: Ability to load debug symbols from MemoryStream (#735)
1 parent f3ec06a commit 7b8ee04

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Mono.Cecil.Cil/PortablePdb.cs

+5-1
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,11 @@ public ImageDebugHeader GetDebugHeader ()
301301
// PDB Age
302302
buffer.WriteUInt32 (1);
303303
// PDB Path
304-
buffer.WriteBytes (System.Text.Encoding.UTF8.GetBytes (writer.BaseStream.GetFileName ()));
304+
var fileName = writer.BaseStream.GetFileName ();
305+
if (string.IsNullOrEmpty (fileName)) {
306+
fileName = module.Assembly.Name.Name + ".pdb";
307+
}
308+
buffer.WriteBytes (System.Text.Encoding.UTF8.GetBytes (fileName));
305309
buffer.WriteByte (0);
306310

307311
var data = new byte [buffer.length];

0 commit comments

Comments
 (0)