From 2ace2ebcdbe7da20ace841a4cae95bdd90fbde89 Mon Sep 17 00:00:00 2001 From: marxin Date: Mon, 24 Sep 2018 11:28:38 +0000 Subject: [PATCH] Improve colorization legend in gcov reports. 2018-09-24 Martin Liska * gcov.c (output_lines): Print colorization legend for both flag_use_colors and flag_use_hotness_colors. Reword the help. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@264531 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 6 ++++++ gcc/gcov.c | 14 ++++++++++++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index eb23c853586..4b717a36b53 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,11 @@ 2018-09-24 Martin Liska + * gcov.c (output_lines): Print colorization legend + for both flag_use_colors and flag_use_hotness_colors. + Reword the help. + +2018-09-24 Martin Liska + * coverage.c (get_coverage_counts): Use warning_at with current_function_decl location. Use %qD in warning message. diff --git a/gcc/gcov.c b/gcc/gcov.c index 922e2de2646..e255e4e3922 100644 --- a/gcc/gcov.c +++ b/gcc/gcov.c @@ -2933,9 +2933,19 @@ output_lines (FILE *gcov_file, const source_info *src) FILE *source_file; const char *retval; - /* Print legend of color hotness syntax. */ + /* Print colorization legend. */ + if (flag_use_colors) + fprintf (gcov_file, "%s", + DEFAULT_LINE_START "Colorization: profile count: " \ + SGR_SEQ (COLOR_BG_CYAN) "zero coverage (exceptional)" SGR_RESET \ + " " \ + SGR_SEQ (COLOR_BG_RED) "zero coverage (unexceptional)" SGR_RESET \ + " " \ + SGR_SEQ (COLOR_BG_MAGENTA) "unexecuted block" SGR_RESET "\n"); + if (flag_use_hotness_colors) - fprintf (gcov_file, "%s", DEFAULT_LINE_START "Hotness legend: " \ + fprintf (gcov_file, "%s", + DEFAULT_LINE_START "Colorization: line numbers: hotness: " \ SGR_SEQ (COLOR_BG_RED) "> 50%" SGR_RESET " " \ SGR_SEQ (COLOR_BG_YELLOW) "> 20%" SGR_RESET " " \ SGR_SEQ (COLOR_BG_GREEN) "> 10%" SGR_RESET "\n"); -- 2.11.4.GIT