Exemplo n.º 1
0
 public PdbWriter(string fileName, Stream stream, Func<object> symWriterFactory = null)
 {
     this.stream = new ComStreamWrapper(stream);
     this.fileName = fileName;
     this.symWriterFactory = symWriterFactory;
     CreateSequencePointBuffers(capacity: 64);
 }
Exemplo n.º 2
0
        public void GetReaderFromStream()
        {
            var importer = new SymMetadataImport(new MemoryStream(TestResources.Documents.Dll));
            var stream = new MemoryStream(TestResources.Documents.Pdb);
            var wrapper = new ComStreamWrapper(stream);

            ISymUnmanagedReader symReader;
            Assert.Equal(HResult.S_OK, SymBinder.GetReaderFromStream(importer, wrapper, out symReader));

            int actualCount;
            Assert.Equal(HResult.S_OK, symReader.GetDocuments(0, out actualCount, null));
            Assert.Equal(11, actualCount);

            Assert.Equal(HResult.S_FALSE, ((ISymUnmanagedDispose)symReader).Destroy());
            Assert.Equal(HResult.S_OK, ((ISymUnmanagedDispose)symReader).Destroy());

            Assert.Throws<ObjectDisposedException>(() => symReader.GetDocuments(0, out actualCount, null));
        }
Exemplo n.º 3
0
 public PdbWriter(string fileName, ComStreamWrapper stream)
 {
     this.stream = stream;
     this.fileName = fileName;
     CreateSequencePointBuffers(capacity: 64);
 }
Exemplo n.º 4
0
        public void GetReaderFromPdbStream()
        {
            var stream = new MemoryStream(TestResources.Documents.PortablePdb);
            var wrapper = new ComStreamWrapper(stream);

            ISymUnmanagedReader symReader;
            Assert.Equal(HResult.S_OK, SymBinder.GetReaderFromPdbStream(NotImplementedMetadataProvider.Instance, wrapper, out symReader));

            int actualCount;
            Assert.Equal(HResult.S_OK, symReader.GetDocuments(0, out actualCount, null));
            Assert.Equal(13, actualCount);

            Assert.Equal(HResult.S_FALSE, ((ISymUnmanagedDispose)symReader).Destroy());
            Assert.Equal(HResult.S_OK, ((ISymUnmanagedDispose)symReader).Destroy());

            Assert.Throws<ObjectDisposedException>(() => symReader.GetDocuments(0, out actualCount, null));
        }