Skip to content
This repository was archived by the owner on Mar 19, 2021. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 26 additions & 8 deletions ILMerge/ILMerge.cs
Original file line number Diff line number Diff line change
Expand Up @@ -789,16 +789,27 @@ private bool AttributeExistsInTarget(AttributeNode possiblyDuplicateAttr, Attrib

return addAttribute;
}

private static bool IsPortablePdb(string pdb) {
using (var stream = File.OpenRead(pdb)) {
const uint ppdb_signature = 0x424a5342;
var position = stream.Position;
try {
var reader = new BinaryReader(stream);
return reader.ReadUInt32() == ppdb_signature;
} finally {
stream.Position = position;
}
}
}
#endregion
#region Protected Methods
/// <summary>
/// Provides a way for subtypes to create their own Duplicator to use for
/// the merging. When not overridden, the duplicator is the standard one.
/// </summary>
/// <param name="module">Top level module for this duplicator to copy types into.</param>
/// <returns>The duplicator to use for visiting the source modules.</returns>
protected virtual Duplicator CreateDuplicator(Module module) {
/// <summary>
/// Provides a way for subtypes to create their own Duplicator to use for
/// the merging. When not overridden, the duplicator is the standard one.
/// </summary>
/// <param name="module">Top level module for this duplicator to copy types into.</param>
/// <returns>The duplicator to use for visiting the source modules.</returns>
protected virtual Duplicator CreateDuplicator(Module module) {
return new Duplicator(module, null);
}
/// <summary>
Expand Down Expand Up @@ -1880,6 +1891,13 @@ public void Merge() {
WriteToLog("Can not find PDB file. Debug info will not be available for assembly '{0}'.",
(string)assemblyNames[i]);
tempDebugInfo = false;
} else
{
if (IsPortablePdb(pdbFullName))
{
WriteToLog("Can not use portable PDB file. Debug info will not be available for assembly '{0}'.", (string)assemblyNames[i]);
tempDebugInfo = false;
}
}
}
AssemblyNode a;
Expand Down