From: Jørgen Kvalsvik Date: Mon, 3 Nov 2025 23:05:04 +0000 (+0100) Subject: gcov-dump: Print PATHS tag X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5380be91759731d8fc4a8d5728b672aacbdb2173;p=thirdparty%2Fgcc.git gcov-dump: Print PATHS tag Print the record associated with the PATHS tag. While it just prints the number of prime paths for the function, this is more useful than the UNKNOWN it would otherwise print. Before: ... demo.gcno: 01450000: 31:LINES demo.gcno: block 6:`demo.c':13 demo.gcno: 01490000: 4:UNKNOWN After: ... demo.gcno: 01450000: 31:LINES demo.gcno: block 6:`demo.c':13 demo.gcno: 01490000: 4:PATHS 5 paths gcc/ChangeLog: * gcov-dump.cc (tag_paths): New function. --- diff --git a/gcc/gcov-dump.cc b/gcc/gcov-dump.cc index b3fc4279867..0f9992c60f1 100644 --- a/gcc/gcov-dump.cc +++ b/gcc/gcov-dump.cc @@ -39,6 +39,7 @@ static void tag_function (const char *, unsigned, int, unsigned); static void tag_blocks (const char *, unsigned, int, unsigned); static void tag_arcs (const char *, unsigned, int, unsigned); static void tag_conditions (const char *, unsigned, int, unsigned); +static void tag_paths (const char *, unsigned, int, unsigned); static void tag_lines (const char *, unsigned, int, unsigned); static void tag_counters (const char *, unsigned, int, unsigned); static void tag_summary (const char *, unsigned, int, unsigned); @@ -79,6 +80,7 @@ static const tag_format_t tag_table[] = {GCOV_TAG_BLOCKS, "BLOCKS", tag_blocks}, {GCOV_TAG_ARCS, "ARCS", tag_arcs}, {GCOV_TAG_CONDS, "CONDITIONS", tag_conditions}, + {GCOV_TAG_PATHS, "PATHS", tag_paths}, {GCOV_TAG_LINES, "LINES", tag_lines}, {GCOV_TAG_OBJECT_SUMMARY, "OBJECT_SUMMARY", tag_summary}, {0, NULL, NULL} @@ -417,6 +419,15 @@ tag_conditions (const char *filename, unsigned /* tag */, int length, } } } + +static void +tag_paths (const char *filename ATTRIBUTE_UNUSED, + unsigned tag ATTRIBUTE_UNUSED, int length ATTRIBUTE_UNUSED, + unsigned depth ATTRIBUTE_UNUSED) +{ + printf (" %u paths", gcov_read_unsigned ()); +} + static void tag_lines (const char *filename ATTRIBUTE_UNUSED, unsigned tag ATTRIBUTE_UNUSED, int length ATTRIBUTE_UNUSED,