public void WritePdb(SymbolData symData) { m_docWriters = new Dictionary<int, ISymbolDocumentWriter>(); ImageDebugDirectory debugDirectory; byte[] debugInfo = null; // Rather than use the emitter here, we are just careful enough to emit pdb metadata that // matches what is already in the assembly image. object emitter = null; // We must be careful to close the writer before updating the debug headers. The writer has an // open file handle on the assembly we want to update. m_writer = SymbolAccess.GetWriterForFile(m_symFormat, m_outputAssembly, ref emitter); // We don't actually need the emitter in managed code at all, so release the CLR reference on it Marshal.FinalReleaseComObject(emitter); try { WriteEntryPoint(symData.entryPointToken); WriteFiles(symData.sourceFiles); WriteMethods(symData.methods); debugInfo = m_writer.GetDebugInfo(out debugDirectory); } finally { m_writer.Close(); ((IDisposable)m_writer).Dispose(); m_writer = null; m_docWriters.Clear(); } UpdatePEDebugHeaders(debugInfo); }
public void WritePdb(SymbolData symData) { m_docWriters = new Dictionary <int, ISymbolDocumentWriter>(); ImageDebugDirectory debugDirectory; byte[] debugInfo = null; // Rather than use the emitter here, we are just careful enough to emit pdb metadata that // matches what is already in the assembly image. object emitter = null; // We must be careful to close the writer before updating the debug headers. The writer has an // open file handle on the assembly we want to update. m_writer = SymbolAccess.GetWriterForFile(m_symFormat, m_outputAssembly, ref emitter); // We don't actually need the emitter in managed code at all, so release the CLR reference on it Marshal.FinalReleaseComObject(emitter); try { WriteEntryPoint(symData.entryPointToken); WriteFiles(symData.sourceFiles); WriteMethods(symData.methods); debugInfo = m_writer.GetDebugInfo(out debugDirectory); } finally { m_writer.Close(); ((IDisposable)m_writer).Dispose(); m_writer = null; m_docWriters.Clear(); } UpdatePEDebugHeaders(debugInfo); }
internal void ReadXmlWritePdb() { WriteFiles(); WriteEntryPoint(); WriteMethods(); UpdatePEDebugHeaders(); m_writer.Close(); }
/// <summary> /// Closes the PDB writer /// </summary> public void Close() { writer.Close(); }