示例#1
0
 public ErrorMatch Match(ReadOnlyLineBuffer Input)
 {
     // Do the match in two phases so we can early out if the strings "error" or "warning" are not present. The patterns before these strings can
     // produce many false positives, making them very slow to execute.
     if (Input.IsMatch("error"))
     {
         if (Input.IsMatch(@"([^(]+)(\([\d,]+\))? ?: (fatal )?error [a-zA-Z]+[\d]+"))
         {
             return(ParseVisualCppMatch(Input, ErrorSeverity.Error));
         }
         if (Input.IsMatch(@"\s*" + ClangFileLinePattern + @"\s*error\s*:"))
         {
             return(ParseClangMatch(Input, ErrorSeverity.Error));
         }
     }
     if (Input.IsMatch("warning"))
     {
         if (Input.IsMatch(@"([^(]+)(\([\d,]+\))? ?: warning[ :]"))
         {
             return(ParseVisualCppMatch(Input, ErrorSeverity.Warning));
         }
         if (Input.IsMatch(@"\s*" + ClangFileLinePattern + @"\s*warning\s*:"))
         {
             return(ParseClangMatch(Input, ErrorSeverity.Warning));
         }
     }
     return(null);
 }
        public ErrorMatch Match(ReadOnlyLineBuffer Input)
        {
            Match Match;

            if (Input.TryMatch(@"^(\s*)([a-zA-Z_][a-zA-Z0-9_]*):\s*(Error|Warning|Display): ", out Match))
            {
                int MaxOffset = Input.MatchForwards(0, String.Format(@"^({0} | *$)", Match.Groups[1].Value));

                ErrorSeverity Severity;
                switch (Match.Groups[3].Value)
                {
                case "Error":
                    Severity = ErrorSeverity.Error;
                    break;

                case "Warning":
                    Severity = ErrorSeverity.Warning;
                    break;

                default:
                    Severity = ErrorSeverity.Silent;
                    break;
                }

                ErrorMatch Error = new ErrorMatch(Severity, ErrorPriority.Low, "Log", Input, 0, MaxOffset);
                Error.Properties["Channel"] = Match.Groups[2].Value;
                return(Error);
            }
            return(null);
        }
示例#3
0
        static ErrorMatch ParseClangMatch(ReadOnlyLineBuffer Input, ErrorSeverity Severity)
        {
            string Indent = ExtractIndent(Input[0]);

            int MinOffset = Input.MatchBackwards(0, String.Format(@"^(?:{0}).*(?:In (member )?function|In file included from)", Indent));
            int MaxOffset = Input.MatchForwards(0, String.Format(@"^({0} |{0}{1}\s*note:| *\$)", Indent, ClangFileLinePattern));

            return(new ErrorMatch(Severity, ErrorPriority.High, "Compile", Input, MinOffset, MaxOffset));
        }
示例#4
0
 public ErrorMatch Match(ReadOnlyLineBuffer Input)
 {
     if (Input.IsMatch(@"\s*----+Build System Warning----+"))
     {
         int MaxOffset = Input.MatchForwards(0, @"^\s*[A-Za-z]");
         return(new ErrorMatch(ErrorSeverity.Warning, ErrorPriority.Normal, "Xoreax", Input, 0, MaxOffset));
     }
     return(null);
 }
示例#5
0
 public ErrorMatch Match(ReadOnlyLineBuffer Input)
 {
     if (Input.IsMatch(@"^\s*Unhandled Exception: "))
     {
         int MaxOffset = Input.MatchForwards(0, @"^\s*at ");
         return(new ErrorMatch(ErrorSeverity.Error, ErrorPriority.Low, "Exception", Input, 0, MaxOffset));
     }
     return(null);
 }
示例#6
0
        public ErrorMatch Match(ReadOnlyLineBuffer Input)
        {
            Match Match;

            if (Input.TryMatch(@"^(\s*)WARNING: ThreadSanitizer:", out Match))
            {
                int EndIdx = Input.MatchForwards(0, String.Format(@"^([ ]*|{0}  .*|{0}SUMMARY:.*)\$", Match.Groups[1].Value));
                return(new ErrorMatch(ErrorSeverity.Warning, ErrorPriority.Normal, "ThreadSanitizer", Input, 0, EndIdx));
            }
            return(null);
        }
示例#7
0
        static ErrorMatch ParseVisualCppMatch(ReadOnlyLineBuffer Input, ErrorSeverity Severity)
        {
            string Pattern = String.Format("^{0} |: note:", ExtractIndent(Input[0]));

            int EndIdx = 0;

            while (Input.IsMatch(EndIdx + 1, Pattern))
            {
                EndIdx++;
            }

            return(new ErrorMatch(Severity, ErrorPriority.High, "Compile", Input, 0, EndIdx));
        }
示例#8
0
 public ErrorMatch Match(ReadOnlyLineBuffer Input)
 {
     if (Input.IsMatch(@"error: linker command failed with exit code "))
     {
         int MinIdx = Input.MatchBackwards(0, ": In function |: undefined reference to |[^a-zA-Z]ld: ");
         return(new ErrorMatch(ErrorSeverity.Error, ErrorPriority.Normal, "Link", Input, MinIdx, 0));
     }
     if (Input.IsMatch("Undefined symbols for architecture"))
     {
         int MaxOffset = Input.MatchForwardsUntil(0, "ld: symbol");
         return(new ErrorMatch(ErrorSeverity.Error, ErrorPriority.Normal, "Link", Input, 0, MaxOffset));
     }
     if (Input.IsMatch(@"LINK : fatal error"))
     {
         return(new ErrorMatch(ErrorSeverity.Error, ErrorPriority.Normal, "Link", Input));
     }
     return(null);
 }
示例#9
0
 public ErrorMatch Match(ReadOnlyLineBuffer Input)
 {
     if (Input.IsMatch(@"^\s*FATAL:"))
     {
         return(new ErrorMatch(ErrorSeverity.Error, ErrorPriority.Low, "Generic", Input));
     }
     if (Input.IsMatch(@"(?<!\w)(ERROR|[Ee]rror)( (\([^)]+\)|\[[^\]]+\]))?: "))
     {
         int MaxOffset = Input.MatchForwards(0, String.Format(@"^({0} | *$)", ExtractIndent(Input[0])));
         return(new ErrorMatch(ErrorSeverity.Error, ErrorPriority.Lowest, "Generic", Input, 0, MaxOffset));
     }
     if (Input.IsMatch(@"(?<!\w)(WARNING|[Ww]arning)( (\([^)]+\)|\[[^\]]+\]))?: "))
     {
         int MaxOffset = Input.MatchForwards(0, String.Format(@"^({0} | *$)", ExtractIndent(Input[0])));
         return(new ErrorMatch(ErrorSeverity.Warning, ErrorPriority.Lowest, "Generic", Input, 0, MaxOffset));
     }
     if (Input.IsMatch(@"[Ee]rror [A-Z]\d+\s:"))
     {
         return(new ErrorMatch(ErrorSeverity.Error, ErrorPriority.Lowest, "Generic", Input));
     }
     return(null);
 }
示例#10
0
 public ErrorMatch Match(ReadOnlyLineBuffer Input)
 {
     if (Regex.IsMatch(Input[0], "begin: stack for UAT"))
     {
         for (int Idx = 1; Idx < 100; Idx++)
         {
             if (Regex.IsMatch(Input[Idx], "end: stack for UAT"))
             {
                 return(new ErrorMatch(ErrorSeverity.Error, ErrorPriority.BelowNormal, "crash", Input, 0, Idx));
             }
         }
     }
     if (Input.IsMatch("AutomationTool: Stack:"))
     {
         int EndOffset = Input.MatchForwards(0, "AutomationTool: Stack:");
         return(new ErrorMatch(ErrorSeverity.Error, ErrorPriority.Low, "Crash", Input, 0, EndOffset));
     }
     if (Input.IsMatch("ExitCode=(3|139|255)"))
     {
         return(new ErrorMatch(ErrorSeverity.Error, ErrorPriority.Low, "Crash", Input));
     }
     return(null);
 }