示例#1
0
文件: PdbRoot.cs 项目: mwatts/GitLink
        public PdbRoot(PdbStream stream)
        {
            Argument.IsNotNull(() => stream);

            Stream = stream;
            Streams = new List<PdbStream>();
        }
示例#2
0
文件: PdbFile.cs 项目: mwatts/GitLink
        public byte[] ReadPdbStreamBytes(PdbStream pdbStream)
        {
            Argument.IsNotNull(() => pdbStream);

            return ReadStreamBytes(pdbStream);
        }
示例#3
0
文件: PdbFile.cs 项目: mwatts/GitLink
 private BinaryReader StreamReader(PdbStream stream)
 {
     return new BinaryReader(ReadStream(stream));
 }
示例#4
0
文件: PdbFile.cs 项目: mwatts/GitLink
 private MemoryStream ReadStream(PdbStream stream)
 {
     return new MemoryStream(ReadStreamBytes(stream));
 }
示例#5
0
文件: PdbFile.cs 项目: mwatts/GitLink
        private byte[] ReadStreamBytes(PdbStream stream)
        {
            Argument.IsNotNull(() => stream);

            var bytes = new byte[stream.ByteCount];
            var pages = stream.Pages;

            if (pages.Length != 0)
            {
                for (var i = 0; i < pages.Length - 1; i++)
                {
                    ReadPage(bytes, pages[i], i * _pageByteCount, _pageByteCount);
                }

                var j = pages.Length - 1;
                ReadPage(bytes, pages[j], j * _pageByteCount, (stream.ByteCount - j * _pageByteCount));
            }

            return bytes;
        }
示例#6
0
文件: PdbFile.cs 项目: mwatts/GitLink
        public PdbStream GetRootPdbStream()
        {
            var pdbStream = new PdbStream();
            pdbStream.ByteCount = _rootByteCount;
            pdbStream.Pages = new int[CountPages(_rootByteCount)];

            GoToPage(RootPage);

            for (var i = 0; i < pdbStream.Pages.Length; i++)
            {
                pdbStream.Pages[i] = _br.ReadInt32();
            }

            return pdbStream;
        }
示例#7
0
文件: PdbFile.cs 项目: mwatts/GitLink
        private PdbRoot ReadRoot(PdbStream streamRoot)
        {
            Argument.IsNotNull(() => streamRoot);

            var root = new PdbRoot(streamRoot);
            using (var brDirectory = StreamReader(streamRoot))
            {
                var streamCount = brDirectory.ReadInt32();
                if (streamCount != 0x0131CA0B)
                {
                    var streams = root.Streams;
                    for (var i = 0; i < streamCount; i++)
                    {
                        var stream = new PdbStream();
                        streams.Add(stream);

                        var byteCount = brDirectory.ReadInt32();
                        stream.ByteCount = byteCount;

                        var pageCount = CountPages(byteCount);
                        stream.Pages = new int[pageCount];
                    }

                    for (var i = 0; i < streamCount; i++)
                    {
                        for (var j = 0; j < streams[i].Pages.Length; j++)
                        {
                            var page = brDirectory.ReadInt32();
                            streams[i].Pages[j] = page;
                        }
                    }
                }
            }

            return root;
        }
示例#8
0
文件: PdbRoot.cs 项目: mwatts/GitLink
        public int AddStream(PdbStream stream)
        {
            Streams.Add(stream);

            return Streams.Count - 1;
        }