コード例 #1
0
        /// <summary>
        /// Returns cached result of calling <see cref="PortablePdbSymbolReader.GetEmbeddedFiles(string)"/>
        /// </summary>
        public static Dictionary <string, CompressedSourceFile> GetEmbeddedFiles(string pdbLocation)
        {
            if (pdbLocation == null)
            {
                return(null);
            }

            if (_cache == null)
            {
                _cache = new Dictionary <string, Dictionary <string, CompressedSourceFile> >();
            }

            Dictionary <string, CompressedSourceFile> embeddedFilesFromPath = null;

            if (_cache.TryGetValue(pdbLocation, out embeddedFilesFromPath))
            {
                return(embeddedFilesFromPath);
            }
            else
            {
                try
                {
                    embeddedFilesFromPath = PortablePdbSymbolReader.GetEmbeddedFiles(pdbLocation);
                }
                finally
                {
                    _cache.Add(pdbLocation, embeddedFilesFromPath);
                }
                return(embeddedFilesFromPath);
            }
        }
コード例 #2
0
ファイル: StackTrace.cs プロジェクト: Surfndez/qsharp-runtime
        /// <summary>
        /// Uses PortablePDBs and SourceLink to get URL for file and line number.
        /// </summary>
        /// <returns></returns>
        public string GetURLFromPDB()
        {
            string pdbFileLocation = PortablePdbSymbolReader.GetPDBLocation(Callable);
            string result          = PortablePDBSourceLinkInfoCache.TryGetFileUrl(pdbFileLocation, SourceFile);

            return(PortablePdbSymbolReader.TryFormatGitHubUrl(result, FailedLineNumber));
        }
コード例 #3
0
        public static SourceLinkInfo GetSourceLinkInfo(string pdbLocation)
        {
            if (pdbLocation == null)
            {
                return(null);
            }

            if (_cache == null)
            {
                _cache = new Dictionary <string, SourceLinkInfo>();
            }

            SourceLinkInfo remappings;

            if (_cache.TryGetValue(pdbLocation, out remappings))
            {
                return(remappings);
            }
            else
            {
                try
                {
                    remappings = PortablePdbSymbolReader.GetSourceLinkInfo(pdbLocation);
                }
                finally
                {
                    _cache.Add(pdbLocation, remappings);
                }
                return(remappings);
            }
        }
コード例 #4
0
ファイル: StackTrace.cs プロジェクト: Surfndez/qsharp-runtime
        /// <summary>
        /// Uses PortablePDBs and SourceLink to get the source of failed operation.
        /// </summary>
        public string GetOperationSourceFromPDB()
        {
            string pdbFileLocation = PortablePdbSymbolReader.GetPDBLocation(Callable);

            return(PortablePDBEmbeddedFilesCache.GetEmbeddedFileRange(
                       pdbFileLocation,
                       SourceFile,
                       DeclarationStartLineNumber,
                       DeclarationEndLineNumber,
                       showLineNumbers: true, markedLine: FailedLineNumber));
        }