private string FindPdbFile()

in GoogleTestAdapter/DiaResolver/DiaResolver.cs [90:126]


        private string FindPdbFile(string binary, string pathExtension)
        {
            IList<string> attempts = new List<string>();
            string pdb = PeParser.ExtractPdbPath(binary, _logger);
            if (pdb != null && File.Exists(pdb))
                return pdb;
            attempts.Add($"\"{binary}\"");

            pdb = Path.ChangeExtension(binary, ".pdb");
            if (File.Exists(pdb))
                return pdb;
            attempts.Add($"\"{pdb}\"");

            pdb = Path.GetFileName(pdb);
            if (pdb == null || File.Exists(pdb))
                return pdb;
            attempts.Add($"\"{pdb}\"");

            string path = Environment.GetEnvironmentVariable("PATH");
            if (!string.IsNullOrEmpty(pathExtension))
                path = $"{pathExtension};{path}";
            var pathElements = path?.Split(';');
            if (path != null)
            {
                foreach (string pathElement in pathElements)
                {
                    string file = Path.Combine(pathElement, pdb);
                    if (File.Exists(file))
                        return file;
                    attempts.Add($"\"{file}\"");
                }
            }

            _logger.DebugInfo(String.Format(Resources.AttemptsToFind, string.Join("::", attempts)));

            return null;
        }