Skip to content

Commit 67bc204

Browse files
Merge pull request #3629 from sonyps5201314/fix_pdb_mismatch
Fix the issue where PDBs generated by ILSpy do not match certain asse…
2 parents 3325ae4 + 45081a6 commit 67bc204

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

ICSharpCode.Decompiler/DebugInfo/PortablePdbWriter.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,8 +235,9 @@ string BuildFileNameFromTypeName(TypeDefinitionHandle handle)
235235

236236
if (pdbId == null)
237237
{
238-
var debugDir = file.Reader.ReadDebugDirectory().FirstOrDefault(dir => dir.Type == DebugDirectoryEntryType.CodeView);
238+
var debugDir = file.Reader.ReadDebugDirectory().LastOrDefault(dir => dir.Type == DebugDirectoryEntryType.CodeView);
239239
var portable = file.Reader.ReadCodeViewDebugDirectoryData(debugDir);
240+
Debug.Assert(!portable.Path.EndsWith(".ni.pdb"));
240241
pdbId = new BlobContentId(portable.Guid, debugDir.Stamp);
241242
}
242243

0 commit comments

Comments
 (0)