Beispiel #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Pdb70VirtualStream"/> class.
 /// </summary>
 /// <param name="file">The file.</param>
 /// <param name="stream">The stream.</param>
 public Pdb70VirtualStream(Pdb70File file, Pdb70StreamInfo stream)
 {
     _file = file;
     _stream = stream;
     _buffer = new byte[_file._header.PageSize];
     _currentIndex = -1;
 }
            /// <summary>
            /// Initializes a new instance of the <see cref="Pdb70SymbolMetadata"/> class.
            /// </summary>
            /// <param name="file">The file.</param>
            public Pdb70SymbolMetadata(Pdb70File file)
            {
                _file = file;

                var arr = _file.Guid.ToByteArray();
                var sb = new StringBuilder((arr.Length * 2) + 1);
                foreach (var b in arr) sb.AppendFormat(CultureInfo.InvariantCulture, "{0:x2}", b);
                sb.AppendFormat(CultureInfo.InvariantCulture, "{0}", _file.Age);
                Identifier = sb.ToString();
            }
Beispiel #3
0
        /// <summary>
        /// Asynchronously parses the SRCSRV stream in the specified PDB file.
        /// </summary>
        /// <param name="file">The file.</param>
        /// <param name="cancellationToken">The cancellation token.</param>
        /// <returns>
        /// A <see cref="Task{SourceInformationCollection}"/> that represents the asynchronous parses operation.
        /// </returns>
        public static Task<SourceInformationCollection> ParseAsync(Pdb70File file, CancellationToken cancellationToken)
        {
            if (!file.StreamExists("srcsrv")) return null;

            using (var reader = new StreamReader(file.GetStream("srcsrv")))
            {
                return ParseAsync(reader, cancellationToken);
            }
        }