Example #1
0
 private void Close()
 {
     try
     {
         _symWriter?.Close();
         _metadataImport?.Dispose();
         _metadataImport = null;
         _symWriter      = null;
         _pdbStream      = null;
     }
     catch (Exception ex)
     {
         throw new PdbWritingException(ex);
     }
 }
Example #2
0
        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);
            }
        }
Example #3
0
 public PdbWriter(MetadataReader metadataReader)
 {
     _pdbStream      = new ComMemoryStream();
     _metadataImport = new SymReaderMetadataImport(metadataReader, metadataOwnerOpt: null);
     _symWriter      = SymReaderFactory.CreateWindowsPdbWriter(_pdbStream, _metadataImport);
 }