Cecil fails to load portable pdb files for crossgen'd assemblies #704
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
See https://github.com/mono/linker/issues/1620#issuecomment-726012522 for more context.
Using the following code:
When the
AssemblyDefinition assemblypoints to a crossgen'd assembly, fails to load the symbols in a portable pdb file.The reason it fails is because a cross gen'd assembly's Debug Directories has two entries:
And the 2nd entry is the portable pdb entry.
However,
ModuleDefinition.ReadSymbolsappears to only look at the first entry in theDebug Directoriesand it throws an exception when the first entry doesn't match the portable pdb's Guid. See the following code:github.com/jbevain/cecil@0a2f294463/Mono.Cecil/ModuleDefinition.cs (L1060-L1064)and
github.com/jbevain/cecil@ab5075b3a8/Mono.Cecil.Cil/PortablePdb.cs (L68-L100)Cecil should continue iterating the list and discover the 2nd entry and match it.
Good catch. Any chance you could attach a dll here that reproduces the issue?
No problem. You can use any dll that is in the .NET Core's runtimepack for win-x64. I found it using System.Private.Xml, so I've attached that assembly and its corresponding portable pdb in the following .zip:
System.Private.Xml.zip