Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

Commit

Permalink
Fix writing symbols when using deterministic mvids. The ppdb file emb…
Browse files Browse the repository at this point in the history
…eds the guid of the corresponding assembly.

Fixes jbevain#583.
  • Loading branch information
vargaz committed May 30, 2019
1 parent a6c8f5e commit 4b34dad
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Mono.Cecil.Cil/PortablePdb.cs
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,11 @@ internal PortablePdbWriter (MetadataBuilder pdb_metadata, ModuleDefinition modul
this.writer = writer;
}

public void PatchMvid (Guid guid)
{
writer.PatchMvid (guid);
}

public ISymbolReaderProvider GetReaderProvider ()
{
return new PortablePdbReaderProvider ();
Expand Down
2 changes: 2 additions & 0 deletions Mono.Cecil/AssemblyWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@ static void Write (ModuleDefinition module, Disposable<Stream> stream, WriterPar
if (parameters.DeterministicMvid) {
module.Mvid = ComputeGuid (stream.value);
writer.PatchMvid (module.Mvid);
if (symbol_writer is PortablePdbWriter ppdb_writer)
ppdb_writer.PatchMvid (module.Mvid);
}
}
} finally {
Expand Down

0 comments on commit 4b34dad

Please sign in to comment.