This patch is work in progress, but has already shown itself to be useful.
For large traces understanding the analyzer output can be painful, especially when arrows indicating the flow start to loop around.
This patch provides an alternative output method: simply iterate over all program points in a bug report, and dump them to the associated C statements (with program-line-based granularity).
In the ideal case (which we currently don't aim to get) the resulting program is a refinement of an input which goes through the indicated error path.
In the current case, it is a C-like visualization (as some statements are unexpectedly dropped, and some context is missing) of what the error path is.
Sample output is:
gram.c:18444|int yychar; gram.c:18447|YYSTYPE yylval; gram.c:18450|int yynerrs; gram.c:18452|YYLTYPE yylloc; gram.c:18454| register int yystate; gram.c:18455| register int yyn; gram.c:18456| int yyresult; gram.c:18458| int yyerrstatus; gram.c:18460| int yytoken = 0; gram.c:18471| short yyssa[YYINITDEPTH]; gram.c:18472| short *yyss = yyssa; gram.c:18473| register short *yyssp; gram.c:18476| YYSTYPE yyvsa[YYINITDEPTH]; gram.c:18477| YYSTYPE *yyvs = yyvsa; gram.c:18478| register YYSTYPE *yyvsp; gram.c:18481| YYLTYPE yylsa[YYINITDEPTH]; gram.c:18482| YYLTYPE *yyls = yylsa; gram.c:18483| YYLTYPE *yylsp; gram.c:18484| YYLTYPE *yylerrsp; gram.c:18488| YYSIZE_T yystacksize = YYINITDEPTH; gram.c:18492| YYSTYPE yyval; gram.c:18493| YYLTYPE yyloc; gram.c:18497| int yylen; gram.c:18501| yystate = 0; gram.c:18502| yyerrstatus = 0; gram.c:18503| yynerrs = 0; gram.c:18504| yychar = YYEMPTY; /* Cause a token to be read. */ gram.c:18511| yyssp = yyss; gram.c:18512| yyvsp = yyvs; gram.c:18513| yylsp = yyls; gram.c:18646| if (yyn == YYFINAL) gram.c:18653| if (yychar != YYEOF) gram.c:18654| yychar = YYEMPTY; gram.c:18656| *++yyvsp = yylval; gram.c:18657| *++yylsp = yylloc; gram.c:18661| if (yyerrstatus) gram.c:18664| yystate = yyn; gram.c:18523| yyssp++; gram.c:18526| *yyssp = yystate; gram.c:18528| if (yyss + yystacksize - 1 <= yyssp) gram.c:18608| yyn = yypact[yystate]; gram.c:18609| if (yyn == YYPACT_NINF) gram.c:18615| if (yychar == YYEMPTY) gram.c:18618| yychar = YYLEX; gram.c:18621| if (yychar <= YYEOF) gram.c:18628| yytoken = YYTRANSLATE (yychar); gram.c:18634| yyn += yytoken; gram.c:18635| if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) gram.c:18637| yyn = yytable[yyn]; gram.c:18638| if (yyn <= 0) gram.c:18640| if (yyn == 0 || yyn == YYTABLE_NINF) gram.c:18642| yyn = -yyn; gram.c:18683| yylen = yyr2[yyn]; gram.c:18693| yyval = yyvsp[1-yylen]; gram.c:18696| YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen); gram.c:18698| switch (yyn) gram.y:11696| TypeName *t = makeTypeNameFromNameList(yyvsp[-4].list); gram.y:11697| ListCell *lc; gram.y:11704| foreach(lc, yyvsp[-2].list) gram.y:11714| t->typmods = yyvsp[-2].list; gram.y:11715| t->location = yylsp[-4];
spaces around '=' (maybe clang-format this diff ?)