Esempio n. 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);
            }
        }
Esempio n. 2
0
        /// <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));
        }
Esempio n. 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);
            }
        }
Esempio n. 4
0
        /// <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));
        }