public PdbRoot(PdbStream stream) { Argument.IsNotNull(() => stream); Stream = stream; Streams = new List<PdbStream>(); }
public byte[] ReadPdbStreamBytes(PdbStream pdbStream) { Argument.IsNotNull(() => pdbStream); return ReadStreamBytes(pdbStream); }
private BinaryReader StreamReader(PdbStream stream) { return new BinaryReader(ReadStream(stream)); }
private MemoryStream ReadStream(PdbStream stream) { return new MemoryStream(ReadStreamBytes(stream)); }
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; }
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; }
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; }
public int AddStream(PdbStream stream) { Streams.Add(stream); return Streams.Count - 1; }