private void Close() { try { _symWriter?.Close(); _metadataImport?.Dispose(); _metadataImport = null; _symWriter = null; _pdbStream = null; } catch (Exception ex) { throw new PdbWritingException(ex); } }
public void WriteTo(Stream stream) { Debug.Assert(_pdbStream != null); Debug.Assert(_symWriter != null); try { // SymWriter flushes data to the native stream on close: _symWriter.Close(); _symWriter = null; _pdbStream.CopyTo(stream); } catch (Exception ex) { throw new PdbWritingException(ex); } }
public PdbWriter(MetadataReader metadataReader) { _pdbStream = new ComMemoryStream(); _metadataImport = new SymReaderMetadataImport(metadataReader, metadataOwnerOpt: null); _symWriter = SymReaderFactory.CreateWindowsPdbWriter(_pdbStream, _metadataImport); }