From a0f61f99afb4c201c96e87a12604c560f98f6c32 Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Wed, 25 Sep 2024 08:20:52 -0700 Subject: [PATCH] Preserve custom debug information on types (#948) * Preserve custom debug info on types * Use ICustomDebugInformationProvider in ISymbolReader/ISymbolWriter * Move get logic to Mixin helpers * Add test dll/pdb * PR feedback - Use static lambdas - Check HasCustomDebugInformation - Test writing modified CustomDebugInformation - Formatting fixes * Update Test/Mono.Cecil.Tests/PortablePdbTests.cs Co-authored-by: Jackson Schuster <36744439+jtschuster@users.noreply.github.com> * Build for netstandard2.0 --------- Co-authored-by: Jackson Schuster <36744439+jtschuster@users.noreply.github.com> --- Directory.Build.props | 1 + Mono.Cecil.Cil/PortablePdb.cs | 21 ++++++++ Mono.Cecil.Cil/Symbols.cs | 37 +++++++++++++ Mono.Cecil/AssemblyReader.cs | 12 +++++ Mono.Cecil/AssemblyWriter.cs | 3 ++ Mono.Cecil/TypeDefinition.cs | 18 ++++++- Test/Mono.Cecil.Tests/BaseTestFixture.cs | 49 +++++++++++++++++ Test/Mono.Cecil.Tests/ILProcessorTests.cs | 50 ------------------ Test/Mono.Cecil.Tests/PortablePdbTests.cs | 42 +++++++++++++++ .../TypeDefinitionDebugInformation.dll | Bin 0 -> 4608 bytes .../TypeDefinitionDebugInformation.pdb | Bin 0 -> 7604 bytes symbols/mdb/Mono.Cecil.Mdb/MdbReader.cs | 5 ++ symbols/mdb/Mono.Cecil.Mdb/MdbWriter.cs | 4 ++ symbols/pdb/Mono.Cecil.Pdb/NativePdbReader.cs | 5 ++ symbols/pdb/Mono.Cecil.Pdb/NativePdbWriter.cs | 4 ++ 15 files changed, 200 insertions(+), 51 deletions(-) create mode 100644 Test/Resources/assemblies/TypeDefinitionDebugInformation.dll create mode 100644 Test/Resources/assemblies/TypeDefinitionDebugInformation.pdb diff --git a/Directory.Build.props b/Directory.Build.props index 5b9f0da9d..a37508076 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -9,6 +9,7 @@ $(MSBuildThisFileDirectory)\cecil.snk $(DefineConstants);NET_CORE + latest true diff --git a/Mono.Cecil.Cil/PortablePdb.cs b/Mono.Cecil.Cil/PortablePdb.cs index 6664bee32..4f58ebf52 100644 --- a/Mono.Cecil.Cil/PortablePdb.cs +++ b/Mono.Cecil.Cil/PortablePdb.cs @@ -13,6 +13,7 @@ using System.IO; using System.IO.Compression; using System.Security.Cryptography; +using Mono.Collections.Generic; using Mono.Cecil.Metadata; using Mono.Cecil.PE; @@ -145,6 +146,11 @@ void ReadStateMachineKickOffMethod (MethodDebugInformation method_info) method_info.kickoff_method = debug_reader.ReadStateMachineKickoffMethod (method_info.method); } + public Collection Read (ICustomDebugInformationProvider provider) + { + return debug_reader.GetCustomDebugInformation (provider); + } + void ReadCustomDebugInformations (MethodDebugInformation info) { info.method.custom_infos = debug_reader.GetCustomDebugInformation (info.method); @@ -221,6 +227,11 @@ public MethodDebugInformation Read (MethodDefinition method) return reader.Read (method); } + public Collection Read (ICustomDebugInformationProvider provider) + { + return reader.Read (provider); + } + public void Dispose () { reader.Dispose (); @@ -319,6 +330,11 @@ public void Write () } } + public void Write (ICustomDebugInformationProvider provider) + { + pdb_metadata.AddCustomDebugInformations (provider); + } + public ImageDebugHeader GetDebugHeader () { if (IsEmbedded) @@ -519,6 +535,11 @@ public void Write (MethodDebugInformation info) writer.Write (info); } + public void Write (ICustomDebugInformationProvider provider) + { + writer.Write (provider); + } + public ImageDebugHeader GetDebugHeader () { ImageDebugHeader pdbDebugHeader = writer.GetDebugHeader (); diff --git a/Mono.Cecil.Cil/Symbols.cs b/Mono.Cecil.Cil/Symbols.cs index 744e7a82b..294eb16db 100644 --- a/Mono.Cecil.Cil/Symbols.cs +++ b/Mono.Cecil.Cil/Symbols.cs @@ -854,6 +854,7 @@ public interface ISymbolReader : IDisposable { ISymbolWriterProvider GetWriterProvider (); bool ProcessDebugHeader (ImageDebugHeader header); MethodDebugInformation Read (MethodDefinition method); + Collection Read (ICustomDebugInformationProvider provider); } public interface ISymbolReaderProvider { @@ -1116,6 +1117,7 @@ public interface ISymbolWriter : IDisposable { ImageDebugHeader GetDebugHeader (); void Write (MethodDebugInformation info); void Write (); + void Write (ICustomDebugInformationProvider provider); } public interface ISymbolWriterProvider { @@ -1224,5 +1226,40 @@ public static bool IsPortablePdb (Stream stream) stream.Position = position; } } + + public static bool GetHasCustomDebugInformations ( + this ICustomDebugInformationProvider self, + ref Collection collection, + ModuleDefinition module) + { + if (module.HasImage ()) { + module.Read (ref collection, self, static (provider, reader) => { + var symbol_reader = reader.module.symbol_reader; + if (symbol_reader != null) + return symbol_reader.Read (provider); + return null; + }); + } + + return !collection.IsNullOrEmpty (); + } + + public static Collection GetCustomDebugInformations ( + this ICustomDebugInformationProvider self, + ref Collection collection, + ModuleDefinition module) + { + if (module.HasImage ()) { + module.Read (ref collection, self, static (provider, reader) => { + var symbol_reader = reader.module.symbol_reader; + if (symbol_reader != null) + return symbol_reader.Read (provider); + return null; + }); + } + + Interlocked.CompareExchange (ref collection, new Collection (), null); + return collection; + } } } diff --git a/Mono.Cecil/AssemblyReader.cs b/Mono.Cecil/AssemblyReader.cs index 4564071e8..a21d0a966 100644 --- a/Mono.Cecil/AssemblyReader.cs +++ b/Mono.Cecil/AssemblyReader.cs @@ -404,6 +404,7 @@ void ReadTypesSymbols (Collection types, ISymbolReader symbol_re { for (int i = 0; i < types.Count; i++) { var type = types [i]; + type.custom_infos = symbol_reader.Read (type); if (type.HasNestedTypes) ReadTypesSymbols (type.NestedTypes, symbol_reader); @@ -3160,6 +3161,17 @@ void InitializeCustomDebugInformations () } } + public bool HasCustomDebugInformation (ICustomDebugInformationProvider provider) + { + InitializeCustomDebugInformations (); + + Row [] rows; + if (!metadata.CustomDebugInformations.TryGetValue (provider.MetadataToken, out rows)) + return false; + + return rows.Length > 0; + } + public Collection GetCustomDebugInformation (ICustomDebugInformationProvider provider) { InitializeCustomDebugInformations (); diff --git a/Mono.Cecil/AssemblyWriter.cs b/Mono.Cecil/AssemblyWriter.cs index 836aa2172..ee234c81f 100644 --- a/Mono.Cecil/AssemblyWriter.cs +++ b/Mono.Cecil/AssemblyWriter.cs @@ -1487,6 +1487,9 @@ void AddType (TypeDefinition type) if (type.HasNestedTypes) AddNestedTypes (type); + if (symbol_writer != null && type.HasCustomDebugInformations) + symbol_writer.Write (type); + WindowsRuntimeProjections.ApplyProjection (type, treatment); } diff --git a/Mono.Cecil/TypeDefinition.cs b/Mono.Cecil/TypeDefinition.cs index 872e4c253..92d6ab299 100644 --- a/Mono.Cecil/TypeDefinition.cs +++ b/Mono.Cecil/TypeDefinition.cs @@ -10,12 +10,13 @@ using System; using System.Threading; +using Mono.Cecil.Cil; using Mono.Cecil.Metadata; using Mono.Collections.Generic; namespace Mono.Cecil { - public sealed class TypeDefinition : TypeReference, IMemberDefinition, ISecurityDeclarationProvider { + public sealed class TypeDefinition : TypeReference, IMemberDefinition, ISecurityDeclarationProvider, ICustomDebugInformationProvider { uint attributes; TypeReference base_type; @@ -34,6 +35,8 @@ public sealed class TypeDefinition : TypeReference, IMemberDefinition, ISecurity Collection custom_attributes; Collection security_declarations; + internal Collection custom_infos; + public TypeAttributes Attributes { get { return (TypeAttributes) attributes; } set { @@ -284,6 +287,19 @@ public override Collection GenericParameters { get { return generic_parameters ?? (this.GetGenericParameters (ref generic_parameters, Module)); } } + public bool HasCustomDebugInformations { + get { + if (custom_infos != null) + return custom_infos.Count > 0; + + return this.GetHasCustomDebugInformations (ref custom_infos, Module); + } + } + + public Collection CustomDebugInformations { + get { return custom_infos ?? (this.GetCustomDebugInformations (ref custom_infos, module)); } + } + #region TypeAttributes public bool IsNotPublic { diff --git a/Test/Mono.Cecil.Tests/BaseTestFixture.cs b/Test/Mono.Cecil.Tests/BaseTestFixture.cs index 046791bfa..12de4227a 100644 --- a/Test/Mono.Cecil.Tests/BaseTestFixture.cs +++ b/Test/Mono.Cecil.Tests/BaseTestFixture.cs @@ -2,6 +2,7 @@ using System.IO; using System.Runtime.CompilerServices; using Mono.Cecil.Cil; +using Mono.Cecil.Pdb; using NUnit.Framework; using Mono.Cecil.PE; @@ -154,6 +155,54 @@ static void Run (TestCase testCase) using (var runner = new TestRunner (testCase, TestCaseType.WriteFromImmediate)) runner.RunTest (); } + + public enum RoundtripType { + None, + Pdb, + PortablePdb + } + + protected static ModuleDefinition RoundtripModule(ModuleDefinition module, RoundtripType roundtripType) + { + if (roundtripType == RoundtripType.None) + return module; + + var file = Path.Combine (Path.GetTempPath (), "RoundtripModule.dll"); + if (File.Exists (file)) + File.Delete (file); + + ISymbolWriterProvider symbolWriterProvider; + switch (roundtripType) { + case RoundtripType.Pdb when Platform.HasNativePdbSupport: + symbolWriterProvider = new PdbWriterProvider (); + break; + case RoundtripType.PortablePdb: + default: + symbolWriterProvider = new PortablePdbWriterProvider (); + break; + } + + module.Write (file, new WriterParameters { + SymbolWriterProvider = symbolWriterProvider, + }); + module.Dispose (); + + ISymbolReaderProvider symbolReaderProvider; + switch (roundtripType) { + case RoundtripType.Pdb when Platform.HasNativePdbSupport: + symbolReaderProvider = new PdbReaderProvider (); + break; + case RoundtripType.PortablePdb: + default: + symbolReaderProvider = new PortablePdbReaderProvider (); + break; + } + + return ModuleDefinition.ReadModule (file, new ReaderParameters { + SymbolReaderProvider = symbolReaderProvider, + InMemory = true + }); + } } abstract class TestCase { diff --git a/Test/Mono.Cecil.Tests/ILProcessorTests.cs b/Test/Mono.Cecil.Tests/ILProcessorTests.cs index fd462c365..93ca078c8 100644 --- a/Test/Mono.Cecil.Tests/ILProcessorTests.cs +++ b/Test/Mono.Cecil.Tests/ILProcessorTests.cs @@ -3,10 +3,8 @@ using System.IO; using System.Linq; -using Mono.Cecil; using Mono.Cecil.Cil; using Mono.Cecil.Mdb; -using Mono.Cecil.Pdb; using NUnit.Framework; namespace Mono.Cecil.Tests { @@ -499,12 +497,6 @@ static MethodBody CreateTestMethodWithLocalScopes (RoundtripType roundtripType, return methodBody; } - public enum RoundtripType { - None, - Pdb, - PortablePdb - } - static MethodBody RoundtripMethodBody(MethodBody methodBody, RoundtripType roundtripType, bool forceUnresolvedScopes = false, bool reverseScopeOrder = false) { var newModule = RoundtripModule (methodBody.Method.Module, roundtripType); @@ -540,47 +532,5 @@ static void ReverseScopeOrder(ScopeDebugInformation scope) foreach (var subScope in scope.Scopes) ReverseScopeOrder (subScope); } - - static ModuleDefinition RoundtripModule(ModuleDefinition module, RoundtripType roundtripType) - { - if (roundtripType == RoundtripType.None) - return module; - - var file = Path.Combine (Path.GetTempPath (), "TestILProcessor.dll"); - if (File.Exists (file)) - File.Delete (file); - - ISymbolWriterProvider symbolWriterProvider; - switch (roundtripType) { - case RoundtripType.Pdb when Platform.HasNativePdbSupport: - symbolWriterProvider = new PdbWriterProvider (); - break; - case RoundtripType.PortablePdb: - default: - symbolWriterProvider = new PortablePdbWriterProvider (); - break; - } - - module.Write (file, new WriterParameters { - SymbolWriterProvider = symbolWriterProvider, - }); - module.Dispose (); - - ISymbolReaderProvider symbolReaderProvider; - switch (roundtripType) { - case RoundtripType.Pdb when Platform.HasNativePdbSupport: - symbolReaderProvider = new PdbReaderProvider (); - break; - case RoundtripType.PortablePdb: - default: - symbolReaderProvider = new PortablePdbReaderProvider (); - break; - } - - return ModuleDefinition.ReadModule (file, new ReaderParameters { - SymbolReaderProvider = symbolReaderProvider, - InMemory = true - }); - } } } diff --git a/Test/Mono.Cecil.Tests/PortablePdbTests.cs b/Test/Mono.Cecil.Tests/PortablePdbTests.cs index a89f79d83..c2b04524b 100644 --- a/Test/Mono.Cecil.Tests/PortablePdbTests.cs +++ b/Test/Mono.Cecil.Tests/PortablePdbTests.cs @@ -646,6 +646,43 @@ public void PortablePdbLineInfo() }, symbolReaderProvider: typeof (PortablePdbReaderProvider), symbolWriterProvider: typeof (PortablePdbWriterProvider)); } + [Test] + public void TypeDefinitionDebugInformation () + { + TestModule ("TypeDefinitionDebugInformation.dll", module => { + var enum_type = module.GetType ("TypeDefinitionDebugInformation.Enum"); + Assert.IsTrue (enum_type.HasCustomDebugInformations); + var binary_custom_debug_info = enum_type.CustomDebugInformations.OfType ().FirstOrDefault (); + Assert.IsNotNull (binary_custom_debug_info); + Assert.AreEqual (new Guid ("932E74BC-DBA9-4478-8D46-0F32A7BAB3D3"), binary_custom_debug_info.Identifier); + Assert.AreEqual (new byte [] { 0x1 }, binary_custom_debug_info.Data); + + var interface_type = module.GetType ("TypeDefinitionDebugInformation.Interface"); + Assert.IsTrue (interface_type.HasCustomDebugInformations); + binary_custom_debug_info = interface_type.CustomDebugInformations.OfType ().FirstOrDefault (); + Assert.IsNotNull (binary_custom_debug_info); + Assert.AreEqual (new Guid ("932E74BC-DBA9-4478-8D46-0F32A7BAB3D3"), binary_custom_debug_info.Identifier); + Assert.AreEqual (new byte [] { 0x1 }, binary_custom_debug_info.Data); + }, symbolReaderProvider: typeof (PortablePdbReaderProvider), symbolWriterProvider: typeof (PortablePdbWriterProvider)); + } + + [Test] + public void ModifyTypeDefinitionDebugInformation () + { + using (var module = GetResourceModule ("TypeDefinitionDebugInformation.dll", new ReaderParameters { SymbolReaderProvider = new PortablePdbReaderProvider () })) { + var enum_type = module.GetType ("TypeDefinitionDebugInformation.Enum"); + var binary_custom_debug_info = enum_type.CustomDebugInformations.OfType ().FirstOrDefault (); + Assert.AreEqual (new byte [] { 0x1 }, binary_custom_debug_info.Data); + binary_custom_debug_info.Data = new byte [] { 0x2 }; + + var outputModule = RoundtripModule (module, RoundtripType.None); + enum_type = outputModule.GetType ("TypeDefinitionDebugInformation.Enum"); + binary_custom_debug_info = enum_type.CustomDebugInformations.OfType ().FirstOrDefault (); + Assert.IsNotNull (binary_custom_debug_info); + Assert.AreEqual (new byte [] { 0x2 }, binary_custom_debug_info.Data); + } + } + public sealed class SymbolWriterProvider : ISymbolWriterProvider { readonly DefaultSymbolWriterProvider writer_provider = new DefaultSymbolWriterProvider (); @@ -730,6 +767,11 @@ public void Write () symbol_writer.Write (); } + public void Write (ICustomDebugInformationProvider provider) + { + symbol_writer.Write (provider); + } + public void Dispose () { symbol_writer.Dispose (); diff --git a/Test/Resources/assemblies/TypeDefinitionDebugInformation.dll b/Test/Resources/assemblies/TypeDefinitionDebugInformation.dll new file mode 100644 index 0000000000000000000000000000000000000000..6b41377d0a42ba73d66b64b18b966cd1d813986b GIT binary patch literal 4608 zcmeHKU2GiH75-*zZ=Hk~n?NuE!33uvBxbz92}+=)Uhg`IY3vy9CWKbPnccm+9+;h3 zW@eLYt5)WrmC8d!ACUqQ4?wF*RmG2lP|E|Vc%czOLIMdPAtVG3An02_72!K~X4Y#5 zf>d}aob{Z!=jWc^d*@!y{o)by0qEy*;R5gi-vUz_UmC4YJaog0LwIh(xos~PN6u|4 zFFT>x3j9W3H_fW;d46P8lo_-=)A7vW(URHpYs%WZdE@rP^ui2q#OT9`PmevEdV3c) znwyLqu#uc>%-y<^Zy!lRG3YbpE>H9qM7m(O87=UX6E^BTG^M8OFGdnj+ zGP~|f2ARI!&{qF0+L|uiHEkr8CC*cOt(-NPo7{6i9ML!NcE&ySTi_AC&&s$I1&-GU zMPqy*PJirJ2|11>y|F{bW{Z4Jksha`v1!+@h%$lGjeD*GHVE;#F^R2lUNVpB`jM71 zV7&)~FL}qgzihkvnpl(+cW||dM ztEpN(;=-)7BZY$BY&ot94k=FscGN5CDjf^$hU!u%s!F@juq$p4FCT`gS#djMC+cOF z?VzEegZ!YX(|+*4s*P0tAblTKLFoA2#ll&y?gvdfqR@7~R;%E9b*Is0@N0}Ls(Q(; ztEjWcB898Q2zstS`vGgPiLl57Cv$WK1TFdk4!Y=Jm`hRQn7U3E6ve&KR!SGr?J0$@XQ+vSBs5_ zr3pKT9DW|6aKf+LKXK`dCu*|$zd^}r)hZ|*&fmK4HY7fuNqtIQcOCxt>9eoBIQmfa z`G0(roZ%8{b|;Z3ql+Ou>to4M!4HbAJ7+r{nqk!sl+qhUq!)fn8|%}**x(PG|Fa4h zy6L09%G$)@djj|5MSRhdyW@!|-q(8W&u9Dgl6xE_ED_IOk)v7OwC73B5+96j-S}t! zCtt)Tw(KN<`2Dk((AQnrzr7&$J%d(l1hnJu-l%BPLmj?W+pcGoDYeNBDYp?(&nFeb z-~0bdqXuJ&sO6B~_zFvJX`LL>-(KERSOeV08-&68f{!Lz+DC^O*`$;1I}9;UtQZzGm{x1Z#oiZt7}IbeOo^{9tuV`@8k3n(9>$2_VC`7 z>poyEW7LdF4Q=!e|E*VyZb fvPvd*#@bG<&XInu12g`gadiJW{tx8$q5@w6kzb;$ literal 0 HcmV?d00001 diff --git a/Test/Resources/assemblies/TypeDefinitionDebugInformation.pdb b/Test/Resources/assemblies/TypeDefinitionDebugInformation.pdb new file mode 100644 index 0000000000000000000000000000000000000000..954231334a251c8a049ba022a54448cff17aac6d GIT binary patch literal 7604 zcmai330M=?7M{rBQWbaHMRB2u0RjjJR>?xx0vHewv^Yryh$NXfnV`6$h#-qX(IVoL zMFACA1Vsh3?pkocwQf~xt7zSx!q-~s^6n&aAtceq_l+}|IsZBTx#!+<&b_jOec23z zflz;a!4<@1Tg5vt?KLkDb7UoW@CKK4kVHhiI|D9~`n?)KTmj6KdJZNDsUk)N9uW`t zZeB1l2RsK+-}&==xZs`zeoq_?ezRpbrR@82^5Ly7-?6i;_qNsC2(m26^REQ2kuV_B z8{C07G5}m=^ko9>{lG=tsrS@(>Z1O7bUyCVzCaQ++$dQ}hT_>DJPiht+rYgD+~0!x z2XOaiFpy9N(4hA>1)vfbQ-J+ilO$kuDPx!BUtKYamTyy!3>?f(NnhGOId}iCccQto z&-J`MFe?~25xA>IQ6tIB*?VspH`B|4RaRen-R#AuLoFFezCYge60L9WyWNW~Sgq*2 zz`yct^MLxrWIu!v)hCF+V+d5v6st__5Qd4>iQ=rVw$)o|B9<2aoi#ks*F5+0q9Ywe zs#*UTKB;|KuN%Elf|N$1Vp3&-ix!U!Nl;>3ELy6Nl2Tm3#YE~DA4N1y$WiLInS^>_ z|8*fIA4CY1%~MffWySy|y#N!Z@7QRJRmHs_voknHqedN`*|&aW0&8u~0^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B2*KZlQ&{5~)TIl<&NxZ+`4M zB9edD-T#&3H3?@JC8)DCdPB!dwM{y3dyNZcTl_}kW5qStgj3SmCa7Ci0$n73-XFOu zdtktJ6Ne?M9^Ra!L#BJp(&iLsZ2y4%?*fN?6l_Lslvy9>IH>~*=i*{eUOSJd|D^d9 zy!VZqcK4(AZqw{wy#N3J literal 0 HcmV?d00001 diff --git a/symbols/mdb/Mono.Cecil.Mdb/MdbReader.cs b/symbols/mdb/Mono.Cecil.Mdb/MdbReader.cs index 3e2dd18e4..f19212f60 100644 --- a/symbols/mdb/Mono.Cecil.Mdb/MdbReader.cs +++ b/symbols/mdb/Mono.Cecil.Mdb/MdbReader.cs @@ -186,6 +186,11 @@ SequencePoint LineToSequencePoint (LineNumberEntry line) }; } + public Collection Read (ICustomDebugInformationProvider provider) + { + return new Collection (); + } + public void Dispose () { symbol_file.Dispose (); diff --git a/symbols/mdb/Mono.Cecil.Mdb/MdbWriter.cs b/symbols/mdb/Mono.Cecil.Mdb/MdbWriter.cs index 4d4ce933b..81a0d539d 100644 --- a/symbols/mdb/Mono.Cecil.Mdb/MdbWriter.cs +++ b/symbols/mdb/Mono.Cecil.Mdb/MdbWriter.cs @@ -173,6 +173,10 @@ public void Write () // after the entire image of the assembly is written (since it's computed from the hash of that) } + public void Write (ICustomDebugInformationProvider provider) + { + } + public void Dispose () { writer.WriteSymbolFile (module.Mvid); diff --git a/symbols/pdb/Mono.Cecil.Pdb/NativePdbReader.cs b/symbols/pdb/Mono.Cecil.Pdb/NativePdbReader.cs index 484704447..400fb0b48 100644 --- a/symbols/pdb/Mono.Cecil.Pdb/NativePdbReader.cs +++ b/symbols/pdb/Mono.Cecil.Pdb/NativePdbReader.cs @@ -355,6 +355,11 @@ Document GetDocument (PdbSource source) return document; } + public Collection Read (ICustomDebugInformationProvider provider) + { + return new Collection (); + } + public void Dispose () { pdb_file.Dispose (); diff --git a/symbols/pdb/Mono.Cecil.Pdb/NativePdbWriter.cs b/symbols/pdb/Mono.Cecil.Pdb/NativePdbWriter.cs index 9597d7fa4..55515d5e5 100644 --- a/symbols/pdb/Mono.Cecil.Pdb/NativePdbWriter.cs +++ b/symbols/pdb/Mono.Cecil.Pdb/NativePdbWriter.cs @@ -265,6 +265,10 @@ public void Write () writer.Close (); } + public void Write (ICustomDebugInformationProvider provider) + { + } + public void Dispose () { writer.Close ();